/* BTD List Builder v4 — Frontend */
:root {
  --blue:       #1a6fc4;
  --blue-dark:  #145da0;
  --blue-light: #e8f2fc;
  --green:      #16a34a;
  --green-dark: #15803d;
  --red:        #dc2626;
  --orange:     #e05a2b;
  --border:     #e2e6ea;
  --radius:     8px;
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-400:   #9ca3af;
  --gray-500:   #6b7280;
  --gray-700:   #374151;
  --gray-900:   #111827;
}

.btd-builder * { box-sizing: border-box; }
.btd-builder {
  max-width: 1120px;
  margin: 0 auto;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--gray-900);
}

/* Theme reset — prevent WP/WooCommerce/Elementor overrides */
.btd-builder button,
.btd-builder input,
.btd-builder select,
.btd-builder textarea {
  all: unset;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 13px;
  color: var(--gray-900);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.btd-builder select { display: block; cursor: default; }
.btd-builder input[type="text"],
.btd-builder input[type="number"] { cursor: text; }
.btd-builder input[type="range"]  { cursor: pointer; }
.btd-builder input[type="radio"],
.btd-builder input[type="checkbox"] {
  cursor: pointer; width: auto; height: auto;
  display: inline-block; accent-color: var(--blue);
}
.btd-builder a { text-decoration: none; }
.btd-builder ::-webkit-scrollbar { width: 6px; height: 6px; }
.btd-builder ::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }

/* ── STEPS ── */
.btd-steps {
  display: flex; gap: 0; margin-bottom: 20px;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.btd-step {
  flex: 1; display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 20px; border-right: 1px solid var(--border);
}
.btd-step:last-child { border-right: none; }
.btd-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--orange); color: #fff;
  font-weight: 800; font-size: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.btd-step strong { display: block; font-size: 13px; margin-bottom: 3px; }
.btd-step p { font-size: 12px; color: var(--gray-500); margin: 0; line-height: 1.4; }

