.variant-builder { margin-top:24px; color:var(--text); }
.variant-builder[hidden], .vb-library[hidden] { display:none; }
.variant-builder button.link { appearance:none; border:0; background:transparent; color:var(--accent); font:inherit; font-size:12px; font-weight:500; padding:0; min-height:40px; cursor:pointer; text-decoration:underline; text-underline-offset:3px; text-decoration-color:var(--line); }
.variant-builder button.link:hover { text-decoration-color:currentColor; }
.vb-intro { display:flex; align-items:center; justify-content:space-between; gap:24px; padding-bottom:24px; }
.vb-intro h2 { margin:0 0 8px; font-size:24px; line-height:1.2; letter-spacing:-.02em; }
.vb-intro p { margin:0; color:var(--text-2); font-size:14px; max-width:64ch; }
.vb-coverage { flex-shrink:0; color:var(--text-2); font-size:13px; font-variant-numeric:tabular-nums; }
.vb-coverage strong { color:var(--text); font-size:24px; font-weight:650; }
.vb-workspace { display:grid; grid-template-columns:minmax(280px, .78fr) minmax(0,1.5fr); align-items:start; gap:32px; }
.vb-composition { position:sticky; top:92px; min-width:0; padding:20px; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
.vb-title { display:flex; flex-direction:column; gap:8px; margin:0 0 24px; font-size:13px; font-weight:550; }
.variant-builder .input { min-width:0; width:100%; min-height:44px; font-weight:400; }
.vb-title .input { border-radius:8px; }
.vb-composition-heading, .vb-pool-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.variant-builder h3 { font-size:16px; font-weight:650; margin:0; }
.vb-composition-heading h3 span { margin-left:6px; font-weight:400; color:var(--text-2); }
.vb-sort, .vb-clear { font-size:12px; }
.vb-empty-composition { min-height:180px; padding:24px 8px; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:12px; text-align:center; }
.vb-empty-composition > .ic { width:28px; height:28px; color:var(--text-2); }
.vb-empty-composition strong { font-size:14px; font-weight:550; }
.vb-empty-composition p { margin:0; color:var(--text-2); font-size:13px; max-width:32ch; line-height:1.5; }
.vb-selected-list { list-style:none; padding:0; margin:0; max-height:440px; overflow:auto; scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
.vb-selected-list li { display:flex; align-items:center; gap:8px; padding:12px 0; border-bottom:1px solid var(--line); cursor:grab; }
.vb-selected-list li:first-child { border-top:1px solid var(--line); }
.vb-selected-list li:active { cursor:grabbing; }
.vb-selected-list li.is-replacing { background:var(--accent-soft); }
.vb-selected-list li > .ic { flex-shrink:0; width:14px; color:var(--text-2); }
.vb-selected-description { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 8px; flex:1; min-width:0; font-size:12px; }
.vb-selected-description strong { font-size:14px; }
.vb-selected-description .mono { color:var(--text-2); overflow-wrap:anywhere; }
.vb-row-actions { display:flex; }
.vb-icon-button, .vb-reorder button { display:inline-flex; align-items:center; justify-content:center; width:32px; height:36px; border:0; border-radius:6px; color:var(--text-2); background:transparent; cursor:pointer; }
.vb-icon-button:hover, .vb-reorder button:hover:not(:disabled) { color:var(--text); background:var(--accent-soft); }
.vb-icon-button .ic { width:16px; height:16px; }
.vb-reorder { display:flex; flex-direction:column; }
.vb-reorder button { width:36px; height:28px; }
.vb-reorder button:first-child .ic { transform:rotate(180deg); }
.vb-reorder .ic { width:13px; height:13px; }
.vb-reorder button:disabled { opacity:.3; cursor:default; }
.vb-save { margin-top:20px; padding-top:16px; border-top:1px solid var(--line); }
.vb-save p { margin:0 0 12px; font-size:12px; color:var(--text-2); line-height:1.5; }
.vb-save .btn { width:100%; min-height:44px; gap:8px; }
.vb-clear { display:block; min-height:36px; margin:12px auto 0; }
.vb-mobile-toggle { display:none; }
.vb-mobile-dock { display:none; }
.vb-pool { min-width:0; scroll-margin-top:96px; }
.vb-pool-heading .btn { gap:8px; min-height:40px; }
.vb-numbers { display:grid; grid-template-columns:repeat(auto-fit,minmax(40px,1fr)); gap:6px; padding:16px 0 20px; border-top:1px solid var(--line); }
.vb-numbers button { position:relative; display:grid; place-items:center; min-height:40px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--text); font:inherit; font-size:13px; font-variant-numeric:tabular-nums; cursor:pointer; }
.vb-numbers button:hover { border-color:var(--accent); }
.vb-numbers button.is-filled { background:var(--accent-soft); border-color:var(--accent); color:var(--accent); }
.vb-numbers button.is-active { background:var(--accent); border-color:var(--accent); color:var(--surface); font-weight:650; }
.vb-number-dot { position:absolute; bottom:4px; width:3px; height:3px; border-radius:50%; background:currentColor; }
.vb-filters { display:grid; grid-template-columns:minmax(0,1fr) minmax(150px,.62fr); gap:10px; }
.vb-extra-filters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:10px; }
.vb-extra-filters .ms-field { width:100%; min-height:44px; }
.vb-filter-options { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:8px; font-size:12px; }
.vb-filter-options .check-row { min-height:44px; }
.vb-search { position:relative; min-width:0; }
.vb-search > .ic { position:absolute; top:14px; left:12px; width:16px; height:16px; color:var(--text-2); pointer-events:none; }
body .variant-builder .vb-search input.input { padding-left:38px; }
.vb-results-heading { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-top:24px; padding-bottom:12px; border-bottom:1px solid var(--line); font-size:13px; color:var(--text-2); }
.vb-results-heading > span:first-child { color:var(--text); font-weight:650; }
.vb-candidate { padding:20px 0; border-bottom:1px solid var(--line); }
.vb-task-heading { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; font-size:13px; }
.vb-task-heading > .mono { color:var(--text-2); }
.vb-chosen-label { display:inline-flex; align-items:center; gap:5px; margin-left:auto; color:var(--text-2); font-size:12px; }
.vb-chosen-label .ic { width:14px; height:14px; }
.vb-source { margin:8px 0 12px; color:var(--text-2); font-size:12px; line-height:1.5; }
.vb-condition { max-height:420px; overflow:auto; margin:14px 0 18px; font-size:14px; line-height:1.6; overflow-wrap:anywhere; scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
.vb-condition.is-clamped { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; max-height:7em; }
.vb-condition > :first-child { margin-top:0; }
.vb-condition > :last-child { margin-bottom:0; }
.vb-condition table { display:block; max-width:100%; overflow:auto; }
.vb-condition img { max-width:100%; height:auto; }
.vb-condition pre { max-width:100%; overflow:auto; }
.vb-candidate-actions { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.vb-candidate-actions .btn { min-height:40px; gap:6px; }
.vb-preview-toggle { min-height:40px; text-align:left; font-size:12px; }
.vb-loading, .vb-empty-results { min-height:220px; padding:48px 24px; text-align:center; color:var(--text-2); font-size:14px; }
.vb-empty-results h4 { margin:0 0 12px; color:var(--text); font-size:16px; }
.vb-empty-results p { max-width:42ch; margin:0 auto 20px; }
.vb-error, .vb-replacement { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; background:var(--accent-soft); border-radius:8px; font-size:13px; margin-top:16px; }
.vb-error { color:var(--err); }
.vb-error button, .vb-replacement button { flex-shrink:0; min-height:36px; }
.vb-pagination { display:flex; align-items:center; justify-content:space-between; padding:20px 0; gap:16px; font-size:13px; font-variant-numeric:tabular-nums; }
.variant-builder :is(button,input,select):focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.variant-builder button:disabled { cursor:default; }
.vb-fallback { border-top:1px solid var(--line); padding:24px 0; }
.vb-fallback form { display:flex; flex-direction:column; gap:16px; max-width:600px; }
@media(max-width:1100px) { .vb-workspace { gap:20px; grid-template-columns:minmax(260px,.8fr) minmax(0,1.5fr); } .vb-composition { padding:16px; } }
@media(max-width:900px) {
 .vb-mobile-dock { position:sticky; bottom:12px; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); font-size:13px; }
 .vb-mobile-dock .btn { min-height:44px; gap:8px; }
 .vb-workspace { grid-template-columns:minmax(0,1fr); gap:28px; }
 .vb-composition { position:static; }
 .vb-intro { gap:16px; align-items:flex-start; }
 .vb-intro h2 { font-size:22px; }
 .vb-coverage { font-size:12px; white-space:nowrap; padding-top:4px; }
 .vb-coverage strong { font-size:20px; }
 .vb-mobile-toggle { display:flex; gap:6px; margin-left:auto; }
 .vb-composition:not(.is-open) :is(.vb-selected,.vb-save,.vb-clear) { display:none; }
 .vb-selected-list { max-height:320px; }
 .vb-empty-composition { min-height:140px; }
 .vb-title { margin-bottom:16px; }
 .vb-composition-heading { margin-bottom:0; }
 .vb-composition.is-open .vb-composition-heading { margin-bottom:12px; }
 .vb-save { margin-top:16px; }
 .vb-clear { margin-bottom:0; }
 .vb-icon-button { min-width:44px; min-height:44px; }
 .vb-reorder { flex-direction:row; }
 .vb-reorder button { width:44px; height:44px; }
 .vb-numbers { grid-template-columns:repeat(auto-fit,minmax(42px,1fr)); }
 .vb-numbers button { min-height:44px; }
 .vb-pool-heading .btn, .vb-candidate-actions .btn, .vb-preview-toggle { min-height:44px; }
 .variant-builder button.link { min-height:44px; }
}
@media(max-width:480px) {
 .vb-intro { flex-direction:column; gap:12px; }
 .vb-intro p { font-size:13px; }
 .vb-filters { grid-template-columns:minmax(0,1fr); }
 .vb-extra-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .vb-extra-filters>.multiselect:last-child { grid-column:1/-1; }
 .vb-pool-heading { align-items:flex-start; }
 .vb-pool-heading h3 { padding-top:12px; }
 .vb-pool-heading .btn { max-width:205px; }
 .vb-composition { padding:16px; }
 .vb-sort { display:none; }
 .vb-selected-list li { gap:6px; }
 .vb-selected-list li>.ic { display:none; }
 .vb-row-actions .vb-icon-button { min-width:40px; }
 .vb-selected-list li { flex-wrap:wrap; }
 .vb-reorder { margin-left:auto; }
 .vb-replacement, .vb-error { flex-wrap:wrap; }
}
