/* 文字录单与手动录单共用同一窗口，描述始终在订单上方。 */
.text-order-inline{margin:0 0 16px;padding:0 0 14px;border-bottom:1px solid var(--line-strong);min-width:0}
.text-order-intro{margin:0 0 9px}
.text-order-intro h3{font-size:var(--text-body);font-weight:500;line-height:1.5;margin:0 0 4px}
.text-order-intro p{font-size:var(--text-help);color:var(--muted);line-height:1.65;margin:0;max-width:70ch}
.text-order-inline>.field{margin:0}
#voice-text{min-height:96px;max-height:260px;resize:vertical;font-size:var(--text-body);line-height:1.65;caret-color:var(--text)}
#voice-text:focus-visible{outline:2px solid var(--text);outline-offset:2px}
#voice-text::selection,.text-order-request-source p::selection{color:var(--text);background:var(--yellow)}
.text-order-examples{margin:7px 0 8px;font-size:var(--text-help);color:var(--muted)}
.text-order-examples summary,.text-order-request-source summary{cursor:pointer;font-weight:500;min-height:30px;display:list-item;line-height:30px}
.text-order-examples p{line-height:1.65;margin:4px 0;max-width:70ch}
.text-order-feedback{min-width:0}
.text-order-status{font-size:var(--text-help);line-height:1.65;min-height:22px}
.text-order-status>.hint{margin:4px 0 0;max-width:70ch}
.text-order-ai-status{color:var(--muted);margin:0;overflow-wrap:anywhere;max-width:70ch}
.text-order-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin:8px 0 0}
.text-order-actions>.text:first-child{margin-right:auto}
.text-order-actions>.btn{white-space:normal}
.text-order-actions>.btn:disabled{cursor:default}
.text-order-progress{display:flex;align-items:baseline;gap:12px;margin:0;color:var(--text)}
.text-order-progress>b{font-weight:500}
.text-order-progress>span{color:var(--muted);font-family:var(--font-number);font-variant-numeric:tabular-nums}
.text-order-ai-error{font-size:var(--text-secondary);line-height:1.65;color:var(--bad);padding:10px 12px;background:var(--bad-soft);border-radius:8px;margin:4px 0 0;overflow-wrap:anywhere}
.text-order-ai-error b{font-weight:500}
.text-order-ai-error p{margin:4px 0 0;max-width:70ch}
.text-order-ai-error p:last-child{color:var(--text)}
.text-order-pending{margin:10px 0 0;padding:10px 12px;background:var(--yellow-soft);border-radius:8px;font-size:var(--text-secondary);line-height:1.65;color:var(--text)}
.text-order-pending>p{margin:0 0 6px;max-width:70ch;overflow-wrap:anywhere}
.text-order-candidate-facts{font-size:var(--text-help)}
.text-order-candidate-items{list-style:none;margin:0 0 9px;padding:0;max-height:170px;overflow:auto;overscroll-behavior:contain}
.text-order-candidate-items li{display:flex;align-items:baseline;justify-content:space-between;gap:14px;padding:5px 0;border-bottom:1px solid var(--line)}
.text-order-candidate-items li>span{min-width:0;overflow-wrap:anywhere}
.text-order-candidate-items li>b{font-family:var(--font-number);font-variant-numeric:tabular-nums;font-weight:500;flex:none;white-space:nowrap}
.text-order-request-source{font-size:var(--text-help);margin:7px 0 0}
.text-order-request-source p{white-space:pre-wrap;overflow-wrap:anywhere;max-width:70ch;line-height:1.65;margin:4px 0}
.text-order-issues{margin:10px 0 0}
.text-order-issues h3{font-size:var(--text-secondary);font-weight:500;margin:0 0 5px}
.text-order-issues ul{margin:0;padding-left:18px;font-size:var(--text-help);line-height:1.65}
.text-order-issues li{margin:0 0 5px;max-width:70ch}
.text-order-issues small{display:block;font-size:var(--text-help);color:var(--muted);overflow-wrap:anywhere}
.text-order-inline summary:focus-visible,.text-order-inline .btn:focus-visible{outline:2px solid var(--text);outline-offset:2px}
.text-order-fact{min-width:0;align-self:start}
.text-order-fact>.field{margin:0}
[data-text-review-field]:empty,.text-order-line-review:empty,[data-text-review-unmatched]:empty{display:none}
.text-order-field-review{font-size:var(--text-help);line-height:1.5;margin-top:5px;overflow-wrap:anywhere;color:var(--text)}
.text-order-field-review>span{display:block;color:var(--warning,var(--text))}
.text-order-field-review>small{display:block;color:var(--muted);font-size:var(--text-help);margin-top:2px}
.text-order-inline-candidates{display:flex;gap:5px;flex-wrap:wrap;margin-top:5px}
.text-order-inline-candidates>.btn{font-size:var(--text-help);min-height:30px;padding:4px 7px;white-space:normal;line-height:1.5}
.text-order-inline-candidates>.btn:focus-visible{outline:2px solid var(--text);outline-offset:2px}
.text-order-review-ack{font-size:var(--text-help);min-height:30px;padding:4px 0;white-space:normal;text-align:left;justify-content:flex-start}
.text-order-manual-sku{margin:6px 0 0;font-size:var(--text-help);min-width:0}
.text-order-manual-sku select{width:100%;min-width:0;font-size:var(--text-secondary)}
.text-order-line-review{grid-column:1/-1;grid-row:auto;min-width:0}
.text-order-unmatched{padding:8px 0 10px;border-bottom:1px solid var(--line);margin-bottom:8px;min-width:0}
.text-order-unmatched>h3{font-size:var(--text-secondary);font-weight:500;margin:0 0 5px}
.text-order-unmatched .text-order-field-review+.text-order-field-review{border-top:1px solid var(--line);padding-top:7px;margin-top:7px}
.text-order-line-match{display:block;font-size:var(--text-help);line-height:1.5;color:var(--muted);overflow-wrap:anywhere;margin-top:3px}
.text-order-review-count{font-size:var(--text-help);line-height:1.5;color:var(--muted);margin:6px 0 0}
.text-order-match-trace{font-size:var(--text-help);margin:5px 0 0;color:var(--muted)}
.text-order-match-trace summary{cursor:pointer;min-height:24px;line-height:24px}
.text-order-match-trace ul{list-style:none;padding:0;margin:4px 0;max-height:180px;overflow:auto;overscroll-behavior:contain}
.text-order-match-trace li{padding:4px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}
.text-order-match-trace li>small{display:block;font-size:var(--text-help);color:var(--muted)}
@media(min-width:961px){
 .text-order-inline{display:grid;grid-template-columns:minmax(0,1fr) 360px;grid-template-areas:"intro feedback" "input feedback" "examples feedback";gap:4px 18px;flex:none;margin:0;padding:0 0 10px;max-height:148px;overflow-y:auto}
 .text-order-intro{grid-area:intro;margin:0}
 .text-order-intro h3{margin:0 0 2px}
 .text-order-intro p{display:none}
 .text-order-inline>.field{grid-area:input;font-size:var(--text-help);gap:3px}
 #voice-text{height:56px;min-height:56px;max-height:80px;font-size:var(--text-secondary);line-height:1.5;resize:vertical}
 .text-order-inline .text-order-examples{grid-area:examples;margin:0;padding:0}
 .text-order-inline .text-order-examples summary{min-height:24px;line-height:24px;padding:0}
 .text-order-feedback{grid-area:feedback;max-height:124px;overflow-y:auto;overscroll-behavior:contain;padding:4px 0}
 .text-order-actions{gap:6px;margin-top:6px;justify-content:flex-start}
 .text-order-actions>.btn{font-size:var(--text-help);min-height:34px;padding:6px 8px}
 .text-order-actions>.text:first-child{flex-basis:100%;justify-content:flex-start;min-height:24px;padding:2px 0}
 .text-order-status{min-height:20px}
 .text-order-progress{gap:6px;flex-wrap:wrap}
}
@media(max-width:700px){
 .text-order-inline{margin-bottom:14px;padding-bottom:12px}
 #voice-text{font-size:16px;min-height:112px;max-height:280px}
 .text-order-examples summary,.text-order-request-source summary{min-height:44px;line-height:1.5;padding:11px 0}
 .text-order-actions{gap:7px}
 .text-order-actions>.btn{min-height:44px;flex:1 1 auto}
 .text-order-actions>.text:first-child{flex-basis:100%;margin-right:0;justify-content:flex-start}
 .text-order-progress{flex-wrap:wrap;gap:3px 10px}
 .text-order-pending{padding:10px}
 .text-order-pending>.btn{min-height:44px;width:100%}
 .text-order-inline-candidates>.btn{min-height:44px;padding:8px 10px;font-size:14px}
 .text-order-review-ack{min-height:44px;padding:8px 0;font-size:14px}
 .text-order-manual-sku select{font-size:16px;min-height:44px}
 .text-order-match-trace summary{min-height:44px;line-height:1.5;padding:11px 0}
}

