/* Plain correction links keep the original invoice review layout. */
.invoice-extracted-editor{font-family:inherit}
.invoice-extracted-editor summary{cursor:pointer;list-style:none;width:fit-content;min-height:30px;display:flex;align-items:center;font-size:12px;font-weight:500;color:var(--green,#285144);text-decoration:underline;text-underline-offset:3px}
.invoice-extracted-editor summary::-webkit-details-marker{display:none}
.invoice-extracted-editor summary:focus-visible{outline:2px solid var(--green,#285144);outline-offset:3px;border-radius:3px}
.invoice-extracted-editor details:not([open])>:not(summary),details.invoice-extracted-editor:not([open])>:not(summary){display:none!important}
#page-imports #importResults [data-invoice-editor]{padding:0;margin:4px 0 8px;border:0;background:transparent}
#page-imports #importResults .invoice-line-editor{padding:0;margin:1px 0 0;border:0;background:transparent}
.extracted-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.extracted-fields label{display:grid;gap:4px;font-size:11px;line-height:1.3;min-width:0}
.extracted-fields input{box-sizing:border-box;width:100%;min-width:0;height:38px;min-height:38px;padding:6px 8px;font-size:13px;border:1px solid var(--line,#dce6e1);border-radius:8px;background:#fff;color:var(--ink,#243c33)}
.line-correction[open]>.extracted-primary,[data-invoice-editor][open]>.extracted-fields{padding:6px 0}
.extraction-secondary{margin-top:4px}
.extraction-secondary[open]>.extracted-fields{padding:6px 0}
.invoice-extracted-editor small:empty{display:none}
.invoice-extracted-editor small:not(:empty){display:block;font-size:11px;line-height:1.35;color:#96601b;margin-top:3px}
.invoice-extracted-editor>p,.extraction-admin-audit p{font-size:12px;line-height:1.5}
.extraction-admin-audit{padding:10px;border:1px solid #e8d8b8;border-radius:10px;margin:8px 0}
#page-imports #importResults .invoice-match-controls{display:block;min-width:0}
#page-imports #importResults .match-table tr.has-extraction-editor>td{padding:8px 10px;vertical-align:middle}
#page-imports #importResults .has-extraction-editor .invoice-label{width:100%}
@media(min-width:768px){
 #page-imports #importResults .match-table tr.has-extraction-editor>td:nth-child(3),#page-imports #importResults .match-table tr.has-extraction-editor>td:nth-child(4),#page-imports #importResults .match-table:has(.has-extraction-editor) thead th:nth-child(3),#page-imports #importResults .match-table:has(.has-extraction-editor) thead th:nth-child(4){display:table-cell}
 #page-imports #importResults .has-extraction-editor .mobile-match-metrics{display:none!important}
}
@media(min-width:1000px){[data-invoice-editor]>.extracted-fields{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:767px){
 #page-imports #importResults .match-table tr.has-extraction-editor{padding:9px;gap:4px;border-radius:14px}
 #page-imports #importResults .has-extraction-editor .mobile-match-metrics{display:grid!important;margin-top:4px}
 .extracted-fields{gap:6px}
 .extracted-fields input{font-size:16px;min-height:42px;height:42px}
 .invoice-extracted-editor summary{min-height:36px}
}
.extraction-correct-link{display:inline-flex;align-items:center;min-height:30px;padding:0;border:0;background:transparent;color:var(--green,#285144);font:500 12px/1.3 inherit;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.extraction-correct-link:disabled{opacity:.5;cursor:default}
#page-imports #importResults .has-extraction-editor td small:empty{display:none}
#modal:has(.extraction-popup){display:flex;flex-direction:column;padding:0!important;overflow:hidden;height:min(650px,calc(var(--cotiqa-dialog-height,100dvh) - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)));width:min(640px,100%)}
#modal:has(.extraction-popup) #modalContent{display:flex;flex:1;min-height:0;overflow:hidden}
.extraction-popup{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;color:var(--ink)}
.extraction-popup h2{flex:none;margin:0;padding:16px 50px 12px 16px;font-size:19px;outline:none}
.extraction-popup form{display:flex;flex:1;flex-direction:column;min-height:0;margin:0}
.extraction-popup-body{flex:1;min-height:0;overflow-y:auto;padding:4px 16px 16px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.extraction-popup .extraction-secondary summary{cursor:pointer;min-height:38px;display:flex;align-items:center;font-size:12px;text-decoration:underline;color:var(--green)}
.extraction-popup .extraction-secondary:not([open])>.extracted-fields{display:none!important}
.extraction-popup footer{display:flex;justify-content:flex-end;gap:8px;flex:none;padding:10px 16px;border-top:1px solid var(--line)}
.extraction-popup [data-popup-status]{display:block;margin-top:8px;color:#96601b;font-size:12px}
@media(max-width:767px){.extraction-correct-link{min-height:36px}.extraction-popup h2{font-size:18px;padding:12px 46px 10px 12px}.extraction-popup-body{padding:4px 12px 12px}.extraction-popup footer{padding:8px 12px}}
/* The unassigned select already communicates this state; avoid duplicate captions. */
#page-imports #importResults #matchRows tr[data-review-state="review"] .match-score,
#page-imports #importResults #matchRows tr[data-review-state="review"] .review-state-badge,
#page-imports #importResults #matchRows tr[data-review-state="review"] .mobile-match-metrics>span:last-child{display:none!important}
#page-imports #importResults .invoice-reference-actions{display:flex;align-items:center;flex-wrap:wrap;gap:0 4px;margin-top:2px}
#page-imports #importResults .invoice-reference-actions .extraction-correct-link{display:inline-flex;min-height:28px;padding:0;font-size:11px}
#page-imports #importResults .invoice-line-editor:has(>small:empty){display:none}
/* Shared row rhythm with Comparaisons; native table columns keep headers aligned. */
.invoice-product-icon{display:none}
#page-imports #importResults .mobile-line-confirm:after{white-space:nowrap;overflow-wrap:normal;word-break:normal}
@media(min-width:768px){
 #page-imports #importResults .match-table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}
 #page-imports #importResults .match-table th:nth-child(1){width:calc((100% - 318px)*.60)}
 #page-imports #importResults .match-table th:nth-child(2){width:calc((100% - 318px)*.40)}
 #page-imports #importResults .match-table td:nth-child(2) .cotiqa-select{width:100%;max-width:340px}
 #page-imports #importResults .match-table td:nth-child(2) .cotiqa-select-trigger{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #page-imports #importResults .match-table th:nth-child(3){width:72px}
 #page-imports #importResults .match-table th:nth-child(4){width:104px}
 #page-imports #importResults .match-table th:nth-child(5){width:142px}
 #page-imports #importResults .match-table thead th{box-sizing:border-box;padding:12px 14px;font-size:10px;line-height:1.3;letter-spacing:.06em;font-weight:500;vertical-align:middle;white-space:nowrap;text-align:left}
 #page-imports #importResults .match-table tbody td{box-sizing:border-box;height:auto;min-width:0;padding:12px 14px;vertical-align:middle;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
 #page-imports #importResults .match-table tbody td:first-child,#page-imports #importResults .match-table thead th:first-child{padding-left:22px}
 #page-imports #importResults .match-table tbody td:last-child,#page-imports #importResults .match-table thead th:last-child{padding-right:22px}
 #page-imports #importResults .match-table :is(th,td):nth-child(3),#page-imports #importResults .match-table :is(th,td):nth-child(5){text-align:center}
 #page-imports #importResults .match-table :is(th,td):nth-child(4){text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
 #page-imports #importResults .match-table td:nth-child(3){font-variant-numeric:tabular-nums}
 #page-imports #importResults .match-table .invoice-label{font-size:14px;font-weight:600;line-height:1.4;min-height:26px;height:26px}
 #page-imports #importResults .match-table .invoice-reference-actions{font-size:12px;line-height:1.4;min-height:28px;margin:2px 0 0}
 #page-imports #importResults .match-table .cotiqa-select-trigger{min-height:40px;border-radius:10px;padding:8px 30px 8px 10px;font-size:13px;line-height:1.35}
 #page-imports #importResults .match-table .mobile-line-confirm{width:fit-content;max-width:100%;min-height:40px;justify-content:center;padding:8px;font-size:12px;gap:6px;white-space:nowrap;overflow-wrap:normal}
 #page-imports #importResults .match-table .mobile-line-confirm span{white-space:nowrap;overflow-wrap:normal;word-break:normal}
 #page-imports #importResults .match-table .mobile-line-confirm input{flex:none;width:16px;height:16px}
 #page-imports #importResults .match-table .line-confirm{margin:0;vertical-align:middle}
 #page-imports #importResults .match-table td small:empty{display:none}
}
@media(min-width:768px){
 #page-imports #importResults #matchRows tr>td{height:96px;padding:18px 14px;vertical-align:middle;border-bottom:1px solid var(--line)}
 #page-imports #importResults #matchRows tr>td:first-child{position:relative;padding-left:78px}
 #page-imports #importResults #matchRows tr>td:last-child{padding-right:22px}
 #page-imports #importResults #matchRows .invoice-product-icon{display:flex;align-items:center;justify-content:center;position:absolute;left:22px;top:50%;transform:translateY(-50%);width:44px;height:44px;border-radius:11px;background:var(--green-soft,#edf4f0);color:var(--ink)}
 #page-imports #importResults #matchRows .invoice-product-icon svg{width:20px;height:20px}
 #page-imports #importResults #matchRows .invoice-label{font:600 16px/1.45 'DM Sans',sans-serif;height:26px;min-height:26px}
 #page-imports #importResults #matchRows .invoice-reference-actions{font:400 13px/1.4 'DM Sans',sans-serif;min-height:22px;margin:4px 0 0;color:var(--muted)}
 #page-imports #importResults #matchRows .invoice-reference-actions .extraction-correct-link{font-size:13px;min-height:22px}
 #page-imports #importResults #matchRows tr:hover>td{background:#f2f7f4}
}
@media(min-width:768px) and (max-width:1050px){
 #page-imports #importResults .match-table tbody td,#page-imports #importResults .match-table thead th{padding-left:9px;padding-right:9px}
 #page-imports #importResults .match-table th:nth-child(1){width:calc((100% - 272px)*.60)}
 #page-imports #importResults .match-table th:nth-child(2){width:calc((100% - 272px)*.40)}
 #page-imports #importResults .match-table th:nth-child(3){width:60px}
 #page-imports #importResults .match-table th:nth-child(4){width:84px}
 #page-imports #importResults .match-table th:nth-child(5){width:128px}
 #page-imports #importResults .match-table .invoice-label{font-size:13px}
}
@media(max-width:767px){
 #page-imports #importResults .match-table .mobile-match-metrics{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:8px}
 #page-imports #importResults .match-table .mobile-match-metrics>span:nth-child(2){text-align:right;justify-self:end}
 #page-imports #importResults .match-table .mobile-match-metrics>span:last-child{display:none}
 #page-imports #importResults .match-table .mobile-line-confirm{width:fit-content;margin-left:auto}
 #page-imports #importResults .invoice-reference-actions{gap:0 3px;font-size:11px}
}