/* ── TOP ACTION BAR ── */
.btd-top-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px;
  margin-bottom: 16px;
}
.btd-top-bar-left {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.btd-top-bar-right {
  display: flex; align-items: center; gap: 14px;
}
.btd-top-count {
  font-size: 18px; font-weight: 800; color: var(--orange);
  white-space: nowrap; margin-right: 6px;
}
.btd-top-count-muted { color: var(--gray-400); }
.btd-top-price {
  font-size: 22px; font-weight: 800; color: var(--gray-900);
  white-space: nowrap;
}
.btd-top-price-muted { color: var(--gray-400); }

/* ── BUTTONS ── */
.btd-btn {
  padding: 8px 16px !important; border-radius: 6px !important;
  font-size: 13px !important; font-weight: 600 !important;
  cursor: pointer; border: 1.5px solid transparent !important;
  transition: .13s; line-height: 1.4 !important;
  text-align: center; white-space: nowrap;
}
.btd-btn-primary {
  background: var(--blue) !important; color: #fff !important;
  border-color: var(--blue) !important;
}
.btd-btn-primary:hover { background: var(--blue-dark) !important; }

.btd-btn-outline {
  background: #fff !important; color: var(--gray-700) !important;
  border-color: var(--border) !important;
}
.btd-btn-outline:hover { background: var(--gray-50) !important; border-color: var(--gray-400) !important; }
.btd-btn-outline:disabled { opacity: .45 !important; pointer-events: none; }

.btd-btn-secondary {
  background: #fff !important; color: var(--gray-700) !important;
  border-color: var(--border) !important;
}
.btd-btn-secondary:hover { background: var(--gray-50) !important; }

.btd-btn-ghost {
  background: none !important; color: var(--gray-400) !important;
  border: none !important; padding: 3px 0 !important;
  font-size: 12px !important;
}
.btd-btn-ghost:hover { color: var(--red) !important; }

/* Buy button — orange like reference */
.btd-btn-buy {
  background: var(--orange) !important; color: #fff !important;
  border: none !important; font-size: 14px !important;
  font-weight: 700 !important; padding: 10px 22px !important;
  border-radius: var(--radius) !important; transition: .13s;
  justify-content: center;
}
.btd-btn-buy:hover { background: #c44d22 !important; }
.btd-btn-buy:disabled { opacity: .5 !important; cursor: not-allowed !important; pointer-events: none; }

/* Set button */
.btd-btn-set {
  background: var(--orange) !important; color: #fff !important;
  border: none !important; font-size: 14px !important;
  font-weight: 700 !important; width: 100% !important;
  padding: 12px !important; border-radius: var(--radius) !important;
  justify-content: center; margin-top: 8px;
}
.btd-btn-set:hover { background: #c44d22 !important; }
.btd-btn-set:disabled { opacity: .5 !important; cursor: not-allowed !important; pointer-events: none; }

/* ── VALUE PROPS ROW (4-up) ── */
.btd-vp-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 16px;
}
@media (max-width: 860px) { .btd-vp-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .btd-vp-row { grid-template-columns: 1fr; } }

.btd-vp-card {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; gap: 12px; align-items: flex-start;
}
.btd-vp-check {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--orange); color: var(--orange);
  font-weight: 800; font-size: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.btd-vp-card strong { display: block; font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.btd-vp-card p { font-size: 12px; color: var(--gray-500); margin: 0; line-height: 1.4; }

/* ── ADJUST YOUR CONTACTS / BUDGET ── */
.btd-section {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px;
}
.btd-section-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 18px;
}
.btd-section-title {
  font-size: 15px; font-weight: 800; margin: 0;
  text-transform: uppercase; letter-spacing: .04em;
}

.btd-adjust-section { padding: 22px 24px; }
.btd-adjust-layout {
  display: flex; gap: 32px; align-items: flex-start;
}
@media (max-width: 640px) { .btd-adjust-layout { flex-direction: column; } }

.btd-adjust-left { flex: 1; min-width: 0; }
.btd-adjust-title {
  font-size: 14px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; margin: 0 0 6px;
}
.btd-adjust-sub {
  font-size: 13px; color: var(--gray-500); margin: 0 0 16px; line-height: 1.5;
}

/* Slider */
.btd-slider-wrap { }
.btd-slider {
  width: 100% !important; height: 6px !important;
  -webkit-appearance: none !important; appearance: none !important;
  background: var(--gray-200) !important; border-radius: 3px !important;
  outline: none; display: block !important;
}
.btd-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px;
  background: var(--orange); border-radius: 50%; cursor: pointer;
  box-shadow: 0 1px 4px rgba(224,90,43,.4);
}
.btd-slider::-moz-range-thumb {
  width: 22px; height: 22px; background: var(--orange);
  border-radius: 50%; cursor: pointer; border: none;
}
/* Fill track up to thumb in orange */
.btd-slider { accent-color: var(--orange); }
.btd-slider:disabled { opacity: .45 !important; cursor: not-allowed !important; }
.btd-slider:disabled::-webkit-slider-thumb { background: var(--gray-400); cursor: not-allowed; }

.btd-slider-hint {
  font-size: 12px; color: var(--gray-400); margin: 8px 0 0; font-style: italic;
}

/* Right side: qty input + set button */
.btd-adjust-right {
  width: 200px; flex-shrink: 0;
  display: flex; flex-direction: column;
}
@media (max-width: 640px) { .btd-adjust-right { width: 100%; } }

.btd-adjust-count-label {
  font-size: 12px; font-weight: 600; color: var(--gray-500);
  margin-bottom: 6px; display: block;
}
.btd-qty-input-lg {
  width: 100% !important; padding: 10px 14px !important;
  border: 1.5px solid var(--border) !important; border-radius: var(--radius) !important;
  font-size: 18px !important; font-weight: 700 !important;
  text-align: center; background: #fff !important; cursor: text !important;
  display: block !important;
}
.btd-qty-input-lg:focus { border-color: var(--orange) !important; outline: none; }
.btd-qty-input-lg:disabled { opacity: .45 !important; cursor: not-allowed !important; }

/* ── CART MESSAGE ── */
.btd-cart-msg {
  margin: 12px 0; padding: 10px 14px; border-radius: 6px;
  font-size: 13px; background: #f0fdf4; color: #166534; border: 1px solid #86efac;
}
.btd-cart-msg.btd-error { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }

/* ── TWO-COLUMN LAYOUT ── */
.btd-layout {
  display: grid; grid-template-columns: 1fr 300px;
  gap: 20px; align-items: start;
}
@media (max-width: 860px) { .btd-layout { grid-template-columns: 1fr; } }
.btd-layout-results { position: sticky; top: 20px; }

/* ── ACCORDION FILTERS ── */
.btd-filters-accordion {
  border: 1.5px solid var(--border); border-radius: 6px; overflow: hidden;
}
.btd-accordion-item { border-bottom: 1px solid var(--border); }
.btd-accordion-item:last-child { border-bottom: none; }
.btd-accordion-trigger {
  width: 100% !important; display: flex !important; align-items: center; gap: 8px;
  padding: 12px 16px !important; background: #fff !important;
  border: none !important; cursor: pointer; text-align: left;
  font-size: 13px !important; font-weight: 600 !important;
  color: var(--gray-700) !important; transition: .12s;
}
.btd-accordion-trigger:hover { background: var(--gray-50) !important; }
.btd-acc-open .btd-accordion-trigger { background: var(--blue-light) !important; color: var(--blue) !important; }
.btd-acc-has-selection .btd-accordion-trigger { background: #f0fdf4 !important; }
.btd-accordion-label { flex: 1; }
.btd-accordion-badge {
  background: var(--blue) !important; color: #fff !important;
  font-size: 11px !important; font-weight: 800 !important;
  border-radius: 20px !important; padding: 1px 7px !important;
  line-height: 1.6 !important;
}
.btd-acc-has-selection .btd-accordion-badge { background: var(--green) !important; }
.btd-accordion-arrow { font-size: 11px; color: var(--gray-400); transition: transform .2s; }
.btd-acc-open .btd-accordion-arrow { transform: rotate(180deg); }

.btd-accordion-inner {
  padding: 12px 16px 14px; background: var(--gray-50);
  border-top: 1px solid var(--border);
}
.btd-acc-sub { font-size: 13px; font-weight: 600; margin: 0 0 2px; color: var(--gray-700); }
.btd-acc-hint { font-size: 12px; color: var(--gray-400); margin: 0 0 10px; }

.btd-include-exclude { display: flex; gap: 16px; margin-bottom: 8px; font-size: 13px; }
.btd-include-exclude label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.btd-selected-header {
  font-size: 11px; font-weight: 700; color: var(--gray-400);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px;
}
.btd-selected-tags { display: flex; flex-wrap: wrap; gap: 5px; min-height: 20px; margin-bottom: 8px; }
.btd-tag {
  background: var(--blue-light); color: var(--blue-dark);
  border: 1px solid #bfdbfe; border-radius: 20px;
  padding: 3px 10px; font-size: 12px; display: flex; align-items: center; gap: 5px;
}
.btd-tag-remove { cursor: pointer; color: var(--gray-400); font-size: 14px; font-weight: 800; line-height: 1; }
.btd-tag-remove:hover { color: var(--red); }

/* ── PHONE TOGGLE ── */
.btd-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.btd-toggle-track {
  width: 38px; height: 22px; background: var(--gray-200);
  border-radius: 11px; position: relative; transition: .2s; flex-shrink: 0;
}
.btd-toggle-track::after {
  content: ''; position: absolute; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; top: 2px; left: 2px;
  transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.btd-toggle input:checked + .btd-toggle-track { background: var(--blue); }
.btd-toggle input:checked + .btd-toggle-track::after { transform: translateX(16px); }
.btd-toggle input { display: none; }

/* ── RIGHT COLUMN ── */
.btd-results-placeholder,
.btd-results-panel {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.btd-placeholder-inner { text-align: center; }
.btd-placeholder-inner h3 {
  font-size: 15px; font-weight: 800; margin: 0 0 14px;
  text-transform: uppercase;
}
.btd-placeholder-hint { font-size: 13px; color: var(--gray-500); margin: 12px 0 0; line-height: 1.6; text-align: left; }
.btd-placeholder-cta { display: inline-block; margin-top: 14px; }

.btd-results-header { margin-bottom: 16px; }
.btd-results-header h3 { font-size: 14px; font-weight: 800; text-transform: uppercase; margin: 0 0 4px; }
.btd-results-header p { font-size: 12px; color: var(--gray-500); margin: 0; }
.btd-value-props { display: flex; flex-direction: column; gap: 8px; }
.btd-value-prop { font-size: 13px; color: var(--gray-700); display: flex; align-items: flex-start; gap: 7px; }
.btd-vp-icon { color: var(--green); font-weight: 800; font-size: 14px; line-height: 1.4; }

/* ── LOADING ── */
.btd-apply-loader {
  display: none; text-align: center; padding: 16px;
  color: var(--gray-500); font-size: 13px;
}
.btd-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--gray-200); border-top-color: var(--blue);
  border-radius: 50%; animation: btd-spin .6s linear infinite;
  margin-right: 6px; vertical-align: middle;
}
@keyframes btd-spin { to { transform: rotate(360deg); } }

.btd-no-results {
  text-align: center; padding: 24px; color: var(--gray-500);
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius); margin-top: 12px;
}

/* ── PREVIEW TABLE ── */
.btd-preview-title { font-size: 13px; font-weight: 700; margin: 0 0 10px; color: var(--gray-700); }
.btd-table-wrap { overflow-x: auto; }
.btd-preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.btd-preview-table th {
  background: var(--blue); color: #fff; padding: 8px 10px;
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; white-space: nowrap;
}
.btd-preview-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); color: var(--gray-700); }
.btd-preview-table tr:last-child td { border-bottom: none; }
.btd-preview-table tr:hover td { background: var(--gray-50); }
.btd-empty { text-align: center; color: var(--gray-400); padding: 24px !important; font-style: italic; }

