/* Batch quote lookup is a focused internal tool. Tables scroll inside the dialog. */
#dialog:has(.rq-shell){width:min(1320px,calc(100vw - 32px));max-width:calc(100vw - 32px)}
#dialog:has(.rq-shell) .modal-body{padding:24px 28px}
.rq-shell{--rq-accent:var(--orange,#e92332);--rq-ink:var(--ink,#252b2b);--rq-muted:#636c70;--rq-line:var(--line,#e6e8e5);--rq-soft:var(--pale,#fff0f1);min-width:0;color:var(--rq-ink);font-size:14px;line-height:1.6}
.rq-intro{display:flex;flex-direction:column;gap:4px;margin-bottom:20px}.rq-intro>b{font-size:19px}.rq-intro p,.rq-hint,.rq-footnote{color:var(--rq-muted);font-size:13px;line-height:1.8}.rq-steps{display:flex;gap:24px;padding:0 0 20px;margin:0 0 20px;list-style:none;border-bottom:1px solid var(--rq-line)}.rq-steps li{display:flex;align-items:center;gap:8px;color:var(--rq-muted)}.rq-steps li span{display:grid;place-items:center;flex:none;width:28px;height:28px;border:1px solid var(--rq-line);border-radius:50%;font-size:12px}.rq-steps [aria-current=step]{color:var(--rq-accent);font-weight:650}.rq-steps [aria-current=step] span{background:var(--rq-accent);color:#fff;border-color:var(--rq-accent)}
.rq-shell button,.rq-shell select,.rq-shell input{min-height:44px;font-size:14px}.rq-shell button{white-space:normal}.rq-shell button:focus-visible,.rq-shell summary:focus-visible,.rq-table-scroll:focus-visible{outline:2px solid var(--rq-accent);outline-offset:3px}.rq-shell button:active{opacity:.85}.rq-shell label{display:block;min-width:0;font-weight:550}.rq-shell label select,.rq-shell label input{display:block;margin-top:8px}.rq-shell select{max-width:100%;min-width:0}.rq-shell em{font-style:normal;color:var(--rq-accent)}.rq-error{padding:12px 16px;background:#fff1f1;border:1px solid #efb7bd;color:#9d2533;border-radius:10px;margin-bottom:16px;overflow-wrap:anywhere}.rq-error[hidden]{display:none}.rq-loading{padding:10px 16px;color:var(--rq-accent);background:var(--rq-soft);border-radius:8px;margin-bottom:16px}
.rq-upload{display:flex;flex-direction:column;align-items:center;text-align:center;gap:16px;padding:36px 24px;border:1px dashed #d7dcd9;border-radius:14px;background:#fafbfa}.rq-upload h3{margin:0!important;font-size:19px}.rq-upload p{max-width:540px;color:var(--rq-muted)}.rq-upload-icon{display:grid;place-items:center;width:64px;height:64px;border-radius:16px;background:var(--rq-soft);color:var(--rq-accent)}.rq-upload-icon svg{width:30px;height:30px}.rq-file-picker{position:relative;background:var(--rq-accent);border:1px solid var(--rq-accent);color:#fff;padding:12px 24px;border-radius:9px;cursor:pointer;max-width:100%;overflow:hidden}.rq-file-picker:focus-within{outline:2px solid var(--rq-accent);outline-offset:4px}.rq-file-picker input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}.rq-file-picker:has(input:disabled){opacity:.5;cursor:wait}.rq-upload small{max-width:600px;color:var(--rq-muted);line-height:1.8}
.rq-file-line{display:flex;gap:16px;justify-content:space-between;align-items:center;border:1px solid var(--rq-line);border-radius:10px;padding:16px;margin-bottom:20px}.rq-file-line>div{min-width:0}.rq-file-line b,.rq-file-line span{display:block;overflow-wrap:anywhere}.rq-file-line span{margin-top:4px;font-size:13px;color:var(--rq-muted)}.rq-file-line button{flex-shrink:0}.rq-source-controls{display:grid;grid-template-columns:minmax(180px,1fr) minmax(130px,180px) auto;gap:16px;align-items:end;margin-bottom:20px}.rq-mapping{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:12px}.rq-source-preview{margin-top:20px;border:1px solid var(--rq-line);border-radius:10px;overflow:hidden}.rq-source-preview summary{padding:12px 16px;cursor:pointer;font-weight:600;min-height:44px}.rq-source-preview td{max-width:300px;white-space:pre-wrap;overflow-wrap:anywhere}
.rq-summary{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:20px}.rq-summary>div{background:#fafbfa;border:1px solid var(--rq-line);padding:14px 16px;border-radius:10px}.rq-summary strong{font-size:26px;line-height:1.3;font-weight:650;display:block}.rq-summary span{display:block;color:var(--rq-muted);font-size:12px;margin-top:5px}.rq-result-tools{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:16px}.rq-result-tools label{width:240px;flex-shrink:0}.rq-result-tools p{font-size:13px;color:var(--rq-muted);max-width:640px}.rq-table-scroll{width:100%;max-width:100%;overflow:auto;overscroll-behavior-x:contain;border:1px solid var(--rq-line);border-radius:10px;scrollbar-gutter:stable}.rq-shell table{border-collapse:collapse;width:100%;margin:0}.rq-shell th{color:#556163;background:#f8f9f8;font-size:12px;font-weight:600;vertical-align:top;position:sticky;top:0}.rq-shell th,.rq-shell td{padding:14px 16px}.rq-result-table{min-width:1400px;table-layout:fixed}.rq-result-table th:nth-child(1){width:72px}.rq-result-table th:nth-child(2){width:180px}.rq-result-table th:nth-child(3){width:170px}.rq-result-table th:nth-child(4){width:190px}.rq-result-table th:nth-child(5){width:230px}.rq-result-table th:nth-child(6){width:230px}.rq-result-table th:nth-child(7){width:260px}.rq-result-table td{vertical-align:top;white-space:normal;line-height:1.65;overflow-wrap:anywhere}.rq-result-table td small,.rq-identity>span,.rq-identity>small,.rq-original span{display:block}.rq-result-table td small{margin-top:6px;font-size:12px;color:var(--rq-muted)}.rq-original span+span{margin-top:4px}.rq-status{display:inline-flex;border-radius:5px;padding:4px 8px;margin-bottom:6px;font-size:12px;font-weight:600;background:#eff1f0;color:#5b6665}.rq-status.is-matched{background:#e9f6ed;color:#286f4d}.rq-status.is-review{background:#fff3df;color:#8d5a1c}.rq-status.is-empty{background:#eff1f0;color:#5b6665}.rq-identity b{display:block;font-size:14px}.rq-identity span{margin-top:4px;font-size:12px;color:var(--rq-muted)}.rq-identity a{display:inline-block;min-height:44px;padding-top:10px;font-size:13px;max-width:100%;overflow-wrap:anywhere}.rq-quote{display:flex;flex-direction:column;gap:3px;padding:0 0 12px;margin-bottom:12px;border-bottom:1px solid var(--rq-line)}.rq-quote:last-child{border:0;margin-bottom:0;padding-bottom:0}.rq-quote b{font-size:15px;color:var(--rq-accent)}.rq-quote span{font-size:12px}.rq-quote small{margin-top:2px!important}.rq-history-label{font-size:11px;font-weight:650;color:#716044;background:#f8f3e9;border-radius:4px;padding:4px 6px;margin-bottom:8px}.rq-history-price b{color:#4c5759}.rq-muted{font-size:12px;color:var(--rq-muted)}.rq-confirm label{font-size:12px}.rq-confirm select{font-size:12px;white-space:normal;width:100%}.rq-confirm summary{padding:10px 0;min-height:44px;cursor:pointer;color:var(--rq-accent);font-size:12px}.rq-candidate{border:1px solid var(--rq-line);padding:12px;border-radius:8px;margin-bottom:12px;background:#fff}.rq-candidate>.rq-identity{margin-bottom:12px}.rq-candidate .rq-quote{margin-bottom:8px;padding-bottom:8px}.rq-pagination{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:16px 0;color:var(--rq-muted);font-size:13px}.rq-pagination>div{display:flex;align-items:center;gap:12px}.rq-footnote{padding:12px 16px;background:#fafbfa;border-radius:8px}.rq-empty{text-align:center;padding:32px;color:var(--rq-muted)}.rq-footer{display:flex;align-items:center;justify-content:flex-end;gap:12px;padding-top:20px;margin-top:20px;border-top:1px solid var(--rq-line);padding-bottom:env(safe-area-inset-bottom)}
@media(max-width:900px){.rq-mapping{grid-template-columns:repeat(2,minmax(0,1fr))}.rq-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.rq-result-tools{align-items:start;flex-direction:column;gap:12px}}
@media(max-width:600px){#dialog:has(.rq-shell){width:calc(100vw - 20px);max-width:calc(100vw - 20px)}#dialog:has(.rq-shell) .modal-body{padding:16px}.rq-intro>b{font-size:17px}.rq-steps{gap:8px;font-size:12px;justify-content:space-between}.rq-steps li{gap:5px;flex:1;min-width:0}.rq-steps li span{width:23px;height:23px}.rq-upload{padding:24px 16px}.rq-upload h3{font-size:17px}.rq-source-controls{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}.rq-source-controls>button{grid-column:1/-1}.rq-mapping{grid-template-columns:minmax(0,1fr);gap:14px}.rq-file-line{align-items:start;flex-direction:column}.rq-file-line button{width:100%}.rq-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.rq-summary>div{padding:12px}.rq-summary strong{font-size:24px}.rq-result-tools label{width:100%}.rq-pagination{align-items:start;flex-direction:column;gap:10px}.rq-pagination>div{width:100%;justify-content:space-between;gap:8px}.rq-pagination button{padding:9px 12px}.rq-footer{flex-wrap:wrap}.rq-footer button{flex:1;min-width:120px}.rq-shell th,.rq-shell td{padding:12px}.rq-table-scroll{border-radius:8px}}
@media(prefers-reduced-motion:reduce){.rq-shell button,.rq-shell input,.rq-shell select{transition:none}}

/* Keep context and export actions reachable in long, scrollable lookup results. */
#dialog:has(.rq-shell) .modal-head{position:sticky;top:0;z-index:4;background:#fff}
.rq-footer{position:sticky;bottom:-24px;background:#fff;z-index:2;padding-bottom:20px;box-shadow:0 -8px 18px #ffffffea}
@media(max-width:600px){.rq-footer{bottom:-16px;padding-bottom:max(16px,env(safe-area-inset-bottom))}}
