/* Desktop order entry: select customer and goods, then fill familiar fields. */
#order-editor .entry-selection-deck{display:grid;grid-template-columns:minmax(310px,.85fr) minmax(450px,1.65fr);gap:0;background:#fcfdff;border-bottom:1px solid var(--line)}
#order-editor .entry-customer-choice,#order-editor .entry-goods-choice{padding:17px 20px;min-width:0}
#order-editor .entry-customer-choice{border-right:1px solid var(--line)}
#order-editor .selection-caption{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:32px;margin-bottom:10px;font-size:12px}
#order-editor .selection-caption>span{font-size:11px;color:#8a9bb1}
#order-editor .selection-caption em{font-size:11px;font-style:normal;font-weight:400;color:#8a9bb1;margin-left:6px}
#order-editor .compact-customer{gap:10px;flex-wrap:wrap;padding:0;margin:0}
#order-editor .compact-customer-name{flex:1;min-width:170px}
#order-editor .compact-customer-name strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
#order-editor .compact-customer-name small{display:block;white-space:normal;line-height:1.6;margin-top:3px}
#order-editor .compact-customer .actions{margin:4px 0 0 42px;flex-basis:100%;justify-content:flex-start}
#order-editor .selected-goods{display:flex;flex-wrap:wrap;gap:8px}
#order-editor .selected-good{display:flex;align-items:center;gap:9px;min-width:235px;max-width:100%;flex:1;padding:10px 12px;text-align:left;background:#fff;border:1px solid #dfe7f0;border-radius:6px;color:#465f7d;transition:background-color 130ms,border-color 130ms}
#order-editor .selected-good:hover{background:#f3f7fc;border-color:#b9cde2}
#order-editor .selected-good>span{font-size:10px;color:#9aaac0}
#order-editor .selected-good div{flex:1;min-width:0}
#order-editor .selected-good b{display:block;font-size:12px;font-weight:500}
#order-editor .selected-good small{display:block;font-size:11px;color:#8395ad;margin-top:4px}
#order-editor .selected-good i{font-size:10px;font-style:normal;color:#7390b0;white-space:nowrap}
#order-editor .selection-empty{font-size:12px;color:#92a1b5;padding:8px 0;line-height:1.7;margin:0}
#order-editor .entry-order-basics{padding:15px 20px 17px}
#order-editor .entry-order-basics .sheet-section-bar{padding:0 0 12px}
#order-editor .entry-order-basics .basic-grid{margin:0}
#order-editor .entry-flat-line{padding:15px 20px;border-top:1px solid var(--line)}
#order-editor .entry-line-caption{display:flex;align-items:center;gap:10px;margin-bottom:13px;flex-wrap:wrap;font-size:12px}
#order-editor .entry-line-caption>b{font-weight:600;color:#3b516e}
#order-editor .entry-line-caption>span:not(.line-index){font-size:11px;color:#8295ad}
#order-editor .entry-line-caption .text-btn:first-of-type{margin-left:auto}
#order-editor .entry-line-caption .text-btn:last-child[data-action=remove-line]{color:#9aa6b5}
#order-editor .entry-flat-grid{display:grid;grid-template-columns:minmax(100px,.8fr) repeat(2,minmax(115px,1fr)) minmax(110px,.9fr) minmax(95px,.7fr) minmax(170px,1.25fr);gap:14px 16px;border:0;padding:0;margin:0;min-width:0}
#order-editor .entry-flat-grid .field{min-width:0;margin:0}
#order-editor .entry-flat-grid input:not([type=checkbox]),#order-editor .entry-flat-grid select{width:100%;height:36px;min-width:0;font-size:12px}
#order-editor .entry-craft-field{grid-column:span 2}
#order-editor .entry-craft-options{display:flex;align-items:center;gap:7px 12px;flex-wrap:wrap;min-height:36px;padding:4px 0}
#order-editor .entry-craft-options label{display:flex;align-items:center;gap:5px;font-size:12px;color:#546c87;white-space:nowrap}
#order-editor .entry-craft-options input{margin:0}
#order-editor .entry-inherited{font-size:10px;color:#8095ad;margin:11px 0 0;line-height:1.6}
#order-editor .entry-inherited span{margin-left:16px;color:#a2afbe}
#order-editor .entry-waiting{padding:20px;font-size:12px;color:#8c9db2;background:#fcfdff;border-top:1px solid var(--line)}
#order-editor .entry-waiting>span{color:#607a96;margin-right:14px}
@media(min-width:1600px){#order-editor .entry-customer-choice .compact-customer .actions{flex-basis:auto;margin:0}}
@media(prefers-reduced-motion:reduce){#order-editor .selected-good{transition:none}}

#order-editor .compact-customer-name{display:block}
#order-editor .compact-customer-name strong{white-space:normal;line-height:1.6;overflow:visible}
#order-editor .entry-inherited>b{font-weight:400}

/* Imported order is the action; dates and identifiers are secondary metadata. */
#order-editor .entry-order-binding{padding:15px 20px 13px}
#order-editor .binding-main{display:flex;align-items:center;gap:17px;min-height:38px}
#order-editor .binding-caption{font-size:12px;font-weight:600;flex-shrink:0}
#order-editor .binding-value{display:flex;align-items:baseline;gap:10px;flex:1;min-width:0;flex-wrap:wrap}
#order-editor .binding-value strong{font-size:13px;font-weight:500;color:#3b5777;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#order-editor .binding-value strong.binding-placeholder{color:#70869e;font-size:12px;font-weight:400}
#order-editor .binding-value>span{color:#8b9bb0;font-size:10px}
#order-editor .binding-value small{font-size:9px;color:#b18a63;background:#fff6e9;padding:2px 5px;border-radius:3px}
#order-editor .binding-main>.btn{font-size:12px;padding:6px 13px;min-height:32px;border-color:#cbd9e9;color:#456b95;background:#f8fbff}
#order-editor .binding-main>.btn:hover{border-color:#94b1d1;background:#eff5fc}
#order-editor .binding-meta{display:flex;gap:25px;flex-wrap:wrap;margin-top:7px;padding-left:65px;color:#9ba8b8;font-size:10px}
#order-editor .binding-meta b{font-weight:400;color:#8494a8;margin-left:5px;font-variant-numeric:tabular-nums}
#order-editor .sheet-commerce{grid-template-columns:220px 1fr}
.source-order-option{display:flex;align-items:center;gap:14px;padding:18px 0;border-bottom:1px solid var(--line)}
.source-order-option>div{flex:1;min-width:0}
.source-order-option strong{font-size:13px;font-weight:500}
.source-order-option p{font-size:12px;color:#6b819a;margin:6px 0}
.source-order-option small{display:block;font-size:10px;color:#95a3b4;line-height:1.8;overflow-wrap:anywhere}
.source-order-option .btn{font-size:11px;padding:6px 10px;white-space:nowrap}

/* Direct entry with a clear primary row and a quieter auxiliary row. */
#order-editor .sheet-items>.sheet-section-bar{padding:14px 20px 10px}
#order-editor .line-defaults{padding:0 20px 13px}
#order-editor .entry-flat-lines{padding:0 14px 13px;background:#f7f9fc;display:grid;gap:10px;border-top:1px solid var(--line)}
#order-editor .entry-flat-line{padding:0;border:1px solid #dfe7f0;border-radius:7px;background:#fff;min-width:0;overflow:hidden;margin-top:0;transition:border-color 150ms,box-shadow 150ms}
#order-editor .entry-flat-line:first-child{margin-top:12px}
#order-editor .entry-flat-line:focus-within{border-color:#aec3d9;box-shadow:0 0 0 2px #b9cde318}
#order-editor .entry-line-caption{padding:9px 14px;margin:0;gap:9px;border-bottom:1px solid #edf1f6;background:#fcfdff;min-height:38px}
#order-editor .entry-line-caption .line-index{display:inline-grid;place-items:center;width:23px;height:23px;background:#edf2f8;color:#7a91aa;border-radius:5px;font-size:10px;font-variant-numeric:tabular-nums}
#order-editor .entry-line-caption>b{font-size:12px}
#order-editor .entry-line-caption .text-btn{font-size:10px}
#order-editor .entry-flat-grid{display:block;padding:12px 14px 0}
#order-editor .entry-primary-row{display:grid;grid-template-columns:90px minmax(245px,2fr) minmax(100px,1fr) 80px minmax(145px,1.3fr) 94px;gap:12px;align-items:start}
#order-editor .entry-primary-row .entry-craft-field{grid-column:auto}
#order-editor .entry-primary-row .field>span{font-size:10px;color:#75889f}
#order-editor .entry-primary-row input:not([type=checkbox]),#order-editor .entry-primary-row select{height:34px;min-height:34px;border-color:#dfe6ef;font-size:12px}
#order-editor .entry-primary-row>.field:first-child input{font-weight:600;font-variant-numeric:tabular-nums;background:#fffdf8}
#order-editor .entry-craft-options{display:flex;gap:5px;flex-wrap:wrap;min-height:34px;padding:0;align-items:center}
#order-editor .entry-craft-options label{display:flex;gap:4px;align-items:center;padding:7px 6px;border:1px solid #e1e7ef;border-radius:5px;background:#fff;color:#74879e;font-size:10px;line-height:18px;cursor:pointer;transition:background-color 140ms,border-color 140ms,color 140ms}
#order-editor .entry-craft-options label:has(input:checked){border-color:#e6bf9d;background:#fff6ed;color:#a06535}
#order-editor .entry-craft-options label:has(input:focus-visible){outline:2px solid #b8cde2;outline-offset:2px}
#order-editor .entry-craft-options input{width:12px;height:12px;min-height:0;padding:0;accent-color:#d88a50}
#order-editor .entry-craft-options label:has(input:disabled){cursor:default}
#order-editor .entry-secondary-row{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:11px;padding-top:10px;border-top:1px dashed #e8edf3}
#order-editor .entry-secondary-row .field{display:flex;align-items:center;gap:7px}
#order-editor .entry-secondary-row .field>span{white-space:nowrap;font-size:10px;color:#8798ac}
#order-editor .entry-secondary-row input,#order-editor .entry-secondary-row select{width:106px;height:29px;min-height:29px;background:#fbfcfe;font-size:11px;padding:4px 6px;border-color:#e5ebf2}
#order-editor .entry-secondary-row .field:nth-child(1) select,#order-editor .entry-secondary-row .field:nth-child(2) select{width:76px}
#order-editor .entry-secondary-row input[type=date]{width:132px}
#order-editor .entry-secondary-row .field:last-child{flex:1;min-width:185px}
#order-editor .entry-secondary-row .field:last-child input{flex:1;width:0}
#order-editor .entry-inherited{margin:8px 14px 10px;color:#8c9fb4;font-size:9px}
#order-editor .entry-inherited span{color:#a0aebe;margin-left:12px}
#order-editor .entry-flat-grid input:focus,#order-editor .entry-flat-grid select:focus{background:#fff;border-color:#9eb8d4;box-shadow:0 0 0 2px #abc4e123}
@media(min-width:1500px){#order-editor .entry-primary-row{grid-template-columns:110px minmax(290px,1.7fr) minmax(130px,1fr) 100px minmax(190px,1.2fr) 115px;gap:16px}#order-editor .entry-craft-options{gap:7px}#order-editor .entry-craft-options label{font-size:11px;padding:7px 8px}}
@media(prefers-reduced-motion:reduce){#order-editor .entry-flat-line,#order-editor .entry-craft-options label{transition:none}}

/* Choose goods where their customization lines appear. */
#order-editor .entry-selection-deck.customer-only{display:block}
#order-editor .customer-only .entry-customer-choice{border-right:0;padding:12px 20px}
#order-editor .customer-only .selection-caption{min-height:0;margin-bottom:8px}
#order-editor .customer-only .compact-customer .actions{flex-basis:auto;margin:0;justify-content:flex-end}
#order-editor .entry-product-prompt{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px 24px;background:#f8fafd}
#order-editor .entry-product-prompt strong{font-size:12px;font-weight:500;color:#586f89}
#order-editor .entry-product-prompt p{font-size:11px;color:#94a3b7;margin-top:4px}
#order-editor .entry-product-prompt .btn{min-height:33px;font-size:12px}
