/* QC/Rework only: the Receiving photo pair, the claim mail preview and phone layout.
   Loaded after the shared app.css by rework.html; the desktop layout above 800px is unchanged. */
.info-edit-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 12px;min-height:44px}
.info-edit-toolbar.hidden,.info-edit-toolbar .hidden{display:none}
.info-edit-toolbar .actions{margin:0}
button.info-pencil{display:inline-flex;align-items:center;justify-content:center;width:44px;min-width:44px;height:44px;padding:10px}
.info-pencil svg{flex:none}
.info-edit-toolbar button:focus-visible,.info-edit-recovery button:focus-visible{outline:3px solid #ffc800;outline-offset:2px}
.info-edit-toolbar button:disabled,.info-edit-recovery button:disabled{cursor:default}
.info-edit-recovery{margin:12px 0;display:flex;align-items:start;gap:10px;flex-wrap:wrap}
.info-edit-recovery.hidden{display:none}
#infoEditLatest{flex-basis:100%}
#infoEditError{margin-bottom:12px}
.field-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px}
button.field-copy{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:44px;width:44px;height:44px;padding:10px;color:#173649}
.field-copy svg{flex:none}
.field-copy:focus-visible,.field-copy-fallback button:focus-visible{outline:3px solid #006b9b;outline-offset:2px}
.field-copy:disabled{cursor:default}
.field-copy-status{margin:0 0 12px;color:#173649;overflow-wrap:anywhere}
.field-copy-fallback{display:flex;flex-wrap:wrap;align-items:end;gap:10px;margin:0 0 16px}
.field-copy-fallback.hidden,.field-copy-status.hidden{display:none}
.field-copy-fallback label{flex:1 1 220px;min-width:0}
.field-copy-fallback input{width:100%;user-select:text}
.case-head input[readonly]{background:#f4f6f8;color:#173649;cursor:text}
.case-head input[readonly]:focus-visible{outline:2px solid #006b9b;outline-offset:1px}
.back-to-list{display:none;margin-bottom:12px}
.layout>*{min-width:0}
#listModes{margin-bottom:14px}
#groupSearch{display:grid;gap:10px}
.po-group,.po-round{min-width:0;border:1px solid #ccd7dd;border-radius:4px;padding:8px;overflow-wrap:anywhere}
.po-group>summary,.po-round>summary{cursor:pointer;padding:6px;min-height:44px}
.po-group>summary strong,.po-round>summary strong{display:inline}
.group-meta{display:block;font-size:13px;color:#304653;margin-top:4px;overflow-wrap:anywhere}
.po-group>button{margin:10px 0}
.po-round{margin-top:10px;background:#f8fafb}
.po-round .case-row{margin-top:8px}
#caseGroup{overflow-wrap:anywhere}
.photo-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:12px}
.claim-photo{min-width:0;border:1px solid #d8e0e5;border-radius:6px;padding:10px;background:#f8fafb}
.claim-photo h3{margin:0 0 8px;font-size:15px}
.claim-photo p{margin:0}
.photo-open{position:relative;display:block;width:100%;padding:0;border:1px solid #ccd7dd;border-radius:4px;background:#eef2f4;color:inherit;cursor:zoom-in}
.photo-open img{display:block;width:100%;height:260px;object-fit:contain}
.photo .photo-open img{height:130px;object-fit:cover}
.photo-open span{position:absolute;right:6px;bottom:6px;padding:3px 8px;border-radius:4px;background:#002b45d9;color:#fff;font-size:13px}
.attach-tag{display:inline-block;margin-top:6px;padding:2px 8px;border-radius:99px;background:#e8f6eb;color:#17642c;font-size:12px;font-weight:700}
.photo{display:grid;gap:6px;align-content:start}
.all-photos{margin-bottom:12px}
.all-photos summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:650}
#editFields>label{align-content:start}
.qc-pallets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:560px}
.qc-pallets .pal-card-head{gap:4px 10px;flex-wrap:wrap;padding:6px 10px}
.qc-pallets .mark-count{font-weight:600}
#complete{min-width:200px}
.job strong{font-weight:650}
.job-queued,.job-running,.job-retry{border-left:4px solid #e9d68f}
.job-failed,.job-blocked,.job-uncertain{border-left:4px solid #b3261e}
.field-hint{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:13px;font-weight:400;color:#5f6f78}
.field-hint:empty{display:none}
.field-hint.warn{color:#5d4700}
.field-hint.error{color:#a61b16}
.field-hint button{padding:6px 12px}
dialog{max-width:calc(100vw - 24px);max-height:calc(100vh - 24px);overflow:auto}
dialog .dialog-body{overflow-wrap:anywhere}
.preview-photos{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
.preview-photo{margin:0;min-width:0}
.preview-photo img{display:block;width:100%;height:160px;object-fit:contain;background:#eef2f4;border:1px solid #d8e0e5;border-radius:4px}
.preview-photo figcaption{margin-top:4px;font:12px ui-monospace,monospace;color:#304653}
.photo-viewer{width:min(1100px,calc(100vw - 24px))}
.viewer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.viewer-head h2{margin:0}
.viewer-frame{overflow:auto;max-height:calc(100vh - 190px);background:#eef2f4;border-radius:4px}
.viewer-frame img{display:block;max-width:100%;max-height:calc(100vh - 190px);margin:0 auto;object-fit:contain;cursor:zoom-in}
.viewer-frame.zoomed img{max-width:none;max-height:none;cursor:zoom-out}
@media(max-width:800px){
  .back-to-list{display:inline-flex}
  .layout:not(.show-detail)>section{display:none}
  .layout.show-detail>aside{display:none}
  .photo-pair,.preview-photos{grid-template-columns:1fr}
  .photo-open img{height:min(52vh,420px)}
  .card{padding:14px}
  .split{flex-direction:column}
  .split .actions{width:100%}
  #actions>button{flex:1 1 100%}
  #complete{width:100%}
  button,.button,input,select,summary{min-height:44px}
  .field-hint button{min-height:40px}
  dialog .dialog-body{padding:16px}
  .preview-photo img{height:min(34vh,240px)}
  .viewer-frame,.viewer-frame img{max-height:calc(100vh - 170px)}
}
@media(max-width:300px){.qc-pallets{grid-template-columns:1fr}}

/* One case heading: title, the status flow and the single next action together at the top. */
.next-title{margin:18px 0 10px;font-size:18px}
.steps{display:flex;gap:6px;list-style:none;margin:0 0 14px;padding:0;counter-reset:step}
.steps .step{flex:1 1 0;min-width:0;padding:8px 10px;border-radius:4px;background:#eef2f4;color:#5f6f78;font-size:14px;font-weight:650;counter-increment:step;overflow-wrap:anywhere}
.steps .step::before{content:counter(step) ". "}
.steps .step.done{background:#e8f6eb;color:#17642c}
.steps .step.done::before{content:"\2713 "}
.steps .step.current{background:#006b9b;color:#fff}
.steps .step.stopped{background:#fff0ef;color:#a61b16}
.steps .step.stopped::before{content:none}
.count-host:empty{display:none}
.count-host label{max-width:320px;margin-bottom:12px}
/* The hint keeps its line when it empties, so the approve button does not move under a tap that ends editing. */
.count-host .field-hint{display:block;min-height:1.5em}
button.quiet-danger{color:#a61b16}
.po-group.state-awaiting_qc,.case-row.state-awaiting_qc{border-left:4px solid #b3261e;background:#fff5f3}
.po-group.state-approved,.case-row.state-approved{border-left:4px solid #006b9b;background:#f0f7fc}
.po-group.state-completed,.case-row.state-completed{border-left:4px solid #267044;background:#f1f8f3}
.case-row.active{outline:2px solid #002b45;outline-offset:-2px}
.pill.awaiting_qc{background:#fbe6e2;color:#842219}
.pill.approved{background:#e1effa;color:#004b70}
.pill.completed{background:#e1f1e5;color:#1d5734}
#pendingPoTitle{width:100%;min-height:44px;text-align:left;margin:0 0 8px;font-weight:650}
#pendingPoTitle::before{content:"";display:inline-block;width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg);margin:0 12px 2px 0}
#pendingPoTitle[aria-expanded=true]::before{transform:rotate(45deg);margin-bottom:4px}
.decision-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.decision-actions #completion,.decision-actions #actions{margin:0}
.decision-actions button{min-height:44px}
.add-photo{margin-top:12px}
.add-photo>summary,.tech>summary{cursor:pointer;font-weight:650;color:#173649}
.tech[open]>summary{margin-bottom:12px}
/* Phones keep the label and damage photo side by side; tapping still opens the full image. */
@media(max-width:800px){
  .photo-pair{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .photo-pair .photo-open img{height:min(24vh,190px)}
  .steps .step{padding:8px 6px;font-size:13px}
  .count-host label{max-width:none}
}

/* Case page order: details with the damage type first, then pallet marks, photos and the decision at the end. */
.damage-tags{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:14px 0 16px}
.damage-tag{padding:6px 12px;border-radius:4px;background:#002b45;color:#fff;font-weight:700;font-size:15px;overflow-wrap:anywhere}
.damage-tag.missing{background:#fff8dc;color:#5d4700;border:1px solid #e9d68f}
.damage-where{color:#5f6f78;font-size:14px}
.more-fields{margin-top:14px}
.more-fields>summary{cursor:pointer;font-weight:650;color:#173649}
.more-fields[open]>summary{margin-bottom:12px}
.more-fields textarea{min-height:64px}
.card.decision{border-top:4px solid #006b9b}
.card.attention{border-color:#f0b9b5;background:#fff8f7}
.card.attention h2{color:#a61b16}

/* QC corrections stay separate from the immutable intake summary. */
.po-date-fields{margin-top:14px;grid-template-columns:repeat(2,minmax(0,1fr))}
.po-date-fields label,.po-date-fields input{min-width:0}
.po-completion:not(:empty){margin-top:12px}
.damage-fieldset{border:0;padding:0;margin:16px 0 0;min-width:0}
.damage-fieldset legend{font-size:14px;font-weight:650;margin-bottom:8px}
.damage-choices{display:flex;flex-wrap:wrap;gap:8px}
button.damage-choice{min-height:44px;background:#fff;color:#173649;border:1px solid #9baab3;overflow-wrap:anywhere;max-width:100%}
button.damage-choice.selected{background:#002b45;color:#fff;border-color:#002b45}
button.damage-choice.selected::before{content:"\2713"}
button.damage-choice:focus-visible{outline:3px solid #ffc800;outline-offset:2px}
#qcMarks>p{grid-column:1/-1;margin:0}
@media(max-width:359px){.po-date-fields{grid-template-columns:1fr}}

/* Confirmation cards expose the reviewed values, not technical separator strings. */
.review-values{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0 18px}
.review-values>div{min-width:0;padding:12px;background:#f4f6f8;border:1px solid #d8e0e5;border-radius:5px}
.review-values dt{color:#5f6f78;font-size:13px;margin-bottom:4px}
.review-values dd{margin:0;font-weight:650;overflow-wrap:anywhere}
.confirmation-actions{margin-top:16px}
#changeError{margin-top:12px}
@media(max-width:500px){.review-values{grid-template-columns:1fr;gap:8px}.confirmation-actions>button{flex:1 1 100%}}

.confirmation-actions>button{min-height:44px}
@media(max-width:500px){#qcApprovalSummary .review-values{grid-template-columns:repeat(2,minmax(0,1fr))}#qcApprovalSummary .review-values>div:nth-child(3),#qcApprovalSummary .review-values>div:nth-child(6){grid-column:1/-1}#qcApproval .actions>button{flex:1 1 100%}}

/* Inline modern PO review uses the existing QC information layout. */
.po-assignment{flex-basis:100%;min-width:0;padding-top:8px}
.po-assignment p{overflow-wrap:anywhere}
.po-assignment-flow{margin:0 0 10px;color:#173649;font-weight:600}
.po-assignment h3{font-size:1rem;line-height:1.4;margin:12px 0 8px}
.po-assignment>button{margin:6px 8px 0 0}
.po-assignment button{min-height:44px;white-space:normal}
.po-assignment select{display:block;width:100%;margin:10px 0;min-height:44px}
.po-assignment button:focus-visible,.po-assignment select:focus-visible{outline:3px solid #006b9b;outline-offset:2px}
.po-assignment[aria-busy="true"]{cursor:progress}
@media(max-width:500px){.po-assignment>button{max-width:100%}.po-assignment .confirmation-actions>button{flex:1 1 100%}}
@media(max-width:500px){.po-assignment .review-values{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}}

/* Country is a text classification, separate from QC status pills. */
.po-flow{display:inline-block;max-width:100%;padding:3px 8px;margin:6px 6px 6px 0;border:1px solid #a8bdc9;border-radius:4px;background:#eef4f7;color:#12394e;font-size:14px;font-weight:600;line-height:1.5;overflow-wrap:anywhere;vertical-align:middle}
.po-flow[data-po-flow="NO"]{color:#742735;background:#fff0f2;border-color:#d4a7af}
.po-flow[data-po-flow="unknown"],.po-flow[data-po-flow="invalid"]{color:#465561;background:#f3f5f6;border-color:#b8c2c9}
.po-flow.hidden{display:none}

#caseStatus{margin-right:8px}
