.customer-segment-panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--card-bg);
}

.customer-segment-panel .customer-segments-heading { margin-bottom: 13px; align-items: flex-start; }
.customer-segment-panel .customer-segments-heading h2 { display: flex; align-items: baseline; gap: 7px; margin: 0 0 3px; font-size: 16px; font-weight: var(--admin-weight-semibold); }
.customer-segments-heading h2 > span { color: var(--text-secondary); font-size: 12px; font-weight: var(--admin-weight-regular); }
.customer-segment-caption { color: var(--text-secondary); font-size: 12px; }
.customer-segment-heading-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.customer-segment-all, .customer-segment-manage {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px;
  border: 0; border-radius: 7px; padding: 5px 8px; background: transparent; color: var(--text-secondary); font-size: 12px;
}
.customer-segment-all[aria-pressed="true"] { background: #e9edf2; color: var(--text-primary); }
.customer-segment-all:hover, .customer-segment-manage:hover { background: var(--control-bg); color: var(--text-primary); }
.customer-segment-panel .customer-segment-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px;
  align-content: start; max-block-size: none; overflow: visible; padding: 0;
}
.customer-segment-panel .customer-segment-option {
  display: grid; align-content: space-between; gap: 9px; min-width: 0; min-height: 104px; padding: 12px;
  border: 1px solid var(--border); border-radius: 9px; background: #fff;
  text-align: start; color: var(--text-primary); transition: border-color .15s, background-color .15s;
}
.customer-segment-option__name { display: flex; justify-content: space-between; align-items: flex-start; gap: 7px; min-width: 0; font-size: 13px; font-weight: var(--admin-weight-medium); line-height: 1.35; overflow-wrap: anywhere; }
.customer-segment-option__selected { flex: 0 0 auto; opacity: 0; transform: scale(.7); color: #b95e1b; transition: opacity .15s ease, transform .15s ease; }
.customer-segment-option[aria-pressed="true"] .customer-segment-option__selected { opacity: 1; transform: scale(1); }
.customer-segment-option__count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 8px; }
.customer-segment-option__count strong { font-size: 22px; line-height: 1.1; font-weight: var(--admin-weight-semibold); font-variant-numeric: tabular-nums; }
.customer-segment-option__count small { margin-inline-start: auto; color: var(--text-secondary); font-size: 11px; font-weight: var(--admin-weight-regular); font-variant-numeric: tabular-nums; }
.customer-segment-option progress { display: block; width: 100%; height: 3px; border: 0; border-radius: 999px; overflow: hidden; background: #edf0f4; }
.customer-segment-option progress::-webkit-progress-bar { border-radius: inherit; background: #edf0f4; }
.customer-segment-option progress::-webkit-progress-value { border-radius: inherit; background: #c5ccd7; }
.customer-segment-option progress::-moz-progress-bar { border-radius: inherit; background: #c5ccd7; }
.customer-segment-panel .customer-segment-option:hover { border-color: #c7cfdb; background: #fafbfc; }
.customer-segment-panel .customer-segment-option[aria-pressed="true"] { background: #fff6ee; border-color: #eec5a5; color: var(--text-primary); }
.customer-segment-option[aria-pressed="true"] progress::-webkit-progress-value { background: var(--platform-orange); }
.customer-segment-option[aria-pressed="true"] progress::-moz-progress-bar { background: var(--platform-orange); }
.customer-segment-panel:has(.customer-segment-browser:not([open])) .customer-segment-option[data-customer-segment-extra]:not([aria-pressed="true"]) { display: none; }
.customer-segment-panel .customer-segment-option[hidden], .customer-segment-empty-search[hidden] { display: none; }
.customer-segment-browser { margin: -2px 0 12px; }
.customer-segment-browser > summary { display: inline-flex; align-items: center; gap: 6px; padding: 3px 0; list-style: none; color: var(--text-secondary); font-size: 12px; cursor: pointer; }
.customer-segment-browser > summary::-webkit-details-marker { display: none; }
.customer-segment-browser > summary > i { font-size: 10px; transition: transform .2s ease; }
.customer-segment-browser[open] > summary > i { transform: rotate(180deg); }
.customer-segment-browser__less, .customer-segment-browser[open] .customer-segment-browser__more { display: none; }
.customer-segment-browser[open] .customer-segment-browser__less { display: inline; }
.customer-segment-search { display: block; position: relative; width: min(100%, 300px); margin-top: 8px; }
.customer-segment-search > i { position: absolute; inset-inline-start: 10px; top: 11px; color: var(--text-secondary); font-size: 12px; }
.customer-segment-search .form-control { padding-inline-start: 30px; min-height: 36px; font-size: 13px; }
.customer-segment-browser[open] .customer-segment-search { animation: customer-segment-search-enter .18s ease-out; }
@keyframes customer-segment-search-enter { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
.customer-segment-empty-search { padding: 14px 0 5px; color: var(--text-secondary); font-size: 13px; }
.customer-segment-panel :is(button,summary,input):focus-visible { outline: 1px solid var(--admin-field-focus); outline-offset: 2px; }
.customer-segment-browser--mobile { display: none; }
@media (max-width: 1000px) {
  .customer-segment-panel .customer-segment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .customer-segment-panel { padding: 14px; }
  .customer-segment-panel .customer-segments-heading { flex-wrap: wrap; gap: 8px; }
  .customer-segment-panel .customer-segment-grid { grid-template-columns: minmax(0, 1fr); }
  .customer-segment-panel .customer-segment-option { min-height: 86px; padding: 11px 12px; gap: 7px; }
  .customer-segment-browser--mobile { display: block; }
  .customer-segment-panel:has(.customer-segment-browser:not([open])) .customer-segment-option[data-customer-segment-mobile-extra]:not([aria-pressed="true"]) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .customer-segment-panel .customer-segment-option { transition: none; } }
