/* Segmentation panel is opt-in; it never changes the historical prospect grid. */
#sales-prospect-dashboard .segment-hidden { display: none !important; }
.segment-panel[hidden] { display: none !important; }
.segment-panel { margin: 1rem 0 1.4rem; padding: 1rem; border: 1px solid var(--border-color, #435266); border-radius: 12px; background: var(--surface, transparent); }
.segment-intro h3 { margin: 0 0 .35rem; font-size: 1.2rem; }
.segment-intro p { margin: 0 0 1rem; }
.segment-secondary { display: block; opacity: .78; font-size: .84rem; }
.segment-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.segment-field { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; min-width: 0; }
.segment-field :is(select, input) { width: 100%; min-height: 40px; padding: .45rem .55rem; color: inherit; background: var(--input-bg, var(--surface, #1b2735)); border: 1px solid var(--border-color, #607085); border-radius: 7px; font: inherit; font-weight: 400; }
.segment-field :is(select, input):focus-visible { outline: 2px solid var(--accent, #66b8f0); outline-offset: 2px; }
.segment-actions, .segment-pager { display: flex; align-items: center; justify-content: space-between; gap: .9rem; flex-wrap: wrap; margin: .65rem 0 1rem; }
.segment-status { font-size: .88rem; }
.segment-export-locked { opacity: .55; cursor: not-allowed; }
.segment-table-wrap { overflow-x: auto; max-width: 100%; }
.segment-table { border-collapse: collapse; width: 100%; min-width: 1040px; font-size: .84rem; }
.segment-table th, .segment-table td { text-align: left; border-bottom: 1px solid var(--border-color, #607085); padding: .65rem .55rem; vertical-align: top; overflow-wrap: anywhere; }
.segment-table th { white-space: nowrap; font-weight: 700; }
.segment-table td:first-child strong { display: block; }
.segment-pill { display: inline-block; border: 1px solid currentColor; border-radius: 8px; padding: .19rem .4rem; margin: .12rem; font-size: .77rem; line-height: 1.4; }
.segment-hypothesis { border-style: dashed; opacity: .85; }
.segment-evidence summary { cursor: pointer; margin-top: .25rem; text-decoration: underline; }
.segment-evidence section { margin-top: .6rem; padding: .45rem; border-left: 2px solid var(--border-color, #607085); }
.segment-evidence p { margin: .3rem 0; }
.segment-evidence code { display: block; white-space: pre-wrap; margin: .25rem 0; overflow-wrap: anywhere; }
.segment-pager { justify-content: flex-end; margin-bottom: 0; }
.segment-empty { padding: 1.5rem !important; text-align: center !important; }
@media(max-width: 640px) { .segment-panel { padding: .7rem; } .segment-actions { align-items: stretch; } .segment-export { width: 100%; text-align: center; } }

/* Lot D: accessible filters and native dropdown palettes. Chromium and Linux
   native select popups do not inherit app CSS variables into <option> reliably. */
.segment-sell-next { grid-column: 1 / -1; min-width: 0; padding: .75rem;
  margin: 0; border: 1px solid var(--border-color, #607085); border-radius: 9px; }
.segment-sell-next legend { font-size: .86rem; font-weight: 700; padding: 0 .3rem; }
.segment-sell-choices { display: flex; flex-wrap: wrap; gap: .45rem 1rem; }
.segment-sell-choice { display: inline-flex; align-items: center; gap: .4rem;
  font-size: .85rem; font-weight: 400; cursor: pointer; min-height: 30px; }
.segment-sell-choice input { width: 17px; height: 17px; accent-color: #087e9d; }
.segment-mode { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .65rem;
  font-size: .85rem; font-weight: 600; }
.segment-mode select { min-height: 38px; border-radius: 7px; padding: .3rem .55rem; }
html[data-theme="light"] #sales-prospect-dashboard .segment-panel {
  background: #fff; color: #102431; border-color: #b8c9d5; }
html[data-theme="light"] #sales-prospect-dashboard .segment-panel .segment-field :is(select,input),
html[data-theme="light"] #sales-prospect-dashboard .segment-panel .segment-mode select {
  background: #fff; color: #102431; border: 1px solid #9fb3c1;
  color-scheme: light; }
html[data-theme="light"] #sales-prospect-dashboard .segment-panel select option,
html[data-theme="light"] #sales-prospect-dashboard .segment-panel select optgroup {
  background-color: #fff; color: #102431; }
html[data-theme="light"] #sales-prospect-dashboard .segment-panel select option:checked {
  background-color: #e7f3f8; color: #102431; }
html[data-theme="dark"] #sales-prospect-dashboard .segment-panel select option,
html[data-theme="dark"] #sales-prospect-dashboard .segment-panel select optgroup {
  background-color: #172534; color: #f0f6fa; }
html[data-theme="light"] #sales-prospect-dashboard .segment-panel .segment-table th {
  background: #edf3f7; color: #102431; }
html[data-theme="light"] #sales-prospect-dashboard .segment-panel .segment-table td {
  color: #233e4e; }
html[data-theme="light"] #sales-prospect-dashboard .segment-panel .segment-sell-next {
  border-color: #b8c9d5; }
@media(max-width: 640px) { .segment-sell-choices { display: grid; gap: .5rem; } }

/* Lot E: all eight controls have one consistent compact dropdown footprint. */
#sales-prospect-dashboard .segment-filters {
  display:grid; grid-template-columns:repeat(8,minmax(0,1fr));
  gap:.6rem; overflow:visible; align-items:start;
}
#sales-prospect-dashboard .segment-field { min-width:0; position:relative; }
#sales-prospect-dashboard .segment-field-label {
  font-weight:650; min-height:19px; white-space:nowrap; font-size:.78rem;
}
#sales-prospect-dashboard .segment-field .segment-search,
#sales-prospect-dashboard .segment-facet-trigger {
  display:flex; align-items:center; justify-content:space-between; box-sizing:border-box;
  width:100%; min-height:42px; height:42px; padding:.5rem .63rem;
  border-radius:8px; border:1px solid #607085; font-size:.81rem;
  background:#172534; color:#f0f6fa; font-weight:450;
}
#sales-prospect-dashboard .segment-facet { position:relative; min-width:0; }
#sales-prospect-dashboard .segment-facet-trigger {
  cursor:pointer; list-style:none; gap:.35rem;
}
#sales-prospect-dashboard .segment-facet-trigger::-webkit-details-marker { display:none; }
#sales-prospect-dashboard .segment-facet-trigger::marker { content:''; }
#sales-prospect-dashboard .segment-facet-selected {
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
#sales-prospect-dashboard .segment-facet-chevron { flex:0 0 auto; opacity:.8; }
#sales-prospect-dashboard .segment-facet-popup {
  position:absolute; inset-inline-start:0; top:calc(100% + 5px);
  z-index:45; width:max(240px,100%); max-width:min(390px,calc(100vw - 2rem));
  padding:.4rem; border:1px solid #52677d; background:#172534; color:#f0f6fa;
  border-radius:10px; box-shadow:0 18px 38px rgba(0,0,0,.32);
}
#sales-prospect-dashboard .segment-facet-list {
  display:flex; flex-direction:column; max-height:286px; overflow:auto; gap:1px;
}
#sales-prospect-dashboard .segment-facet-option {
  display:grid; grid-template-columns:17px minmax(0,1fr) auto;
  align-items:center; gap:.6rem; min-height:35px; padding:.35rem .45rem;
  border-radius:6px; font-weight:450; font-size:.8rem; cursor:pointer;
}
#sales-prospect-dashboard .segment-facet-option:hover { background:#263c4f; }
#sales-prospect-dashboard .segment-facet-option input {
  width:16px; height:16px; margin:0; accent-color:#36b5d4;
}
#sales-prospect-dashboard .segment-facet-count {
  display:inline-block; justify-self:end; font-variant-numeric:tabular-nums;
  font-size:.76rem; opacity:.78;
}
#sales-prospect-dashboard .segment-facet-name {overflow-wrap:anywhere;}
#sales-prospect-dashboard .segment-facet .segment-mode {
  display:flex; flex-direction:column; align-items:stretch; gap:.3rem;
  margin:.45rem 0 0; padding:.65rem .35rem .2rem;
  border-top:1px solid #52677d; font-weight:600;
}
#sales-prospect-dashboard .segment-facet .segment-mode select {
  width:100%; color:#f0f6fa; background:#172534; border:1px solid #61758a;
  font-size:.8rem; min-height:37px;
}
#sales-prospect-dashboard .segment-reset { white-space:nowrap; }
#sales-prospect-dashboard .segment-actions .segment-status {margin-right:auto;}
#sales-prospect-dashboard .segment-facet-trigger:focus-visible,
#sales-prospect-dashboard .segment-facet-option:focus-within {
  outline:2px solid #36b5d4; outline-offset:2px;
}
html[data-theme="light"] #sales-prospect-dashboard .segment-facet-trigger,
html[data-theme="light"] #sales-prospect-dashboard .segment-field .segment-search {
  color:#102431; background:#fff; border-color:#9fb3c1; color-scheme:light;
}
html[data-theme="light"] #sales-prospect-dashboard .segment-facet-popup {
  background:#fff; color:#102431; border-color:#b8c9d5;
  box-shadow:0 16px 34px rgba(16,36,49,.16);
}
html[data-theme="light"] #sales-prospect-dashboard .segment-facet-option:hover {background:#e7f3f8;}
html[data-theme="light"] #sales-prospect-dashboard .segment-facet .segment-mode {border-color:#d4dfe7;}
html[data-theme="light"] #sales-prospect-dashboard .segment-facet .segment-mode select {
  background:#fff; color:#102431; border-color:#9fb3c1; color-scheme:light;
}
html[data-theme="light"] #sales-prospect-dashboard .segment-facet-count { color:#415869; opacity:1; }
@media(max-width:1160px) {
  #sales-prospect-dashboard .segment-filters {grid-template-columns:repeat(4,minmax(0,1fr));}
}
@media(max-width:760px) {
  #sales-prospect-dashboard .segment-filters {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:480px) {
  #sales-prospect-dashboard .segment-filters {grid-template-columns:minmax(0,1fr);}
  #sales-prospect-dashboard .segment-facet-popup {width:min(100%,calc(100vw - 2rem));}
}
