/* Layout only; visual materials and controls come from MARPS. */
.support-dispatch-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.support-dispatch-toolbar[hidden],.support-dispatch-toolbar [hidden]{display:none!important}
.support-queue-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.support-dispatch-toolbar [role=status]{flex:1;min-width:min(240px,100%);font-size:13px;color:var(--ds-ink-secondary);overflow-wrap:anywhere}
.support-queue-settings .support-queue-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(170px,100%),1fr));gap:12px}
.support-queue-settings .support-queue-fields label,.support-queue-settings-body>label:not(.support-queue-check){display:grid;gap:6px}
dialog.support-queue-settings{overflow:hidden}
dialog.support-queue-settings[open]{display:flex;max-height:calc(100dvh - 32px)}
.support-queue-settings .marps-dialog-form{display:flex;flex-direction:column;min-height:0;width:100%;max-height:calc(100dvh - 34px)}
.support-queue-settings .support-dialog-head{flex-shrink:0}
.support-queue-settings .support-dialog-head button{flex-shrink:0}
.support-queue-settings-body{overflow:auto;min-height:0;overscroll-behavior:contain;padding:4px}
.support-queue-settings .marps-dialog-actions{flex-shrink:0;margin-top:12px}
.support-queue-settings fieldset{min-width:0;margin:16px 0;padding:0 0 16px;border:0;border-bottom:1px solid var(--ds-line)}
.support-queue-settings legend{font-weight:600;margin-bottom:8px}
.support-queue-settings .support-queue-row{margin-top:10px}
.support-queue-settings .support-queue-check{display:flex;align-items:center;gap:10px;padding:10px 0;overflow-wrap:anywhere}
.support-queue-settings .support-queue-check span{min-width:0}
.support-queue-settings input[type=checkbox]{width:18px;height:18px;flex:0 0 18px;accent-color:var(--ds-accent)}
.support-queue-settings .support-queue-members{max-height:200px;overflow:auto}
.support-queue-settings [role=status]{overflow-wrap:anywhere}
.support-queue-settings [hidden]{display:none!important}
.support-queue-search{display:grid;gap:6px}
.support-queue-settings h3{font-size:14px;margin:12px 0 4px}
.support-operator-row{display:grid;gap:4px;padding:14px 0;border-bottom:1px solid var(--ds-line);overflow-wrap:anywhere}
.support-operator-row :is(span,small){font-size:13px;color:var(--ds-ink-secondary)}
#edSupportOwnership:empty,[data-ownership]:empty{display:none}
.support-work-tools{display:contents}
/* Factory editors: service actions above, reply/navigation actions below.
   Contents wrappers have no interactive semantics; focus follows reading order. */