/* ── MODAL ── */
.btd-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
}
.btd-modal-inner {
  background: #fff; border-radius: 10px; padding: 28px;
  width: 100%; max-width: 400px; box-shadow: 0 8px 40px rgba(0,0,0,.18);
}
.btd-modal-inner h3 { margin: 0 0 16px; font-size: 17px; font-weight: 700; }
.btd-input {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: 6px; font-size: 14px; margin-bottom: 14px; outline: none;
  display: block;
}
.btd-input:focus { border-color: var(--blue); }
.btd-modal-actions { display: flex; gap: 8px; }
.btd-save-msg { margin-top: 10px; font-size: 13px; color: var(--green); }

/* ── LOADING STATE ── */
.btd-loading { opacity: .55; pointer-events: none; }

/* ── STEPS RESPONSIVE ── */
@media (max-width: 640px) {
  .btd-steps { flex-direction: column; }
  .btd-step { border-right: none; border-bottom: 1px solid var(--border); }
  .btd-step:last-child { border-bottom: none; }
  .btd-top-bar { flex-direction: column; align-items: flex-start; }
  .btd-top-bar-right { width: 100%; justify-content: space-between; }
}

/* ── CUSTOM MULTI-SELECT DROPDOWN ── */
.btd-custom-select-wrap { position: relative; margin-bottom: 8px; }

