/* Keep comparison controls visible while the table scrolls. */
.modal-body:has(.comparison-settings){display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;padding:16px 20px;gap:12px}
.modal-body:has(.comparison-settings)>.comparison-settings{flex:none;margin:0;padding:0 0 12px;border-bottom:1px solid var(--line);background:#fff}
.comparison-settings h3{margin:0 0 8px;font-size:15px}
.comparison-settings h3:has(.compare-fields-toggle){margin:10px 0 0}
.comparison-settings>.comparison-options:not(#comparison-field-options){flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;padding-bottom:4px;overscroll-behavior-x:contain}
.comparison-settings>.comparison-options:not(#comparison-field-options)>button{flex:0 0 auto;max-width:280px;text-align:left}
.compare-fields-toggle{min-height:40px;padding:6px 12px}
#comparison-field-options:not([hidden]){max-height:128px;overflow-y:auto;overscroll-behavior-y:contain;padding:10px 4px 4px;margin-top:4px;scrollbar-gutter:stable}
.modal-body:has(.comparison-settings)>.comparison-scroll{flex:1;min-height:0;overflow:auto;margin:0;padding-bottom:8px;overscroll-behavior:contain}
.comparison thead th{position:sticky;top:0;left:auto;z-index:3;background:#f5f7fa}
.comparison thead th:first-child{left:0;z-index:4}
.comparison tbody th{position:sticky;left:0;z-index:2}
.comparison-scroll:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
body:has(dialog[open] .comparison-settings){overflow:hidden}
@media(max-width:640px){
 .modal-body:has(.comparison-settings){padding:12px;gap:10px}
 .comparison-settings h3{font-size:14px}
 .comparison-settings>.comparison-options:not(#comparison-field-options)>button{max-width:200px;font-size:13px;padding:8px 12px}
 #comparison-field-options:not([hidden]){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));max-height:112px;gap:6px}
 #comparison-field-options button{min-height:40px;padding:6px 8px;font-size:12px;text-align:left}
 .comparison thead th{font-size:13px}
 .comparison thead th:first-child,.comparison tbody th{width:76px;min-width:76px}
 .comparison thead th:not(:first-child){width:168px;min-width:168px}
 .comparison th,.comparison td{padding:12px 10px;font-size:13px}
}
