@font-face{font-family:ShopSans;src:local('Microsoft JhengHei')}@font-face{font-family:ShopSerif;src:local('Noto Serif TC'),local('PMingLiU')}
:root{--ink:#20392f;--green:#183e35;--green2:#306c58;--lime:#dce9a8;--paper:#f5f3ed;--white:#fffefa;--line:#dedfd5;--muted:#69746a;--amber:#84521c;--amber-bg:#fcf0d9;--red:#9d4036;--shadow:0 16px 50px #183e3512;--radius:20px;font-family:ShopSans,'PingFang TC',sans-serif;color:var(--ink);background:var(--paper);font-size:15px}
*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer;min-height:46px;border:1px solid var(--line);border-radius:12px;padding:10px 16px;background:var(--white);color:var(--ink);font-weight:600;transition:background .16s,transform .16s}button:hover{background:#ecefe5}button:active{transform:scale(.98)}button:disabled{opacity:.48;cursor:not-allowed}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #87a948;outline-offset:3px}button.primary{background:var(--green);color:white;border-color:var(--green)}button.primary:hover{background:#285b49}button.lime{background:var(--lime);border-color:var(--lime)}button.ghost{background:transparent;border-color:transparent}button.danger{color:var(--red)}button.small{padding:8px 12px;font-size:13px}h1,h2,h3,p{margin:0}h1{font-size:32px;letter-spacing:-1px}h2{font-size:24px;letter-spacing:-.5px}h3{font-size:18px}.serif{font-family:ShopSerif,serif}small,.muted{color:var(--muted)}small{font-size:12px;line-height:1.6}.eyebrow{font-size:11px;letter-spacing:2px;font-weight:700;color:var(--muted);text-transform:uppercase}.num{font-family:'Bahnschrift','DIN Alternate',sans-serif;font-variant-numeric:tabular-nums}.flex{display:flex;align-items:center;gap:12px}.between{justify-content:space-between}.wrap{flex-wrap:wrap}.stack{display:grid;gap:14px}.spacer{flex:1}.icon{width:21px;height:21px;vertical-align:middle;flex:none;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.chip{display:inline-flex;gap:6px;align-items:center;padding:5px 9px;border-radius:7px;font-size:12px;font-weight:600;background:#e8ede2;white-space:nowrap}.chip.warn{color:var(--amber);background:var(--amber-bg)}.chip.done{color:var(--green2);background:#e2eee4}.chip.readonly{color:#5e6175;background:#eaebf3}.chip.new{background:#dce9a8;color:#304626}.app-shell{display:grid;grid-template-columns:92px minmax(0,1fr);min-height:100dvh}.rail{position:sticky;top:0;height:100dvh;background:var(--green);color:#dae4d1;padding:26px 10px 14px;display:flex;align-items:center;flex-direction:column;gap:15px}.brandmark{width:45px;height:45px}.rail .brandword{font-family:ShopSerif,serif;font-size:19px;letter-spacing:3px;margin:0 0 18px 3px}.rail button{width:70px;display:grid;place-items:center;gap:5px;padding:9px 3px;background:none;border:0;color:#c3d2c3;border-radius:14px;font-size:11px;font-weight:500}.rail button.active{background:#ffffff16;color:var(--lime)}.rail .icon{width:23px;height:23px}.rail-footer{margin-top:auto;font-size:10px;writing-mode:vertical-rl;letter-spacing:3px;opacity:.6}.workspace{min-width:0}.topbar{height:86px;padding:0 34px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:20px;background:#fffefa8c}.topbar .title{font-weight:700;letter-spacing:1px}.day-input{background:transparent;border:0;padding:8px 0;font-weight:600;color:var(--ink);min-height:44px;max-width:145px}.topbar .role{border-radius:50px;padding:7px 12px;font-size:12px}.avatar{width:33px;height:33px;display:grid;place-items:center;border-radius:50%;background:#e3e8d9;font-size:12px;font-weight:700}.connection{font-size:12px}.dot{width:7px;height:7px;border-radius:50%;background:#668638;display:inline-block;margin-right:6px}.content{padding:30px 34px 110px;max-width:1600px;margin:auto}.page-intro{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:26px}.page-intro p{margin-top:9px;color:var(--muted);font-size:14px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:27px}.stat{padding:20px 24px;background:var(--white);border:1px solid var(--line);border-radius:16px;display:flex;align-items:center;gap:20px}.stat:first-child{background:var(--green);color:var(--white);border-color:var(--green)}.stat:first-child small{color:#b9c9bb}.stat b{font-size:35px;line-height:1.1}.stat .stat-label{font-size:13px;margin-bottom:5px}.board{display:grid;grid-template-columns:340px minmax(0,1fr);gap:24px;align-items:start}.customer-pane{min-width:0}.search{display:flex;align-items:center;background:#eeeee6;border:1px solid var(--line);border-radius:12px;padding:0 13px;gap:10px;margin-bottom:14px}.search input{border:0;background:none;outline:none;min-width:0;width:100%;height:48px}.tabs{display:flex;gap:7px;overflow:auto;scrollbar-width:none;margin-bottom:17px}.tabs button{white-space:nowrap;min-height:42px;font-size:13px;background:transparent;border-color:transparent;padding:8px 13px}.tabs button.active{background:var(--white);border-color:var(--line)}.customer-card{width:100%;text-align:left;border-radius:16px;margin-bottom:10px;padding:18px;background:var(--white);font-weight:400;position:relative}.customer-card.selected{border-color:var(--green2);box-shadow:inset 3px 0 var(--green2),var(--shadow)}.customer-card .initial{height:42px;width:42px;display:grid;place-items:center;border-radius:13px;background:#eeeee3;font-family:ShopSerif,serif;font-size:23px;color:#5c6b45}.customer-card h3{font-size:17px;margin-bottom:5px}.customer-card .meta{display:flex;justify-content:space-between;margin-top:19px;font-size:12px;color:var(--muted)}.progress{height:4px;border-radius:5px;background:#ecefe7;margin-top:10px;overflow:hidden}.progress span{display:block;background:#73945a;height:100%}.detail{background:var(--white);border:1px solid var(--line);border-radius:22px;min-width:0;overflow:hidden;box-shadow:var(--shadow)}.detail-head{padding:24px 25px 18px;border-bottom:1px solid var(--line)}.detail-head .eyebrow{margin-bottom:9px}.detail-head .tabs{margin:16px 0 0}.detail-body{padding:22px 25px}.detail-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:17px}.notice{padding:13px 15px;border-radius:12px;background:var(--amber-bg);color:var(--amber);font-size:13px;line-height:1.7;margin-bottom:16px}.notice.info{background:#eaf0e5;color:#416447}.notice.error{background:#f9e7e3;color:var(--red)}.notice button{padding:0 7px;min-height:34px;border:0;background:transparent;color:inherit;text-decoration:underline}.order-switch{display:flex;gap:8px;overflow:auto;margin-bottom:16px}.order-switch button{font-size:12px;white-space:nowrap}.order-switch button.active{background:var(--green);color:white}.item{border:1px solid var(--line);border-radius:15px;padding:17px;margin-bottom:12px;background:white}.item-top{display:flex;gap:12px;align-items:start;margin-bottom:16px}.row-number{color:#7e8a76;font-size:12px;padding-top:5px}.item h3{font-size:18px;margin-bottom:4px}.item-top small{font-size:11px}.item-top .edit{margin-left:auto;min-width:48px}.item-grid{display:grid;grid-template-columns:1fr 1.1fr 1fr;gap:12px;align-items:center}.item-grid .label{font-size:11px;color:var(--muted);display:block;margin-bottom:5px}.ordered{font-size:21px}.ordered span{font-size:12px;font-family:ShopSans,sans-serif}.weight-btn{width:100%;background:#f1f4e8;border:1px solid #d1ddbe;min-height:57px;text-align:left;display:flex;justify-content:space-between;align-items:center;padding:8px 13px}.weight-btn strong{font-size:25px;font-weight:500}.weight-btn.empty strong{font-size:16px;color:#668147}.amount{text-align:right;font-size:23px}.amount small{font-size:11px;display:block;margin-bottom:3px}.item-foot{display:flex;justify-content:space-between;gap:8px;margin-top:13px;color:var(--muted);font-size:11px}.detail-footer{padding:20px 25px;background:#f4f5ec;border-top:1px solid var(--line)}.detail-footer .total{font-size:32px}.detail-footer .actions{display:flex;gap:9px;margin-top:15px}.detail-footer .actions button{flex:1}.detail-footer .actions button.primary{flex:1.5}.section-label{font-size:12px;letter-spacing:1px;color:var(--muted);margin-bottom:14px}.source-card{padding:20px;border:1px solid var(--line);border-radius:15px;margin-bottom:14px}.source-text{white-space:pre-wrap;background:#f0f3e9;padding:17px;border-radius:4px 16px 16px 16px;margin:14px 0;line-height:1.9}.source-paper{background:#fffef7;border:1px solid #e1dccd;box-shadow:0 8px 20px #51462912;margin:15px 0;padding:25px;transform:rotate(-1deg);font-family:ShopSerif,serif;font-size:21px;line-height:2;white-space:pre-wrap}.source-card label{display:flex;gap:12px;align-items:center}.source-card input[type=checkbox]{width:23px;height:23px;accent-color:var(--green)}.empty{padding:65px 22px;text-align:center;color:var(--muted);line-height:1.9}.empty .icon{width:40px;height:40px;color:#93a07d;margin-bottom:15px}.empty h3{color:var(--ink);margin-bottom:8px}.setting-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}.panel{background:var(--white);border:1px solid var(--line);border-radius:18px;padding:24px}.panel h3{margin-bottom:17px}.setting-row{padding:16px 0;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:18px}.setting-row:last-child{border-bottom:0}.setting-row small{display:block;margin-top:5px}.toggle{border:0;width:46px;height:28px;min-height:28px;padding:3px;border-radius:50px;background:#d8ddd0;flex:none}.toggle:before{content:'';display:block;width:22px;height:22px;border-radius:50%;background:white;box-shadow:0 2px 4px #0002;transition:transform .15s}.toggle.on{background:var(--green2)}.toggle.on:before{transform:translateX(18px)}.field{display:grid;gap:7px;margin-bottom:16px;min-width:0}.field label{font-size:13px;font-weight:600}.field input,.field select,.field textarea{width:100%;min-height:48px;border:1px solid var(--line);border-radius:10px;background:white;padding:11px;color:var(--ink)}.field textarea{min-height:88px}.field input[type=number]{font-variant-numeric:tabular-nums;font-size:19px}.fields{display:grid;grid-template-columns:1fr 1fr;gap:15px}.full{grid-column:1/-1}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;font-size:14px}th{text-align:left;font-size:12px;color:var(--muted);padding:12px 8px;border-bottom:1px solid var(--line)}td{padding:14px 8px;border-bottom:1px solid var(--line)}.inventory-row{display:grid;grid-template-columns:2fr 1fr 1fr 46px;gap:10px;margin-bottom:10px}.inventory-row input,.inventory-row select{min-width:0;width:100%;border:1px solid var(--line);border-radius:10px;padding:12px;background:white}.mobile-nav{display:none}.mobile-back{display:none}.demo-banner{font-size:11px;letter-spacing:.4px;color:var(--muted);padding:13px 0 0}.demo-banner a{color:var(--green2)}dialog{border:0;border-radius:24px;padding:0;width:min(580px,calc(100% - 30px));max-height:90dvh;background:var(--white);color:var(--ink);box-shadow:0 30px 100px #0003}dialog::backdrop{background:#10281dc0;backdrop-filter:blur(5px)}.sheet-head{display:flex;align-items:center;justify-content:space-between;padding:22px 25px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--white);z-index:2}.sheet-body{padding:24px 25px}.sheet-actions{display:flex;gap:10px;margin-top:22px}.sheet-actions button{flex:1}.scale-display{background:var(--green);color:#f5f7e9;border-radius:16px;text-align:right;padding:20px 24px;margin:18px 0}.scale-display .num{font-size:54px;letter-spacing:2px;min-height:65px}.scale-display small{color:#c2d0ba}.keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.keypad button{font-size:25px;font-weight:500;min-height:58px;background:#f1f2e9}.keypad button.key-action{font-size:15px}.scale-nav{display:flex;gap:9px;margin-top:16px}.scale-nav button{flex:1}#toast{position:fixed;bottom:90px;left:50%;transform:translate(-50%,20px);background:var(--green);color:white;border:1px solid #a8b990;padding:14px 22px;border-radius:14px;z-index:20;box-shadow:var(--shadow);opacity:0;pointer-events:none;transition:.2s;max-width:90%;font-size:14px}#toast.show{opacity:1;transform:translate(-50%,0)}.receipt{padding:24px;background:white;border:1px solid var(--line);margin-bottom:20px}.receipt h2{font-family:ShopSerif,serif;letter-spacing:4px;text-align:center;margin-bottom:8px}.receipt .caption{text-align:center;font-size:12px;color:var(--muted);margin-bottom:20px}.receipt .num{font-weight:600}.receipt-total{text-align:right;font-size:24px;margin-top:20px}.receipt .stamp{padding:8px 0;margin:10px 0;border-block:1px dashed var(--ink);font-size:13px}.loading{padding:60px}.conflict-row{padding:18px;border:1px solid #e6c5b6;border-radius:12px;margin-top:12px}.conflict-row pre{font-size:12px;overflow:auto}.compare{display:grid;grid-template-columns:1fr 1fr;gap:12px}.compare>div{background:#f4f3eb;padding:13px;border-radius:10px}.compare p{line-height:2;font-size:13px}.source-image{width:100%;max-height:60vh;object-fit:contain;background:#f5f1e5}.print-only{display:none}
@media(min-width:1450px){.board{grid-template-columns:360px minmax(0,1fr)}.detail-body{padding:25px 30px}.item{padding:20px}.content{padding-top:35px}}
@media(max-width:1100px){.topbar{padding:0 22px;gap:12px}.content{padding:25px 22px 100px}.board{grid-template-columns:285px minmax(0,1fr);gap:16px}.app-shell{grid-template-columns:76px minmax(0,1fr)}.rail{padding-inline:4px}.detail-head,.detail-body,.detail-footer{padding:19px}.item{padding:14px}.item-grid{gap:8px}.topbar .connection{display:none}.stats .stat{padding:18px}.page-intro h1{font-size:29px}}
@media(max-width:850px){.app-shell{display:block}.rail{display:none}.topbar{height:72px;padding:0 22px}.board{grid-template-columns:250px minmax(0,1fr);gap:14px}.content{padding:23px 18px 110px}.topbar .eyebrow{display:none}.mobile-nav{display:flex;position:fixed;bottom:0;inset-inline:0;background:#fffefaef;backdrop-filter:blur(20px);border-top:1px solid var(--line);padding:6px 12px max(8px,env(safe-area-inset-bottom));z-index:5;justify-content:space-around}.mobile-nav button{display:grid;place-items:center;gap:4px;border:0;background:transparent;padding:7px 12px;min-width:58px;font-size:11px;color:var(--muted)}.mobile-nav button.active{color:var(--green);background:#eaf0df}.mobile-nav .icon{width:22px;height:22px}.detail-head,.detail-body,.detail-footer{padding:16px}.item-grid{grid-template-columns:.85fr 1.1fr .85fr}.item-grid .amount{font-size:19px}.weight-btn{padding:8px;min-height:54px}.weight-btn strong{font-size:23px}.setting-grid{gap:16px}.stat{gap:12px}.stats b{font-size:30px}}
@media(max-width:640px){.topbar{height:69px;padding:0 18px;gap:12px}.topbar .title{font-size:15px}.topbar .day-wrap{margin-left:auto}.topbar .role{border:0;background:transparent;padding:0;min-width:35px}.topbar .role .role-name{display:none}.topbar .day-input{font-size:12px;width:130px}.topbar .desktop-only{display:none}.content{padding:25px 18px 115px}.page-intro{margin-bottom:23px;align-items:center}.page-intro h1{font-size:30px}.page-intro p{font-size:12px}.page-intro>.primary{font-size:13px;padding:11px 13px}.page-intro>.primary .icon{width:17px}.stats{gap:8px;margin-bottom:24px}.stat{padding:16px 13px!important;display:block;border-radius:14px}.stat b{font-size:31px;display:block;margin-bottom:7px}.stat .stat-label{font-size:12px}.stat small{font-size:10px}.board{display:block}.board:not(.show-detail) .detail{display:none}.board.show-detail .customer-pane{display:none}.board.show-detail .detail{border:0;box-shadow:none;background:transparent;overflow:visible;border-radius:0}.detail-head{padding:0 0 18px}.detail-body{padding:18px 0}.detail-footer{padding:18px 0;background:transparent}.mobile-back{display:inline-flex;align-items:center;margin-bottom:17px;padding:0;min-height:38px;color:var(--muted);border:0;background:none}.detail-head h2{font-size:29px}.customer-card{padding:18px;margin-bottom:12px}.customer-card h3{font-size:18px}.item{padding:17px;border-radius:17px}.item-grid{grid-template-columns:.8fr 1.15fr .9fr}.item-grid .amount{font-size:23px}.weight-btn{padding:9px 12px}.weight-btn strong{font-size:26px}.setting-grid{grid-template-columns:1fr}.panel{padding:20px}.detail-footer .actions{position:sticky;bottom:90px;z-index:3;padding:10px 0;background:var(--paper)}.detail-footer .actions button{padding:12px 9px}.detail-toolbar{font-size:13px}.detail-head .tabs{margin-top:18px}.order-switch button{min-height:42px}.inventory-row{grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) 68px 42px;gap:6px}.inventory-row input,.inventory-row select{padding:10px 6px;font-size:13px}.inventory-row button{padding:7px}.fields{gap:12px}.sheet-head{padding:18px 20px}.sheet-body{padding:20px}dialog{width:100%;max-height:94dvh;border-radius:24px 24px 0 0;margin:auto 0 0}.sheet-actions{padding-bottom:env(safe-area-inset-bottom)}.receipt{padding:15px}.receipt td{font-size:12px;padding:10px 4px}.receipt th{font-size:11px;padding:10px 4px}.compare{grid-template-columns:1fr}.demo-banner{font-size:10px}.keypad button{min-height:56px}}
[hidden]{display:none!important}
.transaction-state{font-size:12px;color:var(--green2);margin-top:6px;line-height:1.7;max-width:250px}.footer-links{display:flex;justify-content:space-between;gap:8px;margin-top:7px}.confirm-explainer{font-size:13px;line-height:1.9;color:var(--muted);margin-top:16px}.review-compare h3{font-size:15px;margin-bottom:12px}.review-compare p{padding:9px 0;border-bottom:1px solid var(--line);line-height:1.8}.review-compare strong{display:block;font-size:13px;margin-top:12px}dialog:has(.review-compare){width:min(920px,calc(100% - 30px))}.review-compare{grid-template-columns:repeat(3,minmax(0,1fr))}.detail-footer .actions button{white-space:nowrap;font-size:13px}.detail-footer .actions button.primary{flex:1.2}
@media(max-width:640px){dialog:has(.review-compare){width:100%}.review-compare{grid-template-columns:1fr}.detail-footer .total{font-size:28px}.detail-footer .actions{gap:6px}.detail-footer .actions button{padding:12px 7px}.detail-footer .actions .icon{width:17px}.transaction-state{max-width:210px}.footer-links .small{padding:8px 4px}}
@media(min-width:641px) and (max-width:850px){.customer-card>.flex{display:grid;grid-template-columns:42px 1fr}.customer-card .initial{grid-row:1/3}.customer-card .spacer{display:none}.customer-card .chip{grid-column:2;justify-self:start}.customer-card h3{white-space:nowrap}}
@media(max-width:640px){.page-intro{display:block;position:relative;padding-bottom:60px}.page-intro h1{font-size:26px}.page-intro>.primary{position:absolute;bottom:0;right:0;white-space:nowrap;flex:none}.page-intro p{line-height:1.8}.stat small{font-size:11px}.toggle{position:relative}.toggle:after{content:'';position:absolute;inset:-9px 0}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
@media print{body>*{display:none!important}body>dialog[open]{display:block!important;position:static;margin:0;max-height:none;max-width:none;width:auto;overflow:visible;box-shadow:none;border-radius:0}dialog .sheet-head,dialog .sheet-actions,dialog .no-print{display:none!important}dialog .sheet-body{padding:0}.receipt{border:0;margin:0;break-after:page}.receipt:last-child{break-after:auto}.source-image{max-height:none}dialog::backdrop{display:none}*{-webkit-print-color-adjust:exact;print-color-adjust:exact}}

@media print{.receipt{padding:10px}.receipt h2{font-size:21px}.receipt .caption{margin-bottom:12px}.receipt .stamp{padding:6px 0;margin:8px 0}.receipt td{padding:9px 8px}.receipt th{padding:9px 8px}.receipt-total{margin-top:12px;font-size:21px}.receipt>small{margin-top:12px!important}.receipt tr{break-inside:avoid}.receipt thead{display:table-header-group}}

@media print{html,body,body>dialog[open],dialog .sheet-body{background:white!important}}

/* Customer directory and orders use separate pages at every viewport. */
.customer-directory{width:100%}.directory-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}.directory-toolbar .tabs{margin:0;gap:7px}.directory-toolbar .tabs button{min-height:46px}.new-order-shortcut{width:46px;flex:none;padding:10px}.customer-directory #customer-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}.customer-directory .customer-card{margin:0;min-height:156px}.customer-directory .empty{grid-column:1/-1}.board.show-detail{display:block}.board.show-detail .detail{width:100%}.order-back-row{padding:12px 24px 0}.order-back{display:inline-flex;align-items:center;gap:6px;min-height:44px;background:transparent;border:0;padding:8px 0;color:var(--muted);font-size:13px}.order-back-row+.detail-head{padding-top:8px}
@media(min-width:1180px){.customer-directory #customer-list{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:640px){.customer-directory #customer-list{grid-template-columns:1fr;gap:12px}.directory-toolbar{gap:8px;margin-bottom:16px}.directory-toolbar .tabs{gap:2px}.directory-toolbar .tabs button{padding:8px 11px}.order-back-row{padding:0 0 12px}.order-back-row+.detail-head{padding-top:0}}

/* All seven customer filters remain visible on touch screens. */
.directory-toolbar{align-items:flex-start}.directory-toolbar .tabs{flex:1;min-width:0;flex-wrap:wrap;overflow:visible;row-gap:8px}.filter-note{color:var(--muted);font-size:12px;line-height:1.8;margin:-5px 0 18px}

.stocktake-history{margin-top:24px}.stocktake-panel>.flex{margin-bottom:16px}.stocktake-panel h3{margin:0}.count-row{display:grid;grid-template-columns:34px minmax(100px,1fr) minmax(110px,180px) 98px;gap:16px;align-items:center;padding:18px 0;border-bottom:1px solid var(--line)}.count-number{color:var(--green2);font-size:15px}.count-product strong{display:block;font-size:19px}.count-product small{display:block;margin-top:5px}.count-quantity{position:relative}.count-quantity input{width:100%;min-height:58px;border:1px solid #d1ddbe;border-radius:12px;background:#f1f4e8;color:var(--ink);padding:10px 42px 10px 14px;font-size:24px;font-variant-numeric:tabular-nums}.count-quantity span{position:absolute;right:12px;top:20px;color:var(--muted);font-size:13px;pointer-events:none}.count-product input,.count-product select{max-width:100%;min-height:44px;border:1px solid var(--line);border-radius:8px;padding:8px}.count-next{padding:12px 8px;white-space:nowrap;font-size:13px}
@media(max-width:640px){.count-row{grid-template-columns:26px minmax(0,1fr) 94px;gap:10px;padding:16px 0}.count-product strong{font-size:17px}.count-quantity input{font-size:21px;padding-left:10px;padding-right:28px}.count-quantity span{right:7px}.count-next{grid-column:2/4;justify-self:stretch;min-height:44px;background:#f5f6ef}.stocktake-panel .notice{font-size:12px}.stocktake-history .setting-row{flex-wrap:wrap}}

.count-intro{padding-bottom:0!important;display:flex!important;align-items:center}.count-quantity input::-webkit-inner-spin-button,.count-quantity input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}

/* Jin/liang/qian must remain legible in order rows and the touch keypad. */
.weight-btn strong{font-size:clamp(16px,2.2vw,24px);line-height:1.5;white-space:normal}.scale-format{margin-top:16px}.scale-format select{min-height:44px}#scale-reading{font-size:14px;line-height:1.7;margin-top:6px;color:var(--lime);overflow-wrap:anywhere}.scale-display{margin:14px 0;padding:14px}.scale-display #scale-value{font-size:clamp(32px,9vw,48px);overflow-wrap:anywhere}

/* Visible correction targets on preparation cards. */
.edit-guidance{font-size:12px;line-height:1.7;color:var(--muted);margin-bottom:14px}.item-name{min-width:0;flex:1}.item-top .edit{white-space:nowrap;display:flex;align-items:center;gap:5px}.inline-edit{background:transparent;border:0;border-bottom:1px dashed #a3b28f;border-radius:4px;padding:4px 2px;min-height:44px;text-align:left}.inline-edit:disabled{border-bottom-color:transparent;opacity:1;cursor:default}.name-edit{font-size:18px;font-weight:700;line-height:1.5;overflow-wrap:anywhere}.order-inputs{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.unit-edit{font-size:13px}.price-edit{display:inline-flex;align-items:center;justify-content:flex-end;gap:5px;font-size:12px;line-height:1.6;max-width:100%;margin-bottom:3px}.price-edit .icon{width:14px;height:14px}.item-grid>div{min-width:0}

@media(max-width:600px){.item-grid{grid-template-columns:1fr 1fr}.item-grid>div:nth-child(2){grid-column:1 / -1;grid-row:2}.weight-btn strong{font-size:20px}.weight-btn:not(.empty) small{display:none}.price-edit{font-size:13px}.item-grid .amount{align-self:center}}

/* Phone preparation density: shorten chrome, preserve 44px correction targets. */
@media(max-width:640px){
.preparation-view .topbar{height:48px;padding:0 12px}.preparation-view .content{padding:4px 12px 100px}.preparation-view .order-back-row{padding:0}.preparation-view .order-back{min-height:44px}.preparation-view .detail-head{padding:0}.preparation-view .detail-head .eyebrow{display:none}.preparation-view .detail-head h2{font-size:22px}.preparation-view .detail-head>.flex.wrap{margin-top:0!important;gap:6px;min-height:44px}.preparation-view .detail-head .tabs{margin:0;gap:4px}.preparation-view .detail-head .tabs button{min-height:44px;padding:6px 12px}.preparation-view .detail-body{padding:6px 0}.preparation-view .order-switch{margin-bottom:4px}.preparation-view .order-switch button{min-height:44px;padding:6px 12px}.preparation-view .edit-guidance{margin:4px 0;font-size:11px}.preparation-view .detail-toolbar{margin-bottom:4px;min-height:44px}.preparation-view .detail-toolbar button{min-height:44px}.preparation-view .item{padding:8px 10px;margin-bottom:8px;border-radius:12px}.preparation-view .item-top{margin-bottom:4px;gap:8px}.preparation-view .item h3{margin:0}.preparation-view .name-edit{font-size:17px;min-height:44px;padding:2px}.preparation-view .item-top .edit{min-height:44px;padding:6px 8px}.preparation-view .item-top small{font-size:10px;line-height:1.4}.preparation-view .item-grid{grid-template-columns:88px minmax(0,1fr) 76px;gap:6px}.preparation-view .item-grid>div:nth-child(2){grid-column:auto;grid-row:auto}.preparation-view .item-grid .label{font-size:10px;margin-bottom:2px}.preparation-view .order-inputs{gap:0;flex-wrap:nowrap}.preparation-view .ordered{font-size:19px;min-width:44px}.preparation-view .unit-edit{min-width:44px;padding:3px 0}.preparation-view .weight-btn{min-height:48px;padding:6px;justify-content:center}.preparation-view .weight-btn strong{font-size:16px;line-height:1.5}.preparation-view .weight-btn:not(.empty) small{display:none}.preparation-view .weight-btn.empty{flex-direction:column;align-items:center}.preparation-view .weight-btn.empty strong{font-size:14px}.preparation-view .weight-btn.empty small{font-size:10px}.preparation-view .price-edit{min-height:44px;font-size:11px;gap:3px;margin:0}.preparation-view .item-grid .amount{font-size:19px}.preparation-view .item-foot{margin-top:4px;font-size:10px;line-height:1.4}.preparation-view .detail-footer{padding:8px 0}.preparation-view .mobile-nav{padding-top:3px;padding-bottom:max(4px,env(safe-area-inset-bottom))}.preparation-view .mobile-nav button{min-height:48px;padding:4px 10px}.preparation-view .demo-banner{margin-top:12px}
}

@media(max-width:640px){.preparation-view .detail{position:relative}.preparation-view .order-back-row{height:0}.preparation-view .order-back{position:absolute;top:0;left:0;width:44px;min-height:44px;font-size:0;justify-content:center;z-index:1}.preparation-view .order-back .icon{width:21px;height:21px}.preparation-view .detail-head>.flex:first-child{margin-left:44px;min-height:44px}.preparation-view .edit-guidance{display:none}}

/* Five-row phone view: two 44px interaction rows, secondary details in editor/source tab. */
@media(max-width:640px){
.preparation-view .item{padding:4px 10px;margin-bottom:4px;border-radius:10px}.preparation-view .item-top{margin-bottom:0;align-items:center}.preparation-view .item-top .item-name>small,.preparation-view .item-foot,.preparation-view .item-grid .label{display:none}.preparation-view .item-grid{align-items:center}.preparation-view .item-grid .amount{position:relative;align-self:center;height:48px}.preparation-view .price-edit{width:100%;height:48px;padding:0 0 19px;font-size:11px}.preparation-view .amount>div{position:absolute;bottom:1px;right:2px;font-size:14px;line-height:18px;pointer-events:none}.preparation-view .row-number{padding-top:0}.preparation-view .weight-btn.empty{flex-direction:row;gap:4px}.preparation-view .weight-btn.empty small{font-size:9px}.preparation-view .name-edit{font-size:16px}
}

/* Customer wording and mapped catalog name are adjacent, independently editable. */
.name-edit,.mapped-edit{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;min-width:44px}.field-caption{display:block;font-size:10px!important;font-weight:400;line-height:14px;color:var(--muted)}.mapped-edit{font-size:15px;line-height:20px;max-width:40%;min-height:44px}.mapped-edit.unmapped{color:var(--amber);background:var(--amber-bg)}.item-name .name-edit{max-width:100%}.item-name .name-edit>span,.mapped-edit>span{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mapped-edit+button.edit{flex:none}
@media(max-width:640px){.preparation-view .item-top{gap:6px}.preparation-view .item-name{flex:1;min-width:0}.preparation-view .mapped-edit{flex:1;min-width:44px;max-width:none;font-size:14px;height:44px;padding:2px 4px}.preparation-view .name-edit{width:100%;height:44px;line-height:20px}.preparation-view .item-top .edit{width:44px;min-width:44px;justify-content:center;padding:6px}.preparation-view .edit-caption{display:none}.preparation-view .item-top .field-caption{display:block!important}.preparation-view .row-number{font-size:10px}}

/* Source/mapping summary belongs beside the customer name, not at card right. */
.item-top .item-name{display:flex;align-items:center;gap:14px}.item-name h3{min-width:0;margin-bottom:0}.item-name .mapped-edit{max-width:260px;flex:none}.mapped-edit .source-caption{font-size:10px;line-height:14px;color:var(--muted)}.mapped-edit .match-summary{font-size:13px;line-height:20px}.item-top>.edit{margin-left:auto}
@media(max-width:640px){.preparation-view .item-name{gap:6px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.preparation-view .item-name:not(:has(.mapped-edit)){grid-template-columns:minmax(0,1fr)}.preparation-view .item-name .mapped-edit{width:100%;max-width:100%;padding:2px 4px}.preparation-view .mapped-edit .match-summary{font-size:12px}.preparation-view .mapped-edit .source-caption{display:block!important;font-size:10px}.preparation-view .item-name h3{width:100%}}

/* Recognition decisions occupy space only on orders that need them. */
.recognition-notice{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;margin-bottom:14px;border:1px solid #dac499;border-radius:14px;background:#fff8e8;color:#574722}.recognition-notice small{display:block;line-height:1.5;margin-top:4px}.recognition-notice button{flex-shrink:0;min-height:44px}.recognition-notice.resolved{background:#eff4e7;border-color:#d2ddc5;color:#244339}.recognition-card{border:1px solid #dddccb;border-radius:14px;padding:16px;margin:14px 0;background:#fff}.recognition-card p,.recognition-intro,.recognition-demo p{line-height:1.65;margin:10px 0}.recognition-card blockquote,#resolution-form blockquote{white-space:pre-wrap;margin:14px 0;padding:12px;background:#f6f5ef;border-left:3px solid #bda873;overflow-wrap:anywhere}.recognition-card details{margin:12px 0;font-size:13px;color:#536761}.candidate-list{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0}.candidate-list span{border:1px solid #b9c9b2;border-radius:8px;padding:7px 10px}.candidate-list small{width:100%}.recognition-demo{margin-bottom:18px}.scenario-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:10px}.scenario-grid button{min-height:48px}.resolution-check{display:flex;gap:10px;align-items:center;min-height:48px;line-height:1.5}.resolution-check input{width:22px;height:22px;flex-shrink:0}#resolution-form p{line-height:1.6;margin:12px 0}@media(max-width:600px){.recognition-notice{padding:10px;font-size:13px;gap:8px}.recognition-notice small{font-size:12px}.recognition-card{padding:12px}.candidate-list{font-size:14px}}

.help-link{display:flex;align-items:center;min-height:48px;padding:12px 14px;border:1px solid #cad7c0;border-radius:12px;color:#194c3e;text-decoration:none;background:#f3f7ed}.help-link:focus-visible{outline:3px solid #537b55}.help-topics{margin:22px 0}.help-topics details{border-bottom:1px solid #e1e2d8}.help-topics summary{min-height:48px;padding:12px 0;cursor:pointer;font-weight:600}.help-topics p{line-height:1.8;margin:0 0 16px}
