.attribute-filter-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.attribute-filter-summary[hidden] {
  display: none;
}

.attribute-filter-summary-chip {
  display: inline-flex;
  min-height: 1.75rem;
  align-items: center;
  border: 1px solid var(--color-slate-200, #e2e8f0);
  border-radius: 999px;
  background: var(--color-white, #fff);
  color: var(--color-slate-700, #334155);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
}

.visits-page-header__content > .attribute-filter-summary {
  width: 100%;
  flex: 1 0 100%;
}

#company-attribute-filters {
  position: fixed;
  inset: auto;
  top: var(--attribute-filter-popup-top, 0.75rem);
  left: var(--attribute-filter-popup-left, 0.75rem);
  z-index: 70;
  display: block;
  width: min(900px, calc(100vw - 1.5rem));
  background: transparent;
  padding: 0;
}

#company-attribute-filters[hidden] {
  display: none;
}

.company-attribute-filter-shell {
  width: 100%;
}

.company-attribute-filter-dialog {
  display: flex;
  width: 100%;
  min-height: 0;
  max-height: var(--attribute-filter-popup-max-height, min(46rem, calc(100vh - 1.5rem)));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-slate-200, #e2e8f0);
  border-radius: 0.5rem;
  background: var(--color-white, #fff);
  box-shadow: 0 20px 52px rgb(15 23 42 / 22%);
  color: var(--color-slate-900, #0f172a);
}

.company-attribute-filter-header {
  display: flex;
  min-height: 5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--color-slate-200, #e2e8f0);
  padding: 1rem 1.5rem;
}

.company-attribute-filter-title {
  margin: 0;
  color: var(--color-slate-900, #0f172a);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
}

.company-attribute-filter-close {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  margin: -6px -12px -6px -6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-slate-500, #64748b);
  padding: 0;
}

.company-attribute-filter-close svg {
  width: 22px;
  height: 22px;
}

.company-attribute-filter-close:hover,
.company-attribute-filter-close:focus-visible {
  background: var(--color-slate-100, #f1f5f9);
  color: var(--color-slate-900, #0f172a);
  outline: none;
}

.company-attribute-filter-reset {
  display: inline-flex;
  min-height: 2.25rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--color-sky-800, #075985);
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 0.625rem;
}

.company-attribute-filter-reset[hidden] {
  display: none;
}

.company-attribute-filter-reset:hover,
.company-attribute-filter-reset:focus-visible {
  background: var(--color-slate-100, #f1f5f9);
  outline: none;
}

.company-attribute-filter-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.company-attribute-filter-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
}

.company-attribute-filter-row {
  position: relative;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  border-bottom: 1px solid var(--color-slate-100, #f1f5f9);
  border-radius: 8px;
  padding: 0.75rem;
  transition:
    background-color 180ms ease,
    border-color 180ms ease;
}

.company-attribute-filter-row:last-child {
  border-bottom-color: transparent;
}

.company-attribute-filter-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.375rem;
  border-radius: 8px 0 0 8px;
  background: var(--color-sky-600, #0284c7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.company-attribute-filter-row[data-active="true"] {
  border-bottom-color: var(--color-sky-100, #e0f2fe);
  background-color: rgb(2 132 199 / 8%);
}

.company-attribute-filter-row[data-active="true"]::before {
  opacity: 1;
}

.company-attribute-filter-row[data-invalid="true"] {
  background-color: rgb(239 68 68 / 6%);
}

.company-attribute-filter-label {
  min-width: 0;
}

.company-attribute-filter-name {
  display: block;
  overflow: hidden;
  color: var(--color-slate-900, #0f172a);
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-attribute-filter-type {
  display: block;
  margin-top: 0.125rem;
  color: var(--color-slate-500, #64748b);
  font-size: 0.75rem;
  line-height: 1.25;
}

.company-attribute-filter-control {
  --attribute-filter-condition-width: 13rem;
  --attribute-filter-value-width: 16rem;
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
}

.attribute-filter-select,
.attribute-filter-input {
  box-sizing: border-box;
  min-height: 2.25rem;
  border: 1px solid var(--color-slate-200, #e2e8f0);
  border-radius: 0.375rem;
  background: var(--color-white, #fff);
  color: var(--color-slate-900, #0f172a);
  font: inherit;
  font-size: 0.875rem;
  outline: none;
  padding: 0.4375rem 0.625rem;
}

.attribute-filter-select {
  appearance: none;
  width: var(--attribute-filter-condition-width);
  flex: 0 0 var(--attribute-filter-condition-width);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='20px' viewBox='0 -960 960 960' width='20px' fill='%2364748b'%3E%3Cpath d='M480-346.85 253.85-573 291-610.15l189 189 189-189L706.15-573 480-346.85Z'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  padding-right: 2.5rem;
}

.attribute-filter-input {
  width: 100%;
}

.attribute-filter-input-shell,
.attribute-filter-date-range,
.attribute-filter-range,
.attribute-filter-value-picker {
  width: auto;
  min-width: min(100%, var(--attribute-filter-value-width));
  flex: 1 1 var(--attribute-filter-value-width);
}

.attribute-filter-input-shell {
  position: relative;
  display: flex;
  min-width: 0;
}

.attribute-filter-input-shell .attribute-filter-input {
  flex: 1 1 auto;
  min-width: 0;
}

.attribute-filter-input-shell[data-currency] .attribute-filter-input {
  padding-right: 3.5rem;
}

.attribute-filter-input-addon {
  position: absolute;
  top: 50%;
  right: 0.625rem;
  color: var(--color-slate-500, #64748b);
  font-size: 0.75rem;
  font-weight: 600;
  pointer-events: none;
  transform: translateY(-50%);
}

.attribute-filter-date-range,
.attribute-filter-range {
  display: flex;
  gap: 0.5rem;
  min-width: 0;
}

.attribute-filter-date-range .attribute-filter-input-shell,
.attribute-filter-range .attribute-filter-input-shell {
  width: auto;
  min-width: 0;
  flex: 1 1 0;
}

.attribute-filter-input[type="date"] {
  cursor: pointer;
}

.attribute-filter-select:focus,
.attribute-filter-input:focus,
.attribute-filter-multiselect:focus-within {
  border-color: var(--color-blue-400, #60a5fa);
  box-shadow: 0 0 0 3px rgb(96 165 250 / 18%);
}

.attribute-filter-clear {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--color-sky-800, #075985);
  font: inherit;
  font-weight: 600;
  padding: 0.4375rem 0.625rem;
}

.attribute-filter-clear:hover,
.attribute-filter-clear:focus-visible {
  background: var(--color-sky-100, #e0f2fe);
  outline: none;
}

.attribute-filter-value-picker {
  position: relative;
  min-width: 0;
}

.attribute-filter-multiselect {
  position: relative;
  display: flex;
  box-sizing: border-box;
  min-height: 2.25rem;
  width: 100%;
  align-items: flex-start;
  gap: 0.375rem;
  border: 1px solid var(--color-slate-200, #e2e8f0);
  border-radius: 0.375rem;
  background: var(--color-white, #fff);
  padding: 0.1875rem 2rem 0.1875rem 0.375rem;
}

.attribute-filter-tag-list {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

.attribute-filter-tag {
  --tag-text: #334155;
  --tag-bg: #f1f5f9;
  --tag-border: #e2e8f0;
  display: inline-flex;
  min-height: 1.75rem;
  align-items: center;
  gap: 0.375rem;
  border: 1px solid var(--tag-border);
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.375rem 0.25rem 0.625rem;
}

.attribute-filter-tag-remove {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1;
  padding: 0;
}

.attribute-filter-tag-remove:hover,
.attribute-filter-tag-remove:focus-visible {
  background: var(--tag-bg);
  color: var(--tag-text);
  outline: none;
}

.attribute-filter-multiselect-input {
  appearance: none;
  height: 1.75rem;
  min-width: 7rem;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--color-slate-900, #0f172a);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.75rem;
  outline: none;
  padding: 0 0.125rem;
}

.attribute-filter-multiselect-input::-webkit-search-cancel-button {
  display: none;
}

.attribute-filter-multiselect-input::placeholder {
  color: var(--color-slate-400, #94a3b8);
}

.attribute-filter-multiselect-clear {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  z-index: 6;
  display: flex;
  width: 1.25rem;
  height: 1.25rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--color-slate-500, #64748b);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  transform: translateY(-50%);
}

.attribute-filter-multiselect-clear:hover,
.attribute-filter-multiselect-clear:focus-visible {
  background: var(--color-slate-100, #f1f5f9);
  color: var(--color-slate-700, #334155);
  outline: none;
}

.attribute-filter-value-menu {
  position: fixed;
  top: var(--value-menu-top, 0);
  left: var(--value-menu-left, 0);
  z-index: 80;
  width: var(--attribute-filter-value-menu-width, var(--attribute-filter-value-width));
  max-height: var(--value-menu-max-height, 18.75rem);
  overflow-y: auto;
  border: 1px solid var(--color-slate-200, #e2e8f0);
  border-radius: 0.5rem;
  background: var(--color-white, #fff);
  box-shadow: 0 18px 40px rgb(15 23 42 / 14%);
  padding: 0.375rem;
}

.attribute-filter-value-menu[hidden] {
  display: none;
}

.attribute-filter-value-option {
  display: flex;
  width: 100%;
  min-height: 2rem;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--color-slate-700, #334155);
  font: inherit;
  font-weight: 500;
  padding: 0.4375rem 0.625rem;
  text-align: left;
}

.attribute-filter-value-option:hover,
.attribute-filter-value-option:focus-visible,
.attribute-filter-value-option[aria-selected="true"] {
  background: var(--color-slate-100, #f1f5f9);
  color: var(--color-slate-900, #0f172a);
  outline: none;
}

.attribute-filter-value-option[hidden] {
  display: none;
}

.attribute-filter-value-check {
  width: 1rem;
  flex: none;
  color: var(--color-sky-700, #0369a1);
  opacity: 0;
}

.attribute-filter-value-option[aria-selected="true"] .attribute-filter-value-check {
  opacity: 1;
}

.attribute-filter-value-empty {
  color: var(--color-slate-500, #64748b);
  padding: 0.75rem;
  text-align: center;
}

.attribute-filter-segment {
  display: inline-flex;
  height: 2.25rem;
  width: var(--attribute-filter-condition-width);
  align-items: stretch;
  flex: 0 0 var(--attribute-filter-condition-width);
  overflow: hidden;
  border: 1px solid var(--color-slate-200, #e2e8f0);
  border-radius: 0.375rem;
  background: var(--color-white, #fff);
}

.attribute-filter-segment button {
  display: inline-flex;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-right: 1px solid var(--color-slate-200, #e2e8f0);
  background: transparent;
  color: var(--color-slate-600, #475569);
  font: inherit;
  font-weight: 600;
  padding: 0 0.75rem;
}

.attribute-filter-segment button:last-child {
  border-right: 0;
}

.attribute-filter-segment button[aria-pressed="true"] {
  background: var(--color-sky-50, #f0f9ff);
  color: var(--color-sky-800, #075985);
}

.attribute-filter-segment button:hover,
.attribute-filter-segment button:focus-visible {
  background: var(--color-slate-50, #f8fafc);
  color: var(--color-slate-900, #0f172a);
  outline: none;
}

.attribute-filter-error {
  width: 100%;
  margin: 0;
  color: var(--color-red-600, #dc2626);
  font-size: 0.75rem;
  line-height: 1.35;
}

.attribute-filter-error[hidden] {
  display: none;
}

.company-attribute-filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-top: 1px solid var(--color-slate-200, #e2e8f0);
  background: var(--color-white, #fff);
  padding: 1rem 1.5rem;
}

.attribute-filter-preview {
  position: relative;
  width: min(320px, 38vw);
  min-width: 240px;
}

.attribute-filter-preview-heading {
  display: flex;
  min-height: 2.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.attribute-filter-preview-label {
  display: flex;
  min-height: 1.25rem;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-slate-900, #0f172a);
  font-weight: 400;
}

.attribute-filter-preview-track {
  position: relative;
  height: 0.5625rem;
  margin-top: 0.625rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-slate-200, #e2e8f0);
}

.attribute-filter-preview-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--preview-width, 0%);
  border-radius: inherit;
  background: var(--color-sky-600, #0284c7);
  transition: width 180ms ease;
}

.attribute-filter-spinner {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  border: 2px solid rgb(8 88 130 / 18%);
  border-top-color: var(--color-sky-600, #0284c7);
  border-radius: 999px;
  animation: company-attribute-filter-spin 800ms linear infinite;
}

.attribute-filter-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.75rem;
}

.attribute-filter-action {
  display: inline-flex;
  box-sizing: border-box;
  height: 2.25rem;
  min-height: 2.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 4px;
  font: inherit;
  font-weight: 500;
  line-height: 1.5;
  padding: 0 1rem;
  white-space: nowrap;
}

.attribute-filter-action-secondary {
  border: 1px solid var(--color-slate-200, #e2e8f0);
  background: transparent;
  color: var(--color-slate-600, #475569);
  padding: 0.375rem 0.75rem;
}

.attribute-filter-action-secondary:hover,
.attribute-filter-action-secondary:focus-visible {
  background: var(--color-slate-100, #f1f5f9);
  outline: none;
}

.attribute-filter-action-primary {
  width: 160px;
  border: 1px solid var(--color-sky-600, #0284c7);
  background: var(--color-sky-600, #0284c7);
  color: var(--color-white, #fff);
}

.attribute-filter-action-primary:hover,
.attribute-filter-action-primary:focus-visible {
  border-color: var(--color-sky-700, #0369a1);
  background: var(--color-sky-700, #0369a1);
  outline: none;
}

.attribute-filter-action-primary:disabled {
  border-color: var(--color-slate-300, #cbd5e1);
  background: var(--color-slate-300, #cbd5e1);
  color: var(--color-slate-500, #64748b);
  cursor: not-allowed;
}

.company-attribute-filter-empty {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
}

.company-attribute-filter-empty-icon {
  display: inline-flex;
  width: 3rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-slate-100, #f1f5f9);
  color: var(--color-slate-500, #64748b);
}

.company-attribute-filter-empty-icon svg {
  width: 24px;
  height: 24px;
}

.company-attribute-filter-empty-title {
  margin: 1rem 0 0;
  color: var(--color-slate-900, #0f172a);
  font-size: 1rem;
  font-weight: 700;
}

.company-attribute-filter-empty-copy {
  max-width: 30rem;
  margin: 0.5rem 0 0;
  color: var(--color-slate-600, #475569);
  line-height: 1.5;
}

.company-attribute-filter-empty-link {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  border: 1px solid var(--color-slate-200, #e2e8f0);
  border-radius: 0.375rem;
  background: var(--color-white, #fff);
  color: var(--color-sky-800, #075985);
  font-weight: 600;
  padding: 0.4375rem 0.75rem;
}

.company-attribute-filter-empty-link:hover,
.company-attribute-filter-empty-link:focus-visible {
  background: var(--color-slate-100, #f1f5f9);
  outline: none;
}

@keyframes company-attribute-filter-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .company-attribute-filter-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  .company-attribute-filter-control {
    --attribute-filter-condition-width: 100%;
    --attribute-filter-value-width: 100%;
  }

  .attribute-filter-select,
  .attribute-filter-segment {
    width: 100%;
    flex-basis: 100%;
  }
}

@media (max-width: 640px) {
  .company-attribute-filter-header {
    min-height: 4rem;
    padding: 0.75rem 1rem;
  }

  .company-attribute-filter-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 1rem;
  }

  .attribute-filter-preview {
    width: 100%;
    min-width: 0;
  }

  .attribute-filter-actions {
    justify-content: flex-end;
  }

  .attribute-filter-action-primary {
    width: auto;
    min-width: 8rem;
  }
}

/* ------------------------------------------------------------------
   Companies selector, company segments popover, and segment dialogs
   ------------------------------------------------------------------ */

.company-scope {
  position: relative;
  order: -1;
  width: fit-content;
  max-width: min(19rem, calc(100vw - 2rem));
  min-width: 12.5rem;
  flex: 0 0 auto;
}

.company-scope__trigger {
  display: inline-flex;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 2.25rem;
  align-items: center;
  gap: 0.375rem;
  border: 1px solid var(--color-slate-200, #e2e8f0);
  border-radius: 0.375rem;
  background: var(--color-white, #fff);
  color: var(--color-slate-700, #334155);
  font: inherit;
  font-weight: 500;
  padding: 0.375rem 0.625rem;
  text-align: left;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.company-scope__trigger:hover {
  background: var(--color-slate-100, #f1f5f9);
}

.company-scope__trigger:focus-visible,
.company-scope__trigger[aria-expanded="true"] {
  border-color: var(--color-blue-400, #60a5fa);
  box-shadow: 0 0 0 3px rgb(96 165 250 / 18%);
  outline: none;
}

.company-scope__prefix {
  flex: 0 0 auto;
  color: var(--color-slate-500, #64748b);
}

.company-scope__value {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--color-slate-900, #0f172a);
  overflow-wrap: anywhere;
  white-space: normal;
}

.company-scope__count {
  flex: 0 0 auto;
  color: var(--color-slate-500, #64748b);
  font-size: 0.75rem;
  font-weight: 600;
}

.company-scope__count[hidden] {
  display: none;
}

.company-scope__chevron {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  color: var(--color-slate-500, #64748b);
  transition: transform 150ms ease;
}

.company-scope__trigger[aria-expanded="true"] .company-scope__chevron {
  transform: rotate(180deg);
}

.company-scope__popover {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  z-index: 55;
  width: min(23rem, calc(100vw - 1.5rem));
  max-height: min(34rem, calc(100vh - 5.5rem));
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--color-slate-200, #e2e8f0);
  border-radius: 0.625rem;
  background: var(--color-white, #fff);
  box-shadow: 0 18px 40px rgb(15 23 42 / 16%);
  padding: 0.375rem;
}

.company-scope__popover[hidden] {
  display: none;
}

.company-scope__section-label {
  color: var(--color-slate-500, #64748b);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.75rem 0.75rem 0.375rem;
  text-transform: uppercase;
}

.company-scope__segment-row {
  position: relative;
  display: block;
}

.company-scope__menu-item {
  display: grid;
  width: 100%;
  min-height: 2.625rem;
  grid-template-columns: 1.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--color-slate-700, #334155);
  font: inherit;
  padding: 0.5rem 0.625rem;
  text-align: left;
}

.company-scope__menu-item:hover,
.company-scope__menu-item:focus-visible {
  background: var(--color-slate-100, #f1f5f9);
  outline: none;
}

.company-scope__menu-item[aria-checked="true"] {
  color: var(--color-slate-900, #0f172a);
  font-weight: 600;
}

.company-scope__check {
  display: inline-flex;
  width: 1.25rem;
  align-items: center;
  justify-content: center;
}

.company-scope__check svg {
  display: block;
  width: 1rem;
  height: 1rem;
}

.company-scope__name,
.company-segment-row__name {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.company-scope__match-count {
  color: var(--color-slate-500, #64748b);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  padding-right: 0.5rem;
}

.company-scope__divider {
  height: 1px;
  margin: 0.375rem 0.25rem;
  background: var(--color-slate-200, #e2e8f0);
}

.company-scope__action {
  display: flex;
  width: 100%;
  min-height: 2.5rem;
  align-items: center;
  gap: 0.625rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--color-slate-700, #334155);
  font: inherit;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.company-scope__action:hover,
.company-scope__action:focus-visible {
  background: var(--color-slate-100, #f1f5f9);
  outline: none;
}

.company-scope__action-icon {
  display: inline-flex;
  width: 1.125rem;
  height: 1.125rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--color-slate-500, #64748b);
}

.company-scope__action-icon svg {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

.company-scope__message {
  color: var(--color-slate-500, #64748b);
  font-size: 0.8125rem;
  line-height: 1.45;
  padding: 0.75rem;
}

.company-scope__message--error {
  margin: 0.25rem;
  border-radius: 0.375rem;
  background: var(--color-red-50, #fef2f2);
  color: var(--color-red-700, #b91c1c);
}

.company-scope__retry {
  margin-top: 0.375rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-decoration: underline;
}

.company-scope__skeleton {
  height: 2.5rem;
  margin: 0.25rem;
  overflow: hidden;
  border-radius: 0.375rem;
  background: linear-gradient(
    90deg,
    var(--color-slate-100, #f1f5f9) 25%,
    var(--color-slate-50, #f8fafc) 50%,
    var(--color-slate-100, #f1f5f9) 75%
  );
  background-size: 200% 100%;
  animation: company-segment-shimmer 1.25s linear infinite;
}

.company-attribute-filter-heading {
  min-width: 0;
}

.company-attribute-filter-subtitle {
  margin: 0.125rem 0 0;
  color: var(--color-slate-500, #64748b);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.company-attribute-filter-subtitle[hidden] {
  display: none;
}

.company-segment-builder-context {
  border-bottom: 1px solid var(--color-slate-200, #e2e8f0);
  background: var(--color-white, #fff);
  color: var(--color-slate-500, #64748b);
  font-size: 0.8125rem;
  line-height: 1.4;
  padding: 0.5rem 1.5rem;
}

.company-segment-builder-context[hidden] {
  display: none;
}

.company-segment-builder-context__title {
  margin: 0;
  font-weight: 400;
}

.company-filter-draft-error {
  max-width: 25rem;
  margin: 0.375rem 0 0;
  color: var(--color-red-700, #b91c1c);
  font-size: 0.75rem;
  line-height: 1.35;
}

.company-filter-draft-error[hidden] {
  display: none;
}

.attribute-filter-action-tertiary {
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-sky-800, #075985);
}

.attribute-filter-action-tertiary:hover:not(:disabled),
.attribute-filter-action-tertiary:focus-visible {
  background: var(--color-slate-100, #f1f5f9);
  outline: none;
}

.attribute-filter-action[aria-busy="true"]::before,
.company-segment-button[aria-busy="true"]::before {
  content: "";
  width: 0.875rem;
  height: 0.875rem;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: company-attribute-filter-spin 700ms linear infinite;
}

/* A committed scope change reloads the page, so the busy cursor is what tells
   the user the click registered while the request is in flight. */
[data-company-scope-busy="true"],
[data-company-scope-busy="true"] * {
  cursor: progress !important;
}

.company-segment-dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: block;
  overflow: visible;
  background: transparent;
  padding: 0;
}

.company-segment-dialog-layer[hidden] {
  display: none;
}

.company-segment-dialog {
  position: fixed;
  top: var(--company-segment-dialog-top, 0.75rem);
  left: var(--company-segment-dialog-left, 0.75rem);
  display: flex;
  width: min(34rem, calc(100vw - 1.5rem));
  max-height: var(--company-segment-dialog-max-height, calc(100vh - 1.5rem));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-slate-200, #e2e8f0);
  border-radius: 0.625rem;
  background: var(--color-white, #fff);
  box-shadow: 0 24px 72px rgb(15 23 42 / 24%);
}

.company-segment-dialog[data-dialog-kind="manage"] {
  width: min(28rem, calc(100vw - 1.5rem));
  box-shadow: 0 18px 44px rgb(15 23 42 / 20%);
}

.company-segment-dialog-layer[data-dialog-kind="manage"] {
  background: transparent;
}

.company-segment-dialog__header {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--color-slate-200, #e2e8f0);
  padding: 1rem 1.25rem;
}

.company-segment-dialog__title {
  margin: 0;
  color: var(--color-slate-900, #0f172a);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
}

.company-segment-dialog__title:focus {
  outline: none;
}

.company-segment-dialog__close {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin: -0.5rem -0.5rem -0.5rem 0;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--color-slate-500, #64748b);
  font-size: 1.5rem;
}

.company-segment-dialog__close:hover,
.company-segment-dialog__close:focus-visible {
  background: var(--color-slate-100, #f1f5f9);
  color: var(--color-slate-900, #0f172a);
  outline: none;
}

.company-segment-dialog__body {
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem;
}

.company-segment-dialog__copy {
  margin: 0;
  color: var(--color-slate-600, #475569);
  line-height: 1.55;
}

.company-segment-dialog__copy + .company-segment-dialog__copy {
  margin-top: 0.5rem;
}

.company-segment-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--color-slate-200, #e2e8f0);
  padding: 1rem 1.25rem;
}

.company-segment-dialog__footer:empty {
  display: none;
}

.company-segment-button {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--color-slate-200, #e2e8f0);
  border-radius: 0.375rem;
  background: var(--color-white, #fff);
  color: var(--color-slate-700, #334155);
  font: inherit;
  font-weight: 500;
  padding: 0.45rem 0.875rem;
}

.company-segment-button:hover:not(:disabled),
.company-segment-button:focus-visible {
  background: var(--color-slate-100, #f1f5f9);
  outline: none;
}

.company-segment-button--primary {
  border-color: var(--color-sky-600, #0284c7);
  background: var(--color-sky-600, #0284c7);
  color: var(--color-white, #fff);
}

.company-segment-button--primary:hover:not(:disabled),
.company-segment-button--primary:focus-visible {
  border-color: var(--color-sky-700, #0369a1);
  background: var(--color-sky-700, #0369a1);
}

.company-segment-button--danger {
  border-color: var(--color-red-600, #dc2626);
  background: var(--color-red-600, #dc2626);
  color: var(--color-white, #fff);
}

.company-segment-button--danger:hover:not(:disabled),
.company-segment-button--danger:focus-visible {
  border-color: var(--color-red-700, #b91c1c);
  background: var(--color-red-700, #b91c1c);
}

.company-segment-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.company-segment-field {
  display: grid;
  gap: 0.375rem;
}

.company-segment-field label {
  color: var(--color-slate-800, #1e293b);
  font-weight: 600;
}

.company-segment-field input {
  width: 100%;
  height: 2.5rem;
  border: 1px solid var(--color-slate-300, #cbd5e1);
  border-radius: 0.375rem;
  background: var(--color-white, #fff);
  color: var(--color-slate-900, #0f172a);
  font: inherit;
  padding: 0 0.75rem;
}

.company-segment-field input:focus {
  border-color: var(--color-blue-400, #60a5fa);
  box-shadow: 0 0 0 3px rgb(96 165 250 / 18%);
  outline: none;
}

.company-segment-field input[aria-invalid="true"] {
  border-color: var(--color-red-600, #dc2626);
}

.company-segment-field__hint {
  margin: 0;
  color: var(--color-slate-500, #64748b);
  font-size: 0.75rem;
}

.company-segment-field__error {
  min-height: 1.125rem;
  margin: 0;
  color: var(--color-red-700, #b91c1c);
  font-size: 0.8125rem;
}

.company-segment-list {
  display: grid;
  gap: 0.25rem;
}

.company-segment-row {
  position: relative;
  display: grid;
  min-height: 2.875rem;
  grid-template-columns: minmax(0, 1fr) auto 2.5rem;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.25rem 0.25rem 0.25rem 0.75rem;
}

.company-segment-row__name {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  gap: 0.25rem;
  border: 0;
  background: transparent;
  color: var(--color-sky-800, #075985);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0;
  text-align: left;
}

.company-segment-row__name:hover {
  color: var(--color-sky-900, #0c4a6e);
}

.company-segment-row__name-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.company-segment-row__edit-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(-0.125rem);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.company-segment-row__edit-icon svg {
  width: 1rem;
  height: 1rem;
}

.company-segment-row__name:hover .company-segment-row__edit-icon,
.company-segment-row__name:focus-visible .company-segment-row__edit-icon {
  opacity: 1;
  transform: translateX(0);
}

.company-segment-row__name:focus-visible {
  border-radius: 0.25rem;
  outline: 2px solid var(--color-blue-400, #60a5fa);
  outline-offset: 2px;
}

.company-segment-row__meta {
  color: var(--color-slate-500, #64748b);
  font-size: 0.75rem;
  white-space: nowrap;
}

.company-segment-row__overflow {
  display: inline-flex;
  min-width: 2.5rem;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--color-slate-500, #64748b);
  line-height: 1;
}

.company-segment-row__overflow svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.company-segment-row__overflow:hover,
.company-segment-row__overflow:focus-visible {
  background: var(--color-slate-100, #f1f5f9);
  color: var(--color-slate-900, #0f172a);
  outline: 2px solid var(--color-blue-400, #60a5fa);
  outline-offset: -2px;
}

.company-segment-overflow-menu {
  position: fixed;
  top: var(--company-segment-menu-top, 0.5rem);
  left: var(--company-segment-menu-left, 0.5rem);
  z-index: 90;
  width: 10.5rem;
  border: 1px solid var(--color-slate-200, #e2e8f0);
  border-radius: 0.5rem;
  background: var(--color-white, #fff);
  box-shadow: 0 12px 28px rgb(15 23 42 / 14%);
  padding: 0.25rem;
}

.company-segment-overflow-menu[hidden] {
  display: none;
}

.company-segment-overflow-menu button {
  display: block;
  width: 100%;
  min-height: 2.25rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--color-slate-700, #334155);
  font: inherit;
  padding: 0.45rem 0.625rem;
  text-align: left;
}

.company-segment-overflow-menu button:hover,
.company-segment-overflow-menu button:focus-visible {
  background: var(--color-slate-100, #f1f5f9);
  outline: none;
}

.company-segment-overflow-menu button[data-segment-action="delete"] {
  color: var(--color-red-700, #b91c1c);
}

.company-segment-empty {
  display: flex;
  min-height: 14rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.company-segment-empty__icon {
  display: inline-flex;
  width: 3rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-slate-100, #f1f5f9);
  color: var(--color-slate-500, #64748b);
}

.company-segment-empty__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.company-segment-empty__title {
  margin: 1rem 0 0;
  color: var(--color-slate-900, #0f172a);
  font-size: 1rem;
  font-weight: 700;
}

.company-segment-empty__copy {
  max-width: 26rem;
  margin: 0.375rem 0 0;
  color: var(--color-slate-600, #475569);
  line-height: 1.5;
}

.company-segment-empty .company-segment-button {
  margin-top: 1rem;
}

.company-segment-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  max-width: min(24rem, calc(100vw - 2rem));
  border: 1px solid var(--color-slate-700, #334155);
  border-radius: 0.5rem;
  background: var(--color-slate-900, #0f172a);
  box-shadow: 0 14px 34px rgb(15 23 42 / 24%);
  color: var(--color-white, #fff);
  padding: 0.75rem 1rem;
}

.company-segment-toast[hidden] {
  display: none;
}

.company-segment-toast[data-tone="error"] {
  border-color: var(--color-red-700, #b91c1c);
  background: var(--color-red-700, #b91c1c);
}

/* ---------------------------------------------------- deleted-attribute review */

/*
 * A segment that outlived one of its attributes is marked, never renamed, so
 * every warning here is a marker set beside the owner's own text.
 */
.company-scope__warning,
.company-segment-row__warning {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin-right: 0.375rem;
  color: var(--color-amber-600, #d97706);
  vertical-align: -0.1875rem;
}

.company-scope__warning svg,
.company-segment-row__warning svg {
  width: 1rem;
  height: 1rem;
}

.company-segment-row__warning {
  margin-right: 0;
}

.company-segment-row__meta--review {
  color: var(--color-amber-700, #b45309);
  font-weight: 600;
}

.company-segment-dialog__list {
  margin: 0.5rem 0 0;
  padding-left: 1.125rem;
  color: var(--color-slate-600, #475569);
  line-height: 1.55;
  list-style: disc;
}

.company-segment-review-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1rem;
  border: 1px solid var(--color-amber-200, #fde68a);
  border-radius: 0.5rem;
  background: var(--color-amber-50, #fffbeb);
  color: var(--color-amber-900, #78350f);
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 0.75rem 1rem;
}

.company-segment-review-banner__icon {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin-top: 0.0625rem;
  color: var(--color-amber-600, #d97706);
}

.company-segment-review-banner__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.company-segment-review-banner__body {
  min-width: 0;
  flex: 1 1 auto;
}

.company-segment-review-banner__message {
  margin: 0;
}

.company-segment-review-banner__message + .company-segment-review-banner__message {
  margin-top: 0.25rem;
}

.company-segment-review-banner__action {
  flex: 0 0 auto;
  border: 1px solid var(--color-amber-300, #fcd34d);
  border-radius: 0.375rem;
  background: var(--color-white, #fff);
  color: var(--color-amber-900, #78350f);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  white-space: nowrap;
}

.company-segment-review-banner__action:hover {
  background: var(--color-amber-100, #fef3c7);
}

.company-segment-review-banner__action:focus-visible {
  outline: 2px solid var(--color-amber-600, #d97706);
  outline-offset: 2px;
}

.company-segment-builder-review {
  border-bottom: 1px solid var(--color-amber-200, #fde68a);
  background: var(--color-amber-50, #fffbeb);
  color: var(--color-amber-900, #78350f);
  font-size: 0.8125rem;
  line-height: 1.45;
  padding: 0.625rem 1.5rem;
}

.company-segment-builder-review[hidden] {
  display: none;
}

.company-segment-builder-review__title {
  margin: 0;
  font-weight: 600;
}

.company-segment-builder-review__list {
  margin: 0.25rem 0 0;
  padding-left: 1.125rem;
  list-style: disc;
}

.company-segment-builder-review__copy {
  margin: 0.25rem 0 0;
}

@keyframes company-segment-shimmer {
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 767px) {
  .company-scope,
  .company-scope__trigger {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .company-scope__popover {
    position: fixed;
    top: auto;
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-height: min(36rem, calc(100vh - 1.5rem));
  }

  .company-segment-dialog {
    max-height: calc(100vh - 1rem);
  }

  .company-segment-dialog__footer {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .company-scope__chevron,
  .company-scope__skeleton,
  .company-segment-row__edit-icon,
  .attribute-filter-action[aria-busy="true"]::before,
  .company-segment-button[aria-busy="true"]::before {
    animation: none;
    transition: none;
  }
}