.btd-custom-select-trigger {
  width: 100%; min-height: 38px;
  border: 1.5px solid var(--border); border-radius: 5px;
  background: #fff; padding: 6px 32px 6px 10px;
  font-size: 13px; color: var(--gray-500); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; text-align: left; position: relative; transition: border-color .15s;
  box-sizing: border-box;
}
.btd-custom-select-trigger:hover { border-color: var(--blue); }
.btd-custom-select-trigger.btd-csel-open {
  border-color: var(--blue);
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}
.btd-csel-arrow {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--gray-400); pointer-events: none; transition: transform .2s;
}
.btd-custom-select-trigger.btd-csel-open .btd-csel-arrow { transform: translateY(-50%) rotate(180deg); }

.btd-custom-select-dropdown {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border: 1.5px solid var(--blue);
  border-top: none; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px;
  z-index: 9999; max-height: 220px; overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.btd-custom-select-dropdown.btd-csel-visible { display: block; }

.btd-csel-search {
  width: 100%; padding: 7px 10px; border: none;
  border-bottom: 1px solid var(--border); font-size: 13px;
  outline: none; background: var(--gray-50); box-sizing: border-box;
  color: var(--gray-900); cursor: text; display: block;
}

.btd-csel-options { list-style: none; margin: 0; padding: 4px 0; }
.btd-csel-option {
  padding: 8px 12px; font-size: 13px; color: var(--gray-700);
  cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background .1s;
}
.btd-csel-option:hover { background: var(--blue-light); }
.btd-csel-option.btd-csel-selected { background: #f0fdf4; color: var(--green); font-weight: 600; }
.btd-csel-option.btd-csel-selected::before { content: '✓'; font-size: 12px; flex-shrink: 0; }
.btd-csel-option:not(.btd-csel-selected)::before { content: ''; width: 12px; flex-shrink: 0; display: inline-block; }
.btd-csel-option.btd-csel-hidden { display: none; }
.btd-csel-empty { padding: 12px; font-size: 12px; color: var(--gray-400); font-style: italic; text-align: center; display: none; }

.btd-select.btd-multi-select { display: none !important; }

/* ══════════════════════════════════════════════
   BTD FILTER POPUP MODAL
══════════════════════════════════════════════ */
#btd-filter-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
#btd-filter-popup-overlay.btd-fp-visible {
  display: flex;
}

#btd-filter-popup {
  display: flex;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: 90vw;
  max-width: 960px;
  max-height: 85vh;
  overflow: hidden;
  animation: btdFpIn .18s ease;
}

