.v2-reference-explorer,.v2-reference-explorer form,.v2-reference-explorer [data-ref-results] { min-width:0; max-width:100%; }
.v2-reference-filter-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; align-items:end; }
.v2-reference-selector { position:relative; min-width:0; margin:0; }
.v2-reference-selector>summary { display:flex; flex-direction:column; gap:8px; cursor:pointer; list-style:none; font-size:var(--v2-font-size-label,14px); font-weight:600; }
.v2-reference-selector>summary::-webkit-details-marker { display:none; }
.v2-reference-selector>summary>[data-ref-selected] { position:relative; display:block; min-height:44px; padding:11px 36px 11px 12px; border:1px solid var(--v2-border); border-radius:var(--v2-radius-control); background:var(--v2-surface,#fff); font-weight:400; overflow-wrap:anywhere; }
.v2-reference-selector>summary>[data-ref-selected]::after { content:'▾'; position:absolute; top:11px; right:12px; }
.v2-reference-selector[open]>summary>[data-ref-selected]::after { content:'▴'; }
.v2-reference-selector>summary:focus-visible { outline:3px solid var(--v2-focus,#2563eb); outline-offset:3px; border-radius:var(--v2-radius-control); }
.v2-reference-menu { position:absolute; z-index:25; top:calc(100% + 6px); left:0; width:max(100%,280px); max-width:min(420px,calc(100vw - 32px)); padding:12px; background:var(--v2-surface,#fff); border:1px solid var(--v2-border); border-radius:var(--v2-radius-control); box-shadow:0 8px 24px #0b213321; }
.v2-reference-filter-grid>.v2-reference-selector:last-child .v2-reference-menu { left:auto; right:0; }
.v2-reference-search-label { display:grid; gap:6px; font-size:14px; }
.v2-reference-choice-actions { display:flex; gap:8px; margin:8px 0; }
.v2-reference-choice-actions .v2-button { min-height:36px; padding:6px 10px; font-size:14px; }
.v2-reference-choices { max-height:260px; overflow:auto; overscroll-behavior:contain; }
.v2-reference-choice { display:flex; align-items:flex-start; gap:10px; min-height:44px; padding:10px 6px; cursor:pointer; overflow-wrap:anywhere; }
.v2-reference-choice input { flex:0 0 auto; width:18px; height:18px; margin:2px 0 0; }
.v2-reference-choice span { min-width:0; }
.v2-reference-explorer [hidden] { display:none!important; }
.v2-reference-advanced { margin:16px 0; }
.v2-reference-advanced>summary { min-height:44px; padding:12px 0; cursor:pointer; }
.v2-reference-advanced>summary>span { margin-left:12px; color:var(--v2-text-muted); font-size:14px; }
.v2-reference-attribute-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr)); gap:16px; padding-top:16px; align-items:start; }
.v2-reference-value { position:relative; min-width:0; }
.v2-reference-value>summary { display:flex; flex-direction:column; gap:8px; min-height:44px; cursor:pointer; list-style:none; font-size:14px; font-weight:600; overflow-wrap:anywhere; }
.v2-reference-value>summary::-webkit-details-marker { display:none; }
.v2-reference-value>summary>span { margin-left:0; }
.v2-reference-value>summary>[data-ref-value-count] { position:relative; min-height:44px; padding:11px 32px 11px 12px; border:1px solid var(--v2-border); border-radius:var(--v2-radius-control); background:var(--v2-surface,#fff); font-weight:400; }
.v2-reference-value>summary>[data-ref-value-count]::after { content:'▾'; position:absolute; top:11px; right:12px; }
.v2-reference-value[open]>summary>[data-ref-value-count]::after { content:'▴'; }
.v2-reference-value>summary:focus-visible { outline:3px solid var(--v2-focus,#2563eb); outline-offset:3px; border-radius:var(--v2-radius-control); }
.v2-reference-value .v2-reference-menu { width:100%; max-width:100%; }
.v2-reference-value .v2-reference-choices { max-height:220px; margin-top:8px; }
.v2-reference-conditions { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.v2-reference-table-scroll { width:100%; max-width:100%; min-width:0; max-height:65vh; overflow:auto; overscroll-behavior:contain; border:1px solid var(--v2-border); border-radius:var(--v2-radius-control); margin:12px 0; }
.v2-reference-table { width:max-content; min-width:100%; border-collapse:separate; border-spacing:0; text-align:left; font-size:14px; }
.v2-reference-table th,.v2-reference-table td { min-width:140px; max-width:260px; padding:12px; border-bottom:1px solid var(--v2-border); vertical-align:top; overflow-wrap:anywhere; }
.v2-reference-table th { position:sticky; top:0; z-index:1; background:var(--v2-surface,#fff); }
.v2-reference-table th:first-child,.v2-reference-table td:first-child { min-width:90px; }
.v2-reference-pagination { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin:16px 0; }
.v2-reference-pagination>div { display:flex; flex-wrap:wrap; gap:8px; }
.v2-reference-selection { padding:16px; margin:16px 0; background:var(--v2-surface,#fff); border:1px solid var(--v2-border); border-radius:var(--v2-radius-control); }
.v2-reference-selection>p:first-child { margin-top:0; font-weight:600; }
.v2-reference-selection .v2-workspace-hint { margin-bottom:0; }
.v2-reference-selectable .v2-reference-select-cell { position:sticky; left:0; min-width:72px; max-width:72px; background:var(--v2-surface,#fff); text-align:center; z-index:2; border-right:1px solid var(--v2-border); }
.v2-reference-selectable thead .v2-reference-select-cell { z-index:3; }
.v2-reference-select-cell label { display:flex; flex-direction:column; align-items:center; gap:6px; }
.v2-reference-select-cell input { width:20px; height:20px; margin:0; cursor:pointer; }
.v2-reference-add-dialog { width:min(960px,calc(100vw - 32px)); max-width:calc(100vw - 32px); max-height:calc(100dvh - 32px); padding:0; border:1px solid var(--v2-border); border-radius:12px; color:var(--v2-text,#18324b); background:var(--v2-surface,#fff); box-shadow:0 16px 60px #0b213340; overscroll-behavior:contain; }
.v2-reference-add-dialog::backdrop { background:#10263d80; }
.v2-reference-add-dialog-body { min-width:0; padding:24px; overflow-wrap:anywhere; }
.v2-reference-add-dialog header { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.v2-reference-add-dialog h2 { margin:0; font-size:22px; }
.v2-reference-add-dialog h3 { font-size:18px; }
.v2-reference-product-search { display:flex; align-items:center; gap:12px; margin:8px 0 16px; }
.v2-reference-product-search input { flex:1; min-width:0; }
.v2-reference-product-options { margin:0; padding:0; border:0; min-width:0; max-height:32vh; overflow:auto; overscroll-behavior:contain; }
.v2-reference-product-options legend { margin-bottom:8px; font-weight:600; }
.v2-reference-product-choice { display:flex; gap:12px; padding:12px 8px; border-bottom:1px solid var(--v2-border); cursor:pointer; min-height:56px; }
.v2-reference-product-choice input { flex:0 0 auto; width:20px; height:20px; margin:3px 0 0; }
.v2-reference-product-choice>span { display:grid; gap:6px; min-width:0; }
.v2-reference-product-choice>span>span { color:var(--v2-text-muted); font-size:14px; }
.v2-reference-add-dialog .v2-reference-table-scroll { max-height:34vh; }
.v2-reference-preview-counts { font-weight:600; }
.v2-reference-add-receipt { padding:16px; margin:16px 0; background:var(--v2-surface,#fff); border:1px solid var(--v2-border); border-radius:var(--v2-radius-control); }
.v2-reference-add-receipt h3 { margin-top:0; }
.v2-reference-failures { margin-top:16px; }
.v2-reference-failures summary { cursor:pointer; min-height:44px; padding:10px 0; }
.v2-reference-failures ul { padding-left:24px; }
.v2-reference-failures li { padding:8px 0; }
.v2-reference-failures dl { display:grid; grid-template-columns:minmax(100px,1fr) minmax(0,2fr); gap:8px 12px; }
.v2-reference-failures dd { margin:0; overflow-wrap:anywhere; }
@media (max-width:1000px) { .v2-reference-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:600px) { .v2-reference-filter-grid { grid-template-columns:minmax(0,1fr); } .v2-reference-menu,.v2-reference-filter-grid>.v2-reference-selector:last-child .v2-reference-menu { width:100%; max-width:100%; left:0; right:auto; } .v2-reference-table-scroll { max-height:60vh; } .v2-reference-table th,.v2-reference-table td { padding:10px; } }
@media (max-width:600px) { .v2-reference-add-dialog { width:calc(100vw - 16px); max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); } .v2-reference-add-dialog-body { padding:16px; } .v2-reference-add-dialog h2 { font-size:19px; } .v2-reference-product-search { flex-wrap:wrap; } .v2-reference-product-search input { flex-basis:100%; } .v2-reference-selection .v2-catalog-actions,.v2-reference-add-dialog .v2-catalog-actions { align-items:stretch; } .v2-reference-add-dialog .v2-button { white-space:normal; } }
