/*
 * Design tokens scoped to the Organisations/Contacts screens (this file).
 * Reuses the app's existing --brand/--ink/--muted/--line/--page tokens
 * (styles.css) for color harmony with the rest of the app; these are
 * purely additive so nothing outside this file is affected.
 */
:root {
  /*
   * Restrained radius/shadow scale per the brand design system (no
   * oversized cards, shadows used sparingly) — small and mostly-uniform
   * rather than the rounder scale this used to be.
   */
  --dir-radius-sm: 6px;
  --dir-radius-md: 6px;
  --dir-radius-lg: 8px;
  --dir-shadow-sm: 0 1px 2px rgba(14, 42, 27, .05);
  --dir-shadow-md: 0 4px 10px -6px rgba(14, 42, 27, .16);
  --dir-surface: #fff;
  --dir-surface-muted: #f7f8fc;
  --dir-surface-sunk: #f2f3f9;
  --dir-border: #e7eaf1;
  --dir-accent: var(--brand);
  /*
   * Overridden to an emerald tint/shade in theme.css's :root to match
   * the accent color everywhere else — these are just the fallback if
   * theme.css somehow isn't loaded.
   */
  --dir-accent-soft: #e3f6ec;
  --dir-accent-strong: #0b7a52;
}

.nav-label {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  padding: 14px 13px 2px;
}

.directory-intro {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.directory-intro h2 {
  color: var(--text-primary);
  font-size: 30px;
  margin: 2px 0 4px;
}

.directory-intro > div > p:last-child {
  color: var(--muted);
  font-size: 15px;
}

.directory-actions {
  display: flex;
  gap: 10px;
}

.campaign,
.dark-button {
  border: 0;
  border-radius: var(--dir-radius-sm);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 11px 18px;
  transition: background .12s ease, opacity .12s ease;
}

.campaign { background: var(--color-error); }
.dark-button { background: var(--cta-bg); }
.dark-button:hover { background: var(--cta-bg-hover); }

.directory-panel {
  border-radius: var(--dir-radius-lg);
  box-shadow: var(--dir-shadow-md);
  overflow: hidden;
}

/*
 * Saved views — a segmented-pill control (muted track, floating white
 * active pill) instead of the old underline tabs, matching a more
 * contemporary dashboard idiom.
 */
.saved-views {
  align-items: center;
  background: var(--dir-surface-muted);
  border-bottom: 1px solid var(--dir-border);
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 12px 22px;
}

.saved-views button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  padding: 9px 16px;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}

.saved-views button:hover { background: var(--dir-accent-soft); color: var(--ink); }

.saved-views button.active {
  background: var(--dir-surface);
  box-shadow: var(--dir-shadow-sm);
  color: var(--dir-accent-strong);
}

.saved-views .add-view { color: var(--dir-accent); margin-left: auto; }
.saved-views .add-view:hover { background: var(--dir-accent-soft); }