@keyframes btdFpIn {
  from { opacity:0; transform: scale(.96) translateY(8px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}

/* ── Left panel ── */
#btd-filter-popup-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e7eb;
  min-width: 0;
}

.btd-fp-header {
  padding: 20px 22px 14px;
  border-bottom: 1px solid #f1f3f5;
}
.btd-fp-title {
  margin: 0 0 3px;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}
.btd-fp-sub {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.btd-fp-search-wrap {
  display: flex;
  align-items: center;
  margin: 12px 16px 8px;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
}
.btd-fp-search-icon { font-size: 13px; margin-right: 8px; color:#9ca3af; }
.btd-fp-search {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 9px 0;
  background: transparent;
  color: #111827;
}

.btd-fp-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  overflow-y: auto;
  flex: 1;
}

.btd-fp-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  transition: background .1s;
}
.btd-fp-option:hover { background: #f3f4f6; }
.btd-fp-option.btd-fp-hidden { display: none; }

.btd-fp-opt-checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid #d1d5db;
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  background: #fff;
}
.btd-fp-opt-checkbox.checked {
  background: #2563eb;
  border-color: #2563eb;
}
.btd-fp-opt-checkbox.checked::after {
  content: '✓';
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.btd-fp-showing {
  padding: 6px 20px;
  font-size: 12px;
  color: #9ca3af;
  border-top: 1px solid #f1f3f5;
}

.btd-fp-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}
.btd-fp-selected-count {
  font-size: 13px;
  color: #6b7280;
  margin-right: auto;
}
.btd-fp-btn-include,
.btd-fp-btn-exclude {
  padding: 9px 18px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btd-fp-btn-include:hover,
.btd-fp-btn-exclude:hover { opacity: .88; }
.btd-fp-btn-include {
  background: #16a34a;
  color: #fff;
}
.btd-fp-btn-exclude {
  background: #dc2626;
  color: #fff;
}

/* ── Right panel ── */
#btd-filter-popup-right {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.btd-fp-right-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 20px 14px;
  border-bottom: 1px solid #f1f3f5;
}
.btd-fp-right-title {
  margin: 0 0 3px;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}
.btd-fp-right-sub {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
}

.btd-fp-close {
  background: none;
  border: 1.5px solid #d1d5db;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  flex-shrink: 0;
  transition: all .15s;
}
.btd-fp-close:hover { background: #f3f4f6; border-color: #9ca3af; }

.btd-fp-selected-list {
  list-style: none;
  margin: 0;
  padding: 12px 16px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btd-fp-selected-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
}
.btd-fp-sel-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}
.btd-fp-sel-badge.include { color: #16a34a; border: 1.5px solid #16a34a; }
.btd-fp-sel-badge.exclude { color: #dc2626; border: 1.5px solid #dc2626; }

.btd-fp-sel-label {
  flex: 1;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btd-fp-sel-remove {
  background: #ef4444;
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.btd-fp-sel-remove:hover { background: #dc2626; }

.btd-fp-clear-all {
  margin: 0 16px 16px;
  padding: 8px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btd-fp-clear-all:hover { opacity: .88; }

/* ── Trigger button when value selected ── */
.btd-custom-select-trigger.btd-csel-has-value {
  border-color: #2563eb;
  color: #2563eb;
  font-weight: 600;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  #btd-filter-popup {
    flex-direction: column;
    max-height: 92vh;
    width: 96vw;
  }
  #btd-filter-popup-right {
    width: 100%;
    border-top: 1px solid #e5e7eb;
    max-height: 200px;
  }
}

/* ══════════════════════════════════════════════
   REFERENCE-STYLE PREVIEW TABLE (v6)
══════════════════════════════════════════════ */

/* Preview section header text */
.btd-preview-title {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0 0 14px;
  line-height: 1.5;
}

/* Scrollable table wrapper — max height so > 10 rows scroll */
.btd-table-scroll {
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.btd-table-scroll table {
  width: 100%;
  border-collapse: collapse;
}
.btd-table-scroll thead th {
  position: sticky;
  top: 0;
  background: var(--gray-50);
  z-index: 2;
}

/* Preview table */
.btd-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.btd-preview-table thead tr {
  background: var(--gray-50);
}
.btd-preview-table th {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gray-500);
  border-bottom: 1.5px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.btd-preview-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.btd-preview-table tbody tr:hover {
  background: var(--gray-50);
}
.btd-preview-table tbody tr:last-child td {
  border-bottom: none;
}

/* Person cell */
.btd-person-name {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 2px;
}
.btd-person-industry {
  font-size: 11px;
  color: var(--gray-500);
}

/* Job cell */
.btd-job-title {
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 2px;
}
.btd-job-level {
  font-size: 11px;
  color: var(--gray-500);
}

/* Contact info cell */
.btd-contact-email,
.btd-contact-phone {
  font-size: 12px;
  color: var(--gray-700);
  margin-bottom: 3px;
  white-space: nowrap;
}
.btd-no-phone {
  color: var(--gray-400);
}
.btd-email-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #16a34a;
  background: #dcfce7;
  border-radius: 4px;
  padding: 2px 7px;
}

/* Show More button */
.btd-btn-show-more {
  background: var(--orange) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 5px !important;
  padding: 7px 14px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  white-space: nowrap;
  transition: opacity .13s;
}
.btd-btn-show-more:hover {
  opacity: .85 !important;
}

/* ══════════════════════════════════════════════
   CONTACT DETAIL POPUP MODAL (v6)
══════════════════════════════════════════════ */

#btd-contact-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.50);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}
#btd-contact-modal {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: 90vw;
  max-width: 580px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  animation: btdModalIn .18s ease;
  overflow: hidden;
}
@keyframes btdModalIn {
  from { opacity:0; transform:scale(.95) translateY(10px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}
#btd-contact-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  background: var(--gray-900);
  color: #fff;
}
#btd-contact-modal-title {
  font-size: 16px;
  font-weight: 700;
}
#btd-contact-modal-close {
  background: none !important;
  border: 1.5px solid rgba(255,255,255,0.4) !important;
  border-radius: 50% !important;
  width: 28px !important;
  height: 28px !important;
  color: #fff !important;
  font-size: 12px !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  transition: background .13s;
}
#btd-contact-modal-close:hover {
  background: rgba(255,255,255,0.15) !important;
}
#btd-contact-modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}
.btd-modal-row {
  display: flex;
  align-items: baseline;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.btd-modal-row:last-child { border-bottom: none; }
.btd-modal-label {
  flex: 0 0 180px;
  font-size: 13px;
  color: var(--gray-500);
}
.btd-modal-val {
  flex: 1;
  font-size: 13px;
  color: var(--gray-900);
  word-break: break-word;
}
.btd-no-data {
  color: var(--gray-400);
  font-style: normal;
}

/* end of btd-list-builder.css */