:is(#edOverlay,#qEditorOverlay) .ed-foot:has(.support-work){display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;align-items:center;gap:12px 8px}
:is(#edOverlay,#qEditorOverlay) .ed-foot :is(#edSupportOwnership,[data-ownership],.support-work){display:contents}
:is(#edOverlay,#qEditorOverlay) .ed-foot .support-owner{grid-column:1;grid-row:1;min-width:0;overflow-wrap:anywhere;font:400 13px/1.5 var(--ds-font);color:var(--ds-ink-secondary)}
:is(#edOverlay,#qEditorOverlay) .ed-foot .support-work-tools{grid-column:2/-1;grid-row:1;display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px}
:is(#edOverlay,#qEditorOverlay) .ed-foot .support-work .btn{min-height:40px;padding:8px 12px;font:500 13px/1.4 var(--ds-font);white-space:normal}
:is(#edOverlay,#qEditorOverlay) .ed-foot [data-support-queue-next]{grid-column:2;grid-row:2}
:is(#edOverlay,#qEditorOverlay) .ed-foot:has(.support-work) .ed-save-status{grid-column:1;grid-row:2;margin:0}
:is(#edOverlay,#qEditorOverlay) .ed-foot:has(.support-work)>.ed-btn.secondary{grid-column:3;grid-row:2}
:is(#edOverlay,#qEditorOverlay) .ed-foot:has(.support-work)>:is(.ed-btn.primary,.q-send-actions){grid-column:4;grid-row:2}
@media(max-width:1100px){
 :is(#edOverlay,#qEditorOverlay) .ed-foot:has(.support-work){grid-template-columns:minmax(0,1fr) auto auto}
 :is(#edOverlay,#qEditorOverlay) .ed-foot .support-owner{grid-column:1/-1}
 :is(#edOverlay,#qEditorOverlay) .ed-foot .support-work-tools{grid-row:2;grid-column:1/-1;justify-content:flex-start}
 :is(#edOverlay,#qEditorOverlay) .ed-foot:has(.support-work) .ed-save-status{grid-row:3;grid-column:1/-1}
 :is(#edOverlay,#qEditorOverlay) .ed-foot [data-support-queue-next]{grid-row:4;grid-column:1}
 :is(#edOverlay,#qEditorOverlay) .ed-foot:has(.support-work)>.ed-btn.secondary{grid-row:4;grid-column:2}
 :is(#edOverlay,#qEditorOverlay) .ed-foot:has(.support-work)>:is(.ed-btn.primary,.q-send-actions){grid-row:4;grid-column:3}
}
@media(max-width:900px){
 :is(#edOverlay,#qEditorOverlay) .ed-foot:has(.support-work){grid-template-columns:repeat(2,minmax(0,1fr))}
 :is(#edOverlay,#qEditorOverlay) .ed-foot:has(.support-work) .ed-save-status{grid-row:3;grid-column:1/-1}
 :is(#edOverlay,#qEditorOverlay) .ed-foot [data-support-queue-next]{grid-row:4;grid-column:1/-1;justify-self:start}
 :is(#edOverlay,#qEditorOverlay) .ed-foot:has(.support-work)>.ed-btn.secondary{grid-row:5;grid-column:1}
 :is(#edOverlay,#qEditorOverlay) .ed-foot:has(.support-work)>:is(.ed-btn.primary,.q-send-actions){grid-row:5;grid-column:2}
 #qEditorOverlay .ed-foot:has(.support-work) .q-send-actions>.ed-btn{flex:1;min-width:0}
}
@media(max-width:600px){:is(#edOverlay,#qEditorOverlay) .ed-foot .support-work .btn{min-height:44px}}
@media(max-width:600px){.support-dispatch-toolbar .btn,.support-queue-settings .btn{min-height:44px}.support-dispatch-toolbar [role=status]{flex-basis:100%}}
/* Dedicated comparison layout, shared native dialog behavior/materials intact. */
dialog.support-reply-batch-dialog{width:min(1120px,calc(100vw - 48px));max-width:none;overflow:hidden}
.support-reply-batch-dialog .marps-dialog-form{display:flex;flex-direction:column;max-height:calc(100dvh - 34px);min-height:0;box-sizing:border-box}
.support-reply-batch-dialog .support-dialog-head{flex-shrink:0;margin-bottom:12px}
.support-reply-batch-dialog .marps-dialog-message{flex-shrink:0;margin-bottom:20px}
.support-reply-batch-dialog .marps-dialog-actions{flex-shrink:0;margin-top:0}
@media(max-width:480px){
 .support-reply-batch-dialog .marps-dialog-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .support-reply-batch-dialog .marps-dialog-actions button{min-width:0;padding:10px 12px}
 .support-reply-batch-dialog .marps-dialog-actions :is([data-dialog-action="stop"],.marps-dialog-cancel,.marps-dialog-submit){grid-column:1/-1}
 .support-reply-batch-dialog .marps-dialog-actions [data-dialog-action="next"]:first-child{grid-column:1/-1}
}
.support-reply-batch-list{list-style:none;margin:0;padding:0 4px 0 0;overflow:auto;min-height:0;overscroll-behavior:contain;scrollbar-gutter:stable}
.support-reply-batch-list:focus-visible{outline:2px solid var(--ds-accent);outline-offset:-2px}
.support-reply-batch-list>li{padding:20px 0;border-top:1px solid var(--ds-line)}
.support-reply-batch-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:16px;overflow-wrap:anywhere}
.support-reply-batch-head h3{margin:0;font:600 14px/1.5 var(--ds-font)}
.support-reply-batch-state{font:500 13px/1.5 var(--ds-font);color:var(--ds-ink-secondary)}
.support-reply-batch-reason{margin:0 0 16px;font:500 13px/1.5 var(--ds-font);color:var(--ds-ink)}
.support-reply-comparison{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
.support-reply-comparison section{min-width:0}
.support-reply-comparison h4{margin:0 0 8px;font:500 12px/1.5 var(--ds-font);color:var(--ds-ink-secondary)}
.support-reply-comparison p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font:400 14px/1.65 var(--ds-font);color:var(--ds-ink)}
@media(max-width:820px){
 dialog.support-reply-batch-dialog{width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}
 .support-reply-batch-dialog .marps-dialog-form{max-height:calc(100dvh - 26px)}
 .support-reply-comparison{grid-template-columns:minmax(0,1fr);gap:16px}
 .support-reply-batch-head{align-items:flex-start;flex-direction:column;gap:4px}
}
/* Factory templates reuse the incumbent MARPS picker; geometry only. */
.support-template-picker { width:min(1200px,calc(100vw - 48px)); height:min(760px,calc(100dvh - 48px)); box-sizing:border-box; max-height:calc(100dvh - 48px); overflow:hidden; }
.support-template-picker[open] { display:flex; flex-direction:column; }
.support-template-picker :is(.rtp-head,.support-template-groups,.support-template-search,.rtp-status,.rtp-error,.rtp-foot) { flex-shrink:0; }
.support-template-picker .rtp-head { margin-bottom:16px; }
.support-template-picker .rtp-body { height:min(440px,48dvh); flex:1 1 auto; min-height:0; grid-template-columns:190px minmax(230px,.85fr) minmax(0,1.4fr); }
.support-template-search { display:grid; grid-template-columns:1fr; gap:12px; margin-bottom:8px; }
.support-template-search .rtp-search { margin:0; min-width:0; }
.support-template-search .filter-select { width:100%; min-width:0; min-height:44px; padding-inline:16px; }
.support-template-catalog { display:flex; flex-direction:column; min-height:0; }
.support-template-groups { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.support-template-groups .btn { flex:1 1 0; min-width:0; min-height:56px; display:flex; flex-direction:column; align-items:flex-start; gap:2px; text-align:left; padding:8px 16px; white-space:normal; }
.support-template-groups .btn span { color:var(--ds-ink-secondary); font-size:12px; font-weight:400; }
.ui-language .app .support-template-picker .btn:is([data-group],[data-topic])[aria-pressed="true"] { border-color:var(--ds-accent); background:var(--ds-accent-soft); color:var(--ds-ink); }
.support-template-topic-nav { display:flex; flex-direction:column; min-height:0; padding-inline-end:12px; border-inline-end:1px solid var(--ds-line); }
.support-template-topic-nav h3,.support-template-section-head h3 { margin:0; font:600 14px/1.5 var(--ds-font); }
.support-template-topic-nav h3 { padding:0 10px 10px; }
.support-template-topics { display:flex; flex-direction:column; gap:2px; min-height:0; overflow-y:auto; padding:2px; }
.support-template-topic { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-shrink:0; width:100%; min-height:38px; padding:8px 10px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--ds-ink-secondary); font:400 13px/1.45 var(--ds-font); text-align:left; cursor:pointer; overflow-wrap:anywhere; }
.support-template-topic:hover:not(:disabled) { background:var(--ds-surface-subtle); color:var(--ds-ink); }
.support-template-topic[aria-pressed="true"] { background:var(--ds-accent-soft); color:var(--ds-ink); font-weight:600; }
.support-template-topic:focus-visible { outline:2px solid var(--ds-accent); outline-offset:-2px; }
.support-template-topic-count { flex-shrink:0; color:var(--ds-ink-secondary); font-size:12px; font-weight:400; font-variant-numeric:tabular-nums; }
.support-template-topic-control { display:none; }
.support-template-section-head { display:flex; align-items:baseline; justify-content:space-between; gap:8px; padding:0 3px 10px; }
.support-template-section-head .rtp-status { margin:0; min-height:0; font-size:12px; text-align:right; }
.support-template-recommendation { margin-top:12px; }
.support-template-recommendation[hidden] { display:none; }
.support-template-recommendation label { margin-bottom:6px; }
.support-template-recommendation .filter-select { flex:1; width:100%; min-width:0; min-height:44px; margin:0; }
.support-template-recommendation :is(input,select)[hidden],.support-template-reco-info:empty { display:none; }
.support-template-reco-info { margin:0 0 8px; color:var(--ds-ink-secondary); font:12px/1.5 var(--ds-font); }
.support-template-recommendation>div { display:flex; align-items:center; gap:8px; }
.support-template-recommendation .rtp-search { margin:0; min-width:0; flex:1; font-size:14px; }
.support-template-recommendation .btn { flex-shrink:0; }
.support-template-picker .rtp-edit-meta { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; margin-top:8px; color:var(--ds-ink-secondary); font-size:12px; }
.support-template-picker .rtp-list { min-height:0; max-height:none; flex:1; }
.support-template-picker .rtp-preview { max-height:none; display:flex; flex-direction:column; }
.support-template-picker .rtp-text { box-sizing:border-box; min-height:100px; flex:1; resize:none; }
.support-template-pages { display:flex; justify-content:space-between; align-items:center; gap:12px; padding-top:12px; font:13px/1.5 var(--ds-font); }
.support-template-pages .btn { min-height:40px; }
.support-template-pages[hidden] { display:none; }
.support-template-reason { margin:12px 0 0; color:var(--ds-ink-secondary); font:13px/1.6 var(--ds-font); }
.support-template-picker .rtp-foot { flex-wrap:wrap; }
.support-template-picker .rtp-option small { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
/* Factory manager additions must not squeeze the selected queue tab to a
   fragment or push native filters outside the work area. Materials unchanged. */
.ui-language .app :is(#page-reviews-mp,#page-questions) .rv-tabs:has([id^="factory-work-"],#qApproveAllDrafts,[id^="support-last-batch-"]) .queue-tab-strip{flex:1 1 280px;width:auto;min-width:min(220px,100%)}
.ui-language .app :is(#page-reviews-mp,#page-questions) .rv-tabs-right:has([id^="factory-work-"],#qApproveAllDrafts,[id^="support-last-batch-"]){max-width:100%;min-width:0;flex-wrap:wrap}
@container review-toolbar (max-width:620px){
 .ui-language .app :is(#page-reviews-mp,#page-questions) .rv-tabs-right>:is([id^="factory-work-"],#qApproveAllDrafts,[id^="support-last-batch-"]){grid-column:1/-1;order:2;min-height:44px}
}
@media(max-width:980px) {
 .support-template-topic-nav { display:none; }
 .support-template-topic-control { display:block; }
 .support-template-search { grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); }
 .support-template-picker .rtp-body { grid-template-columns:minmax(220px,.85fr) minmax(0,1.4fr); }
}
@media(max-width:700px) {
 .support-template-picker { width:calc(100vw - 24px); max-height:calc(100dvh - 24px); }
 .support-template-groups .btn { min-height:44px; padding:8px 12px; font-size:13px; }
 .support-template-groups .btn span { display:none; }
 .support-template-recommendation>div { flex-wrap:wrap; }
 .support-template-search { grid-template-columns:1fr; }
 .support-template-picker :is(input,select,textarea) { font-size:16px; }
 .support-template-picker .rtp-body { grid-template-columns:1fr; height:min(490px,49dvh); grid-template-rows:minmax(100px,1fr) minmax(130px,1fr); }
 .support-template-picker .rtp-foot .btn { flex:1 1 auto; }
}

/* Native editors share one compact line toolbar above the work area. */
[data-support-line-editor]{flex-shrink:0;padding:10px 20px;margin:0;border-bottom:1px solid var(--ds-line);gap:8px}
[data-support-line-editor] .btn{min-height:36px;padding:8px 12px;font:500 13px/1.4 var(--ds-font)}
[data-support-line-editor] [role=status]{font-size:12px;min-width:0;flex:1 1 220px}
[data-support-line-editor] [data-line-state]{font:500 13px/1.4 var(--ds-font);color:var(--ds-ink-secondary)}
.support-line-active :is(#edOverlay,#qEditorOverlay) .ed-nav{display:none}
@media(max-width:600px){[data-support-line-editor]{padding:10px 16px}[data-support-line-editor] .btn{min-height:44px}}

/* The Factory operator sees one owned item, never the manager's bulk inbox. */
.support-line-single :is(#page-reviews-mp,#page-questions)>:not([data-support-dispatch]):not([data-support-line-home]):not(#edOverlay):not(#qEditorOverlay){display:none!important}
[data-support-line-home][hidden]{display:none!important}
.support-line-single #queueExportOpen{display:none!important}

/* Reserve the native footer in the desktop editor instead of pushing Send
   below the scroll edge when the shift controls are present. */
@media(min-width:901px){
 :is(#ed,#qEditor):has([data-support-line-editor]:not([hidden])) .ed-right:has(.support-work){display:grid;grid-template-rows:auto minmax(160px,1fr) auto auto;overflow:hidden;min-height:0}
 :is(#ed,#qEditor):has([data-support-line-editor]:not([hidden])) .ed-text-wrap{min-height:0;min-width:0;height:100%}
 :is(#ed,#qEditor):has([data-support-line-editor]:not([hidden])) .ed-textarea{min-height:48px}
}

:is(#ed,#qEditor):has([data-support-line-editor]:not([hidden])) .ed-rv-head{flex-wrap:wrap;gap:8px 12px}

/* One item is the operator's primary workspace, not a small preview dialog. */
@media(min-width:901px){
 :is(#ed,#qEditor):not(.fs):has([data-support-line-editor]:not([hidden])){width:min(1480px,calc(100vw - 32px));height:calc(100dvh - 32px);max-height:calc(100dvh - 32px)}
 :is(#ed,#qEditor):has([data-support-line-editor]:not([hidden])) .ed-head{padding:12px 20px}
 :is(#ed,#qEditor):has([data-support-line-editor]:not([hidden])) .ed-right{padding:20px}
 [data-support-line-editor].support-dispatch-toolbar{padding:8px 20px;gap:4px}
}