.listing-toolbar {
  align-items: center;
  background: var(--dir-surface);
  border-bottom: 1px solid var(--dir-border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 22px;
}

.listing-toolbar select,
.listing-summary select,
.filter-button {
  background: var(--dir-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--dir-radius-sm);
  color: var(--text-primary);
  font: inherit;
  height: 40px;
  padding: 0 12px;
  min-width: 0;
  max-width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.listing-toolbar select:hover,
.listing-summary select:hover,
.filter-button:hover {
  border-color: #c9c6bc;
}

.listing-toolbar select:focus,
.listing-summary select:focus,
.filter-button:focus-visible {
  border-color: var(--dir-accent);
  box-shadow: 0 0 0 3px var(--dir-accent-soft);
  outline: none;
}

/*
 * flex: 1 1 260px (not a fixed min-width) so this can shrink all the way
 * down on a narrow screen instead of forcing the whole toolbar row wider
 * than the viewport — the old `min-width: 320px` stayed in effect even
 * inside the <=1100px override below (only `width` was reset there),
 * which is exactly why the toolbar overflowed on phone-width screens.
 */
.search-box.wide { height: 40px; flex: 1 1 260px; min-width: 0; max-width: 420px; }
.filter-button { cursor: pointer; font-weight: 650; white-space: nowrap; }

/*
 * Searchable multi-select filter dropdown (see createMultiselect in
 * app-v12.js) — a trigger button that opens a floating panel with a
 * search box and a checkbox list, standing in for what used to be a
 * plain <select>.
 */
.multiselect { position: relative; }

.multiselect-trigger {
  background: var(--dir-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--dir-radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  height: 40px;
  max-width: 220px;
  min-width: 140px;
  overflow: hidden;
  padding: 0 28px 0 12px;
  position: relative;
  text-align: left;
  text-overflow: ellipsis;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
  width: 100%;
}

.multiselect-trigger::after {
  border-bottom: 1.5px solid var(--text-secondary);
  border-right: 1.5px solid var(--text-secondary);
  content: "";
  height: 7px;
  pointer-events: none;
  position: absolute;
  right: 13px;
  top: 44%;
  transform: translateY(-50%) rotate(45deg);
  width: 7px;
}

.multiselect-trigger:hover { border-color: #c9c6bc; }
.multiselect-trigger:focus-visible {
  border-color: var(--dir-accent);
  box-shadow: 0 0 0 3px var(--dir-accent-soft);
  outline: none;
}

.multiselect.has-value .multiselect-trigger {
  background: var(--dir-accent-soft);
  border-color: var(--dir-accent-strong);
  color: var(--dir-accent-strong);
  font-weight: 650;
}

.multiselect-panel {
  background: var(--dir-surface);
  border: 1px solid var(--dir-border);
  border-radius: var(--dir-radius-md);
  box-shadow: var(--dir-shadow-md);
  display: flex;
  flex-direction: column;
  left: 0;
  margin-top: 6px;
  position: absolute;
  top: 100%;
  width: max(240px, 100%);
  z-index: 20;
}

.multiselect-panel.hidden { display: none; }

.multiselect-search {
  border: 0;
  border-bottom: 1px solid var(--dir-border);
  box-sizing: border-box;
  font: inherit;
  padding: 11px 12px;
  width: 100%;
}
.multiselect-search:focus { background: var(--dir-surface-muted); outline: none; }

.multiselect-options { max-height: 240px; overflow-y: auto; padding: 6px; }

.multiselect-option {
  align-items: center;
  border-radius: var(--dir-radius-sm);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  gap: 9px;
  padding: 8px 9px;
}
.multiselect-option:hover { background: var(--dir-surface-muted); }
.multiselect-option input { flex-shrink: 0; margin: 0; }

.multiselect-empty { color: var(--muted); font-size: 13px; padding: 16px 12px; text-align: center; }

.multiselect-panel-actions {
  border-top: 1px solid var(--dir-border);
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
}
.multiselect-panel-actions .multiselect-done { padding: 7px 14px; }

.listing-summary {
  align-items: center;
  background: var(--dir-surface-muted);
  border-bottom: 1px solid var(--dir-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 12px 22px;
}
.listing-summary > div:first-child strong { color: var(--text-primary); font-size: 14px; font-weight: 700; }
.listing-summary > div:first-child span { color: var(--text-secondary); font-size: 13px; margin-left: 4px; }
.listing-summary-actions { align-items: center; display: flex; gap: 9px; }
.listing-summary-actions label { color: var(--text-secondary); font-size: 12px; }
.compact-button { padding: 8px 11px; }

.active-filter-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 22px 14px; }
.active-filter-chips button {
  background: var(--dir-accent-soft);
  border: 1px solid var(--dir-accent-soft);
  border-radius: 999px;
  color: var(--dir-accent-strong);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  transition: background .15s ease;
}
.active-filter-chips button:hover { background: var(--dir-accent-soft); }
.active-filter-chips .clear-chip { background: transparent; border-color: transparent; color: var(--text-secondary); font-weight: 500; }
.active-filter-chips .clear-chip:hover { background: var(--dir-surface-sunk); }

.source-stack { align-items: flex-start; display: flex; flex-direction: column; gap: 4px; }
.source-more { color: var(--dir-accent-strong); font-size: 11px; font-weight: 700; }
.table-primary, .table-secondary { display: block; }
.table-primary { font-size: 13px; font-weight: 650; }
.table-secondary { color: var(--text-secondary); font-size: 11px; margin-top: 3px; }
.row-menu { background: transparent; border: 0; color: var(--text-secondary); cursor: pointer; font-size: 16px; }

.filter-backdrop { background: rgba(14, 29, 51, .4); backdrop-filter: blur(1px); inset: 0; position: fixed; z-index: 30; }
.filter-drawer {
  background: var(--dir-surface);
  box-shadow: -16px 0 40px rgba(12, 31, 56, .18);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(105%);
  transition: transform .22s ease;
  width: min(430px, 92vw);
  z-index: 31;
}
.filter-drawer.open { transform: translateX(0); }
.filter-drawer-head { align-items: center; border-bottom: 1px solid var(--dir-border); display: flex; justify-content: space-between; padding: 20px 24px; }
.filter-drawer-head h2 { color: var(--text-primary); font-size: 22px; margin: 3px 0 0; }
.filter-drawer-head button { background: transparent; border: 0; border-radius: var(--dir-radius-sm); color: var(--text-secondary); cursor: pointer; font-size: 28px; line-height: 1; padding: 2px 8px; }
.filter-drawer-head button:hover { background: var(--dir-surface-sunk); color: var(--text-primary); }
.filter-drawer-body { flex: 1; overflow-y: auto; padding: 2px 24px 24px; }
.filter-drawer-body section { border-bottom: 1px solid var(--border-subtle); padding: 20px 0; }
.filter-drawer-body h3 { color: var(--text-primary); font-size: 14px; margin: 0 0 14px; }
.filter-drawer-body label { color: var(--text-secondary); display: block; font-size: 12px; font-weight: 650; margin-top: 12px; }
.filter-drawer-body input:not([type="checkbox"]) {
  border: 1px solid var(--border-subtle);
  border-radius: var(--dir-radius-sm);
  box-sizing: border-box;
  display: block;
  font: inherit;
  margin-top: 6px;
  padding: 10px 11px;
  transition: border-color .15s ease, box-shadow .15s ease;
  width: 100%;
}
.filter-drawer-body input:not([type="checkbox"]):focus {
  border-color: var(--dir-accent);
  box-shadow: 0 0 0 3px var(--dir-accent-soft);
  outline: none;
}
.filter-two-column { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.filter-drawer-body .check-filter { align-items: center; display: flex; gap: 9px; font-size: 13px; font-weight: 500; }
.filter-drawer-actions { border-top: 1px solid var(--dir-border); display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; }

/*
 * Contacts now shares the same .listing-toolbar/.listing-summary rows as
 * Organisations (see index.html) — the two screens read as one consistent
 * system instead of two different layouts. Its <select>s pick up styling
 * from the shared ".listing-toolbar select" rule above.
 */
.search-box {
  align-items: center;
  background: var(--dir-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--dir-radius-sm);
  height: 43px;
  color: var(--text-secondary);
  display: flex;
  gap: 7px;
  padding: 0 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
  width: 270px;
}

.search-box:focus-within {
  border-color: var(--dir-accent);
  box-shadow: 0 0 0 3px var(--dir-accent-soft);
}

.search-box input {
  border: 0;
  font: inherit;
  outline: 0;
  width: 100%;
}

.record-count { color: inherit; }

.directory-table th {
  background: var(--dir-surface-muted);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  position: sticky;
  top: 0;
  z-index: 1;
}

.directory-table td { padding: 15px 18px; border-top: 1px solid var(--dir-border); }
.directory-table tbody tr { transition: background .12s ease; }
.directory-table tbody tr:hover { background: var(--dir-surface-muted); }
.directory-table tbody tr:hover .edit-button { border-color: #c9c6bc; }

.primary-cell { align-items: center; display: flex; gap: 11px; }
.primary-cell strong,
.primary-cell small { display: block; }
.primary-cell small { color: var(--text-secondary); font-weight: 400; margin-top: 2px; }

.avatar {
  background: var(--dir-accent-soft);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(42, 131, 84, .16);
  color: var(--dir-accent-strong);
  display: grid;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  height: 36px;
  place-items: center;
  width: 36px;
}

/*
 * Neutral (not blue) so it reads as "the other entity type," not a
 * fourth accent color — the brand palette has no blue (see theme.css).
 */
.avatar.organisation {
  background: #eae8e1;
  border-radius: var(--dir-radius-sm);
  box-shadow: inset 0 0 0 1px rgba(74, 85, 74, .18);
  color: var(--text-secondary);
}

.source-pill,
.role-pill {
  background: var(--dir-surface-sunk);
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-secondary);
  display: inline-flex;
  font-size: 11px;
  font-weight: 600;
  max-width: 200px;
  overflow: hidden;
  padding: 5px 10px;
  text-overflow: ellipsis;
  /*
   * Without this, text-overflow: ellipsis does nothing (it only applies
   * to non-wrapping text) — a long database/source name wrapped onto
   * 2-3 lines inside the pill instead of truncating cleanly to one.
   * Paired with the `title` attribute on these spans (see app-v12.js) so
   * the full name is still available on hover.
   */
  white-space: nowrap;
}

.role-pill {
  background: #e7f7f0;
  color: #14805a;
  margin: 2px;
  text-transform: capitalize;
}

.rocketreach-pill {
  background: var(--dir-accent-soft);
  border-radius: 999px;
  color: var(--dir-accent-strong);
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  white-space: nowrap;
}

.manual-pill {
  background: var(--dir-surface-sunk);
  border-radius: 999px;
  color: var(--text-secondary);
  display: inline-flex;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  white-space: nowrap;
}

.edit-button,
.text-button {
  background: var(--dir-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--dir-radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  padding: 7px 11px;
  transition: border-color .15s ease, background .15s ease;
}

.edit-button:hover { background: var(--dir-surface-muted); border-color: #c9c6bc; }

.text-button {
  background: transparent;
  border: 0;
  color: var(--dir-accent-strong);
  font-weight: 600;
  padding: 5px;
  text-align: left;
}

.text-button:hover { text-decoration: underline; }

.pagination {
  align-items: center;
  background: var(--dir-surface);
  border-top: 1px solid var(--dir-border);
  color: var(--text-secondary);
  display: flex;
  font-size: 13px;
  font-weight: 600;
  gap: 14px;
  justify-content: flex-end;
  padding: 16px 22px;
}

.pagination button {
  background: var(--dir-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--dir-radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 8px 14px;
  transition: border-color .15s ease, background .15s ease;
}

.pagination button:hover:not(:disabled) { background: var(--dir-surface-muted); border-color: #c9c6bc; }
.pagination button:disabled { cursor: not-allowed; opacity: .45; }

/* RocketReach search results pager — same look as the directory pager,
   plus a rows-per-page selector and "Showing X–Y of Z". Wraps on narrow
   screens rather than overflowing. */
.rr-pager { flex-wrap: wrap; }
.rr-page-size { align-items: center; display: inline-flex; gap: 8px; margin-right: auto; }
.rr-page-size select {
  background: var(--dir-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--dir-radius-sm);
  color: var(--text-primary);
  font: inherit;
  padding: 6px 8px;
}
.rr-page-range { color: var(--text-secondary); font-weight: 500; }
.rr-lookup-toggle {
  align-items: center;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
  white-space: nowrap;
}

.rr-export-status {
  align-items: center;
  background: var(--dir-accent-soft);
  border-radius: var(--dir-radius-md);
  color: var(--dir-accent-strong);
  display: flex;
  flex-wrap: wrap;
  font-weight: 600;
  gap: 12px;
  justify-content: space-between;
  margin: 14px 22px;
  padding: 10px 16px;
}

.context-filter {
  align-items: center;
  background: var(--dir-accent-soft);
  border-radius: var(--dir-radius-md);
  color: var(--dir-accent-strong);
  display: flex;
  font-weight: 600;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 12px 16px;
}

.context-filter button {
  background: transparent;
  border: 0;
  color: var(--dir-accent-strong);
  cursor: pointer;
  font-weight: 700;
  opacity: .8;
}
.context-filter button:hover { opacity: 1; }

.mini-spinner {
  animation: spin .8s linear infinite;
  border: 2px solid var(--dir-accent-soft);
  border-radius: 50%;
  border-top-color: var(--dir-accent);
  display: inline-block;
  height: 16px;
  margin-right: 8px;
  vertical-align: middle;
  width: 16px;
}

/*
 * The RocketReach results table's "Checking…" aurastride-status badge
 * (see rrMatchBadge in app-v12.js) — a .status pill with a spinner
 * sized down to fit inside its 12px-text/4-9px-padding footprint
 * instead of the table-loading-row-sized default above.
 */
.status-pending {
  background: var(--dir-surface-sunk);
  color: var(--muted);
}
.status-pending .mini-spinner {
  border-width: 1.5px;
  height: 9px;
  margin-right: 5px;
  width: 9px;
}

.empty {
  color: var(--muted);
}

/* ---------------- Activity loaders (see LOADERS in app-v12.js) ----------------
   One animated image per kind of work — RocketReach (outside source),
   reading from aurastride, saving to aurastride, processing a file, CSV
   download — used in the activity dock, table loading rows, and the
   long-running progress panels. */
.loader-img { flex: none; height: 32px; width: 32px; }
.loader-img-lg { height: 44px; width: 44px; }
.loader-hero { display: block; height: 96px; margin: 0 auto 16px; width: 96px; }

.loading-inline { align-items: center; display: inline-flex; gap: 12px; text-align: left; }
.loading-cell { padding: 28px !important; }

.activity-dock {
  bottom: 76px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
  position: fixed;
  right: 22px;
  width: 340px;
  z-index: 60;
}

.activity-card {
  align-items: center;
  animation: activity-in .18s ease-out;
  background: var(--dir-surface);
  border: 1px solid var(--dir-border);
  border-left: 4px solid var(--activity-accent, var(--dir-accent));
  border-radius: var(--dir-radius-md);
  box-shadow: 0 8px 24px rgba(14, 42, 27, .12);
  display: flex;
  gap: 12px;
  padding: 10px 14px;
}
.activity-card strong {
  color: var(--activity-accent, var(--dir-accent-strong));
  display: block;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.activity-card .activity-label { color: var(--text-primary); display: block; font-size: 13px; font-weight: 600; }

/* A distinct accent per kind, matching each loader's own colours, so the
   source of the work is recognisable at a glance. */
.activity-rocketreach { --activity-accent: #b86f0e; }
.activity-aurastride { --activity-accent: #2a8354; }
.activity-aurastride-save { --activity-accent: #0e2a1b; }
.activity-file { --activity-accent: #4a554a; }
.activity-csv { --activity-accent: #1f6b44; }

@keyframes activity-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.manual-workspace { margin: 0 auto; max-width: 1040px; }
.manual-workspace > .panel-head { padding: 18px 24px 12px; }
.manual-workspace > .saved-views { padding: 8px 24px; }
.manual-workspace #manual-options-status { margin: 8px 24px 0; min-height: 16px; }
.manual-workspace .manual-form-grid {
  gap: 12px 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 14px 24px;
}
.manual-form-grid > label,
.manual-selection-field > label,
.manual-organization-picker > label {
  color: var(--text-secondary);
  display: block;
  font-size: 12px;
  font-weight: 650;
  min-width: 0;
}
.manual-form-grid > label input,
.manual-form-grid > label select,
.manual-selection-field > select,
.manual-organization-picker > input,
.manual-organization-picker > select {
  background: var(--dir-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--dir-radius-sm);
  box-sizing: border-box;
  color: var(--text-primary);
  display: block;
  font: inherit;
  height: 38px;
  margin-top: 5px;
  min-width: 0;
  padding: 0 10px;
  width: 100%;
}
.manual-additional { border-top: 1px solid var(--dir-border); margin: 2px 24px 0; }
.manual-additional summary { color: var(--dir-accent-strong); cursor: pointer; font-size: 13px; font-weight: 650; padding: 12px 0; }
.manual-additional[open] { padding-bottom: 6px; }
.manual-additional .manual-form-grid { padding: 4px 0 12px; }
.manual-selection-field { min-width: 0; }
.manual-selected-values { align-items: center; display: flex; flex-wrap: wrap; gap: 5px; min-height: 25px; padding: 4px 0; }
.manual-selection-empty { color: var(--text-secondary); font-size: 12px; }
.manual-selected-chip { align-items: center; background: var(--dir-accent-soft); border-radius: 4px; color: var(--dir-accent-strong); display: inline-flex; font-size: 11px; gap: 4px; max-width: 100%; padding: 3px 5px 3px 8px; }
.manual-selected-chip button { background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.manual-multi-picker { border: 1px solid var(--border-subtle); border-radius: var(--dir-radius-sm); margin-top: 4px; }
.manual-multi-picker summary { align-items: center; color: var(--text-primary); cursor: pointer; display: flex; font-size: 12px; justify-content: space-between; list-style: none; min-height: 36px; padding: 0 10px; }
.manual-multi-picker summary::-webkit-details-marker { display: none; }
.manual-multi-picker[open] { background: var(--dir-surface); box-shadow: var(--dir-shadow-sm); }
.manual-multi-panel { border-top: 1px solid var(--dir-border); padding: 8px; }
.manual-multi-panel > input { border: 1px solid var(--border-subtle); border-radius: 4px; box-sizing: border-box; font: inherit; height: 34px; padding: 0 8px; width: 100%; }
.manual-option-list { max-height: 180px; overflow: auto; padding-top: 5px; }
.manual-workspace .manual-option-row { align-items: center; border-radius: 4px; color: var(--text-primary); cursor: pointer; display: flex; font-size: 12px; font-weight: 450; gap: 8px; margin: 0; padding: 6px; }
.manual-workspace .manual-option-row:hover { background: var(--dir-surface-muted); }
.manual-workspace .manual-option-row[hidden] { display: none; }
.manual-workspace .manual-option-row input { accent-color: var(--dir-accent-strong); margin: 0; }
.manual-organization-picker { display: grid; gap: 5px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.manual-organization-picker input, .manual-organization-picker select { margin-top: 0; }
.manual-workspace #manual-contact-warning { margin: 0 24px 8px; }
.manual-workspace #manual-record-form > .actions { border-top: 1px solid var(--dir-border); margin-top: 8px; padding: 12px 24px 16px; }

@media (max-width: 680px) {
  .manual-workspace .manual-form-grid { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; }
  .manual-additional { margin-inline: 16px; }
  .manual-workspace > .panel-head, .manual-workspace > .saved-views { padding-inline: 16px; }
  .manual-workspace #manual-options-status, .manual-workspace #manual-contact-warning { margin-inline: 16px; }
  .manual-workspace #manual-record-form > .actions { padding-inline: 16px; }
}

.manual-workspace { margin: 0 auto; max-width: 1040px; }
.manual-workspace > .panel-head { padding: 18px 24px 12px; }
.manual-workspace > .saved-views { padding: 8px 24px; }
.manual-workspace #manual-options-status { margin: 8px 24px 0; min-height: 16px; }
.manual-workspace .manual-form-grid {
  gap: 12px 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 14px 24px;
}
.manual-form-grid > label,
.manual-selection-field > label,
.manual-organization-picker > label {
  color: var(--text-secondary);
  display: block;
  font-size: 12px;
  font-weight: 650;
  min-width: 0;
}
.manual-form-grid > label input,
.manual-form-grid > label select,
.manual-selection-field > select,
.manual-organization-picker > input,
.manual-organization-picker > select {
  background: var(--dir-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--dir-radius-sm);
  box-sizing: border-box;
  color: var(--text-primary);
  display: block;
  font: inherit;
  height: 38px;
  margin-top: 5px;
  min-width: 0;
  padding: 0 10px;
  width: 100%;
}
.manual-additional {
  border-top: 1px solid var(--dir-border);
  margin: 2px 24px 0;
}
.manual-additional summary {
  color: var(--dir-accent-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  padding: 12px 0;
}
.manual-additional[open] { padding-bottom: 6px; }
.manual-additional .manual-form-grid { padding: 4px 0 12px; }
.manual-selection-field { min-width: 0; }
.manual-selected-values { align-items: center; display: flex; flex-wrap: wrap; gap: 5px; min-height: 25px; padding: 4px 0; }
.manual-selection-empty { color: var(--text-secondary); font-size: 12px; }
.manual-selected-chip {
  align-items: center;
  background: var(--dir-accent-soft);
  border-radius: 4px;
  color: var(--dir-accent-strong);
  display: inline-flex;
  font-size: 11px;
  gap: 4px;
  max-width: 100%;
  padding: 3px 5px 3px 8px;
}
.manual-selected-chip button { background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.manual-multi-picker { border: 1px solid var(--border-subtle); border-radius: var(--dir-radius-sm); margin-top: 4px; }
.manual-multi-picker summary { align-items: center; color: var(--text-primary); cursor: pointer; display: flex; font-size: 12px; justify-content: space-between; list-style: none; min-height: 36px; padding: 0 10px; }
.manual-multi-picker summary::-webkit-details-marker { display: none; }
.manual-multi-picker[open] { background: var(--dir-surface); box-shadow: var(--dir-shadow-sm); }
.manual-multi-panel { border-top: 1px solid var(--dir-border); padding: 8px; }
.manual-multi-panel > input { border: 1px solid var(--border-subtle); border-radius: 4px; box-sizing: border-box; font: inherit; height: 34px; padding: 0 8px; width: 100%; }
.manual-option-list { max-height: 180px; overflow: auto; padding-top: 5px; }
.manual-option-row { align-items: center; border-radius: 4px; color: var(--text-primary); cursor: pointer; display: flex; font-size: 12px; font-weight: 450; gap: 8px; padding: 6px; }
.manual-option-row:hover { background: var(--dir-surface-muted); }
.manual-option-row[hidden] { display: none; }
.manual-workspace .manual-option-row input {
  accent-color: var(--dir-accent-strong);
  display: inline-block;
  flex: 0 0 16px;
  height: 16px;
  margin: 1px 0 0;
  padding: 0;
  width: 16px;
}
.manual-workspace .manual-option-row span { flex: 1; min-width: 0; text-align: left; }
.manual-organization-picker { display: grid; gap: 5px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.manual-organization-picker input, .manual-organization-picker select { margin-top: 0; }
.manual-workspace #manual-contact-warning { margin: 0 24px 8px; }
.manual-workspace #manual-record-form > .actions { border-top: 1px solid var(--dir-border); margin-top: 8px; padding: 12px 24px 16px; }

@media (max-width: 680px) {
  .manual-workspace .manual-form-grid { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; }
  .manual-additional { margin-inline: 16px; }
  .manual-workspace > .panel-head,
  .manual-workspace > .saved-views { padding-inline: 16px; }
  .manual-workspace #manual-options-status,
  .manual-workspace #manual-contact-warning { margin-inline: 16px; }
  .manual-workspace #manual-record-form > .actions { padding-inline: 16px; }
}

@media (max-width: 680px) {
  .activity-dock { left: 16px; right: 16px; width: auto; }
}

.error-state strong,
.error-state small { display: block; margin-bottom: 8px; }
.error-state small { font-weight: 400; }
.error-state .retry-button { margin-top: 6px; }

@media (max-width: 1100px) {
  .directory-intro { display: block; }
  .directory-actions { justify-content: flex-end; margin-top: 15px; }
  .directory-filters { flex-wrap: wrap; }
  .search-box { width: 100%; }
  .search-box.wide { flex-basis: 100%; max-width: none; }
  .listing-summary { align-items: flex-start; gap: 12px; }
  .listing-summary-actions { flex-wrap: wrap; justify-content: flex-end; }
}

/*
 * Below this, a select/button sized to its own content (even shrunk via
 * min-width: 0 above) is often still too cramped to use comfortably, so
 * give each toolbar control its own full-width row instead.
 */
@media (max-width: 560px) {
  .listing-toolbar select,
  .listing-toolbar .filter-button,
  .listing-toolbar .compact-button,
  .listing-toolbar .multiselect {
    flex: 1 1 100%;
  }

  .multiselect-trigger { max-width: none; }
}

@media (max-width: 680px) {
  .directory-actions { flex-wrap: wrap; }
}
.org-record-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
  width: 100%;
}

.org-record-link:hover strong {
  color: var(--dir-accent-strong);
  text-decoration: underline;
}

.detail-back {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: var(--dir-radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px 4px;
  transition: color .15s ease;
}

.detail-back:hover { color: var(--dir-accent-strong); }

.detail-hero {
  align-items: center;
  background: linear-gradient(120deg, #fff 0%, #fff 62%, var(--dir-accent-soft) 100%);
  border-radius: var(--dir-radius-lg);
  box-shadow: var(--dir-shadow-md);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 20px;
  overflow: hidden;
  padding: 26px 28px;
  position: relative;
}

.detail-hero::before {
  background: var(--dir-accent);
  content: "";
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 4px;
}

.detail-hero-main {
  align-items: center;
  display: flex;
  gap: 17px;
  min-width: 0;
}

.detail-company-icon {
  align-items: center;
  background: var(--dir-accent-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--dir-radius-md);
  color: var(--dir-accent-strong);
  display: flex;
  flex: 0 0 52px;
  font-size: 22px;
  height: 52px;
  justify-content: center;
}

.detail-heading-copy { min-width: 0; }

.detail-heading-copy h2 {
  color: var(--text-primary);
  font-size: 27px;
  letter-spacing: -.02em;
  margin: 3px 0 6px;
}

.detail-heading-copy > p:last-child {
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-tabs {
  background: var(--dir-surface-muted);
  border: 1px solid var(--dir-border);
  border-radius: var(--dir-radius-md);
  display: inline-flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 5px;
}

.detail-tabs button {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: var(--dir-radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  transition: background .15s ease, color .15s ease;
}

.detail-tabs button:hover { background: var(--dir-accent-soft); color: var(--ink); }

.detail-tabs button.active {
  background: var(--cta-bg);
  color: #fff;
}

.detail-tab-panel { display: none; }
.detail-tab-panel.active { display: block; }

.detail-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.detail-card {
  border: 1px solid var(--dir-border);
  border-radius: var(--dir-radius-md);
  box-shadow: var(--dir-shadow-sm);
  padding: 0;
  transition: box-shadow .15s ease;
}

.detail-card:hover { box-shadow: var(--dir-shadow-md); }

.detail-card-heading {
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 12px;
  padding: 19px 22px;
}

.detail-card-heading h3 {
  color: var(--text-primary);
  font-size: 16px;
  margin: 0 0 3px;
}

.detail-card-heading p {
  color: var(--text-secondary);
  font-size: 12px;
  margin: 0;
}

.detail-card-icon {
  align-items: center;
  background: var(--dir-accent-soft);
  border-radius: var(--dir-radius-sm);
  color: var(--dir-accent-strong);
  display: inline-flex;
  flex: 0 0 36px;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  height: 36px;
  justify-content: center;
}

.detail-card-icon.profile { background: var(--dir-accent-soft); color: var(--dir-accent-strong); }
.detail-card-icon.contact { background: #e8f7f1; color: #16815c; }
.detail-card-icon.data { background: #fff1e8; color: #b96325; }

.detail-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 8px 22px 16px;
}

.detail-row {
  border-bottom: 1px solid var(--border-subtle);
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 13px 0;
}

.detail-row:last-child { border-bottom: 0; }

.detail-row dt {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .045em;
  line-height: 1.35;
  text-transform: uppercase;
}

.detail-row dd {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}

.detail-row a {
  color: var(--dir-accent-strong);
  display: inline-block;
  max-width: 100%;
  text-decoration: none;
}

.detail-row a:hover { text-decoration: underline; }

.json-nested-list {
  border-left: 2px solid var(--border-subtle);
  font-weight: 500;
  list-style: none;
  margin: 4px 0 0;
  padding: 0 0 0 12px;
}

.json-nested-list li {
  padding: 3px 0;
}

.json-nested-list .json-nested-list {
  margin-top: 6px;
}

.json-nested-list > li:has(> .json-nested-list) {
  border-bottom: 1px dashed var(--border-subtle);
  margin-bottom: 6px;
  padding-bottom: 6px;
}

.json-nested-list > li:has(> .json-nested-list):last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 3px;
}

.detail-list-columns {
  column-gap: 34px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-list-columns .detail-row:nth-last-child(-n+2) { border-bottom: 0; }

#detail-all-data .detail-card { overflow: hidden; }

#detail-all-fields {
  background: var(--dir-surface-muted);
  display: block;
  padding: 20px 22px 24px;
}

.information-group {
  background: var(--dir-surface);
  border: 1px solid var(--dir-border);
  border-radius: var(--dir-radius-md);
  margin-bottom: 18px;
  overflow: hidden;
}

.information-group:last-child { margin-bottom: 0; }

.information-group-heading {
  border-bottom: 1px solid var(--border-subtle);
  padding: 17px 20px 15px;
}

.information-group-heading h4 {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
}

.information-group-heading p {
  color: var(--text-secondary);
  font-size: 12px;
  margin: 0;
}

.information-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 6px 20px 10px;
}

#detail-all-fields .information-field-grid .detail-row {
  background: var(--dir-surface);
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  min-height: 70px;
  padding: 15px 0;
}

#detail-all-fields .information-field-grid .detail-row:nth-child(odd) {
  padding-right: 22px;
}

#detail-all-fields .information-field-grid .detail-row:nth-child(even) {
  border-left: 1px solid var(--border-subtle);
  padding-left: 22px;
}

#detail-all-fields .information-field-grid .detail-row:nth-last-child(-n+2) {
  border-bottom: 0;
}

#detail-all-fields .detail-row dt {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 7px;
  text-transform: uppercase;
}

#detail-all-fields .detail-row dd {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .detail-grid,
  .detail-list-columns {
    grid-template-columns: 1fr;
  }

  .detail-list-columns .detail-row {
    border-bottom: 1px solid var(--border-subtle);
  }

  .information-field-grid {
    grid-template-columns: 1fr;
  }

  #detail-all-fields .information-field-grid .detail-row:nth-child(odd),
  #detail-all-fields .information-field-grid .detail-row:nth-child(even) {
    border-left: 0;
    border-bottom: 1px solid var(--border-subtle);
    padding-left: 0;
    padding-right: 0;
  }

  #detail-all-fields .information-field-grid .detail-row:last-child {
    border-bottom: 0;
  }

  .detail-list-columns .detail-row:last-child { border-bottom: 0; }
}

@media (max-width: 720px) {
  .detail-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }

  .detail-hero .directory-actions { margin-top: 0; width: 100%; }
  .detail-hero .directory-actions button { flex: 1; }
  .detail-company-icon { display: none; }
  .detail-tabs { display: flex; overflow-x: auto; width: 100%; }
  .detail-tabs button { flex: 1 0 auto; }
  .detail-card-heading { padding: 17px 18px; }
  .detail-list { padding: 7px 18px 14px; }
}

/* ---------------- RocketReach search coverage (multi-value searches) ----------------
   Which of the user's search values found results (exact per-value
   counts), plus per-row tags showing which value each result matched. */
.loader-img-sm { height: 22px; width: 22px; }

.rr-coverage {
  background: var(--dir-surface-muted);
  border: 1px solid var(--dir-border);
  border-radius: var(--dir-radius-md);
  margin: 14px 22px;
  padding: 14px 16px;
}
.rr-coverage-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}
.rr-coverage-missing { color: var(--red); }
.rr-coverage-groups {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
/* min-width: 0 so a long value truncates with an ellipsis instead of
   widening its grid column over the next field group. */
.rr-coverage-group { min-width: 0; }
.rr-coverage-csv:disabled { cursor: not-allowed; opacity: .5; }
.rr-coverage-group h4 {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .06em;
  margin: 0 0 6px;
  text-transform: uppercase;
}
.rr-coverage-group ul { display: grid; gap: 4px; grid-template-columns: minmax(0, 1fr); list-style: none; margin: 0; padding: 0; }
.rr-coverage-group li {
  align-items: center;
  background: var(--dir-surface);
  border: 1px solid var(--dir-border);
  border-radius: var(--dir-radius-sm);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 6px 10px;
}
.rr-coverage-group li.is-missing { border-color: #efc2c0; background: #fdf3f2; }
.rr-coverage-value { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-coverage-pill { border-radius: 20px; flex: none; font-size: 12px; font-weight: 700; padding: 2px 9px; }
.rr-coverage-pill.found { background: var(--dir-accent-soft); color: var(--dir-accent-strong); }
.rr-coverage-pill.not-found { background: #fbe3e2; color: #a8322e; }
.rr-coverage-pill.checking,
.rr-coverage-pill.muted { background: var(--dir-surface-sunk); color: var(--muted); }
.rr-coverage-pill.error { background: #fff3dc; color: #8a5a00; }
.rr-coverage-note { color: var(--muted); font-size: 12px; margin: 12px 0 0; }

.rr-input-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rr-input-tag {
  background: var(--dir-accent-soft);
  border-radius: 20px;
  color: var(--dir-accent-strong);
  font-size: 11px;
  font-weight: 700;
  max-width: 220px;
  overflow: hidden;
  padding: 1px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rr-input-tag.approx { background: var(--dir-surface-sunk); color: var(--text-secondary); }