/* Two deliberate work moments: the first compares the spoken description
   with compact facts; the second opens the full editable order. */
.text-order-first-step{width:100%;min-width:0}
.text-order-step-guide{display:flex;align-items:center;gap:24px;padding:0 0 15px;margin-bottom:16px;border-bottom:1px solid var(--line);font-size:var(--text-secondary);line-height:1.5}
.text-order-step-guide>b{font-weight:500;color:var(--text)}
.text-order-step-guide>span{color:var(--muted)}
.text-order-first-grid{display:grid;grid-template-columns:minmax(260px,.78fr) minmax(0,1.35fr);gap:24px;align-items:start}
.text-order-first-step .text-order-inline{display:block;max-height:none;overflow:visible;margin:0;padding:0;border:0}
.text-order-first-step .text-order-intro{margin-bottom:12px}
.text-order-first-step .text-order-intro h3{font-size:var(--text-body);font-weight:500}
.text-order-first-step .text-order-intro p{display:block;max-width:none;margin-top:4px}
.text-order-first-step #voice-text{height:220px;min-height:160px;max-height:360px;line-height:1.65;font-size:var(--text-secondary);resize:vertical}
.text-order-first-step .text-order-feedback{max-height:none;overflow:visible;padding:0}
.text-order-first-step .text-order-actions{gap:8px;margin:12px 0;justify-content:flex-start}
.text-order-first-step .text-order-actions>.text:first-child{flex-basis:auto;min-height:32px;padding:6px 0;margin-right:auto}
.text-order-first-step .text-order-actions>.btn{min-height:36px;padding:7px 10px;font-size:var(--text-secondary)}
.text-order-recognition{min-width:0;border-left:1px solid var(--line);padding-left:24px}
.text-order-recognition-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:14px}
.text-order-recognition-head>h3{font-size:var(--text-body);font-weight:500;margin:0}
.text-order-recognition-head>span,.text-order-recognition-sales-head>span{font-size:var(--text-help);color:var(--muted)}
.text-order-recognition-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 10px}
.text-order-recognition-facts .field{font-size:var(--text-help);gap:5px}
.text-order-recognition input,.text-order-recognition select{width:100%;min-width:0;min-height:36px;font-size:var(--text-secondary)}
.text-order-recognition-sales{margin-top:17px}
.text-order-recognition-sales-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:7px;font-size:var(--text-secondary)}
.text-order-recognition-sales-head>b{font-weight:500}
.text-order-recognition-line{display:grid;grid-template-columns:minmax(0,1fr) 58px 102px 38px;gap:7px;align-items:start;padding:9px 0;border-top:1px solid var(--line)}
.text-order-recognition-line>label{display:grid;gap:4px;font-size:var(--text-help);color:var(--muted)}
.text-order-recognition-project{min-width:0;display:grid;gap:4px}
.text-order-recognition-project>small{font-size:var(--text-help);color:var(--muted)}
.text-order-recognition-line>.btn{padding:7px 0;min-width:0;min-height:36px;font-size:var(--text-help);margin-top:20px}
.text-order-recognition-line input{font-family:var(--font-number);font-variant-numeric:tabular-nums}
.text-order-recognition-add{display:grid;gap:5px;margin-top:10px;font-size:var(--text-help);color:var(--muted)}
.text-order-recognition-empty{font-size:var(--text-secondary);line-height:1.8;color:var(--muted);padding:24px 0;max-width:42ch}
.text-order-generated-header{display:flex;align-items:center;gap:8px 16px;flex-wrap:wrap;flex:none;padding-bottom:8px;margin:0;border-bottom:1px solid var(--line)}
.text-order-generated-header>div{margin-right:auto;min-width:0}
.text-order-generated-header h3{font-size:var(--text-body);font-weight:500;margin:0 0 2px}
.text-order-generated-header p{font-size:var(--text-help);color:var(--muted);margin:0;line-height:1.6}
.text-order-generated-header>.btn{order:3;flex:none}
.text-order-generated-header>details{order:2;flex:0 0 auto;margin:0}
.text-order-generated-header>details summary{min-height:36px;line-height:36px;white-space:nowrap}
.text-order-generated-header>details[open]{order:4;flex-basis:100%}
@media(max-width:900px){
 .text-order-first-grid{grid-template-columns:1fr;gap:18px}
 .text-order-recognition{border-left:0;border-top:1px solid var(--line);padding:18px 0 0}
 .text-order-first-step #voice-text{height:150px;min-height:128px;font-size:16px}
}
@media(max-width:560px){
 .text-order-step-guide{gap:12px;justify-content:space-between;font-size:13px;padding-bottom:12px;margin-bottom:12px}
 .text-order-recognition-facts{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 10px}
 .text-order-recognition input,.text-order-recognition select{font-size:16px;min-height:44px}
 .text-order-recognition-line{grid-template-columns:minmax(0,1fr) 58px 38px}
 .text-order-recognition-project{grid-column:1/-1}
 .text-order-recognition-line>label:nth-of-type(1){grid-column:2;grid-row:2}
 .text-order-recognition-line>label:nth-of-type(2){grid-column:1;grid-row:2}
 .text-order-recognition-line>.btn{grid-column:3;grid-row:2;min-height:44px;margin-top:20px}
 .text-order-first-step .text-order-actions>.btn{min-height:44px}
 .text-order-generated-header>.btn{min-height:44px}
 .text-order-generated-header>details summary{min-height:44px;line-height:1.5;padding:11px 0}
}
