.smart-search-shell {
  display: grid;
  gap: 12px;
}

.smart-search-top {
  background: #ffffff;
  border: 1px solid #dfe7f1;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 8px 26px rgba(27, 42, 67, 0.08);
  position: relative;
  z-index: 10;
}

.search-input-wrap {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(220px, 280px) 120px 120px;
  gap: 10px;
}

.search-input-wrap input {
  border: 1px solid #c9d6e5;
  border-radius: 999px;
  padding: 12px 16px;
  font: inherit;
}

.smart-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  background: #ffffff;
  border: 1px solid #dfe7f1;
  border-radius: 12px;
  padding: 10px;
}

.smart-filters input,
.smart-filters select {
  width: 100%;
  padding: 10px;
  border: 1px solid #c9d6e5;
  border-radius: 8px;
}

.smart-filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #445974;
  font-size: 0.9rem;
}

.search-layout {
  display: grid;
  grid-template-columns: minmax(420px, 46%) minmax(540px, 54%);
  gap: 12px;
  min-height: 68vh;
  align-items: start;
}

.mobile-view-toggle {
  display: none;
  gap: 8px;
}

.search-list-pane,
.search-map-pane {
  background: #ffffff;
  border: 1px solid #dfe7f1;
  border-radius: 12px;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}

.search-list-pane {
  display: flex;
  flex-direction: column;
}

.search-map-pane {
  display: flex;
  flex-direction: column;
}

.search-map-pane #smart-search-map {
  flex: 1 1 auto;
  min-height: 540px;
}

.search-list-head {
  padding: 12px;
  border-bottom: 1px solid #e4ecf7;
}

.search-list-head h2 {
  margin: 0;
}

.search-list-head p {
  margin: 4px 0 8px;
  color: #5f7087;
}

.results-cards {
  display: grid;
  gap: 10px;
  padding: 12px;
  max-height: 72vh;
  overflow: auto;
}

.result-card {
  border: 1px solid #e1e9f4;
  border-radius: 10px;
  padding: 12px;
  background: #fbfdff;
}

.result-card.active {
  border-color: #1d7ef3;
  box-shadow: 0 0 0 2px rgba(29, 126, 243, 0.16);
}

.result-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.result-card h3 {
  margin: 0;
}

.result-score {
  background: #e9f3ff;
  color: #1d7ef3;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.result-meta,
.result-distance {
  color: #5c6f88;
  margin: 4px 0;
}

.result-desc {
  color: #2a3b55;
}

.result-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  border-radius: 999px;
  background: #eef3fb;
  color: #48658a;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge.verified {
  background: #e8f7ed;
  color: #0f9f44;
}

.badge.claimed {
  background: #ecf3ff;
  color: #1d7ef3;
}

.result-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.results-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e4ecf7;
}

.results-pagination button {
  border: 1px solid #cbd8eb;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
}

.search-empty {
  padding: 18px;
  color: #516781;
}

.search-empty ul {
  margin: 8px 0 0;
}

.autocomplete-panel {
  margin-top: 8px;
  border: 1px solid #d8e3f2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(35, 52, 81, 0.12);
  overflow: hidden;
}

.autocomplete-group {
  padding: 8px 10px;
  border-bottom: 1px solid #eef3fb;
}

.autocomplete-group h4 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: #5f728d;
  text-transform: uppercase;
}

.autocomplete-item {
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.autocomplete-item:hover {
  background: #eef5ff;
}

@media (max-width: 1024px) {
  .search-input-wrap {
    grid-template-columns: 1fr 1fr;
  }
  .smart-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .search-layout {
    grid-template-columns: 1fr;
  }
  .mobile-view-toggle {
    display: flex;
  }
  .search-layout.show-list-only .search-map-pane {
    display: none;
  }
  .search-layout.show-map-only .search-list-pane {
    display: none;
  }
}

/* Modern search experience */
.smart-search-shell {
  gap: 18px;
}

.smart-search-top {
  padding: clamp(14px, 1.8vw, 22px);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, .10), transparent 36%),
    rgba(255, 255, 255, .88);
}

.search-input-wrap {
  align-items: center;
}

.search-input-wrap input,
.smart-filters input,
.smart-filters select {
  min-height: 46px;
  background: rgba(255, 255, 255, .92);
  border-color: rgba(148, 163, 184, .34);
  box-shadow: inset 0 1px rgba(255,255,255,.9);
}

.smart-filters {
  padding: 14px;
  gap: 10px;
  border-radius: 24px;
}

.search-layout {
  gap: 18px;
}

.search-list-pane,
.search-map-pane {
  border-radius: 28px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .10);
}

.search-list-head {
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(248,250,252,.94), rgba(255,255,255,.7));
}

.results-cards {
  gap: 12px;
  padding: 16px;
}

.result-card {
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .055);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.result-card:hover,
.result-card.active {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, .36);
  box-shadow: 0 16px 36px rgba(37, 99, 235, .10);
}

.result-score,
.result-tags span,
.filter-chip,
.autocomplete-item {
  border-radius: 999px;
}

.autocomplete-group {
  padding: 6px;
}

.autocomplete-item:hover {
  background: rgba(37, 99, 235, .08);
  color: #1d4ed8;
}

@media (max-width: 980px) {
  .search-input-wrap,
  .smart-filters,
  .search-layout {
    grid-template-columns: 1fr;
  }
  .search-map-pane #smart-search-map {
    min-height: 420px;
  }
}

/* Companies directory: Google Maps workspace with LinkedIn-style company cards. */
body.app-body .app-content:has(.smart-search-shell) {
  max-width: none;
  padding: 18px;
}

.smart-search-shell {
  --surface: #ffffff;
  --surface-soft: #f8fafd;
  --line: #dadce0;
  --line-soft: #e8eaed;
  --text: #202124;
  --muted: #5f6368;
  --blue: #1a73e8;
  --green: #188038;
  --yellow: #f9ab00;
  --shadow: 0 1px 2px rgba(60, 64, 67, .18), 0 2px 8px rgba(60, 64, 67, .08);
  display: grid;
  gap: 12px;
  color: var(--text);
}

.companies-discovery-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
}

.companies-discovery-header h1 {
  margin: 2px 0 4px;
  color: var(--text);
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1.05;
  letter-spacing: 0;
}

.companies-discovery-header p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.companies-kicker,
.panel-kicker {
  display: block;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.companies-view-mode {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.companies-view-mode button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.companies-view-mode button.active {
  background: #e8f0fe;
  color: #174ea6;
}

.smart-search-top {
  position: sticky;
  top: 62px;
  z-index: 16;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.search-input-wrap {
  display: grid;
  grid-template-columns: minmax(280px, 1.3fr) minmax(220px, .72fr) auto auto;
  gap: 8px;
  align-items: center;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f1f3f4;
}

.search-field:focus-within {
  border-color: #aecbfa;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, .13);
}

.field-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex: 0 0 auto;
}

.field-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.search-input-wrap input {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  outline: 0;
  box-shadow: none;
}

.search-input-wrap .btn {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 18px;
  box-shadow: none;
  white-space: nowrap;
}

.search-input-wrap .btn.soft {
  border: 1px solid transparent;
  background: #e8f0fe;
  color: #174ea6;
}

.smart-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filter-control {
  display: grid;
  gap: 4px;
  flex: 1 1 160px;
  min-width: 142px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-control span {
  padding-left: 2px;
}

.filter-control input,
.filter-control select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 11px;
  color: var(--text);
  box-shadow: none;
}

.filter-control input:focus,
.filter-control select:focus {
  border-color: #aecbfa;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, .13);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: #3c4043;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip input {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
}

.filter-chip:has(input:checked) {
  border-color: #aecbfa;
  background: #e8f0fe;
  color: #174ea6;
}

.search-layout {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 12px;
  min-height: calc(100vh - 250px);
  align-items: stretch;
}

.search-list-pane,
.search-map-pane {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-list-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.search-map-pane {
  position: sticky;
  top: 128px;
  display: grid;
  grid-template-rows: auto minmax(480px, 1fr);
  height: calc(100vh - 148px);
  min-height: 620px;
}

.search-list-head,
.map-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

.search-list-head h2,
.map-view-head h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: 0;
}

.search-list-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search-list-head .btn {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  white-space: nowrap;
}

.results-cards {
  display: grid;
  gap: 10px;
  max-height: none;
  height: 100%;
  padding: 12px;
  overflow: auto;
  background: #f8fafd;
}

.result-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.result-card:hover,
.result-card.active {
  transform: translateY(-1px);
  border-color: #aecbfa;
  box-shadow: 0 2px 8px rgba(60, 64, 67, .16);
}

.result-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.result-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e8f0fe, #e6f4ea);
  color: #174ea6;
  font-size: 17px;
  font-weight: 800;
}

.result-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: 0;
}

.result-score {
  align-self: start;
  min-width: 44px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e6f4ea;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.result-meta,
.result-location,
.result-desc,
.result-services {
  margin: 0;
}

.result-meta,
.result-location {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.result-location {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f1f3f4;
}

.result-desc {
  color: #3c4043;
  font-size: 14px;
  line-height: 1.45;
}

.company-rating-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.company-rating-inline span {
  color: var(--yellow);
}

.company-rating-inline b {
  color: var(--text);
}

.result-services {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.result-services b {
  color: var(--text);
  font-size: 12px;
}

.result-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f1f3f4;
  color: #3c4043;
  font-size: 12px;
  font-weight: 700;
}

.badge.verified {
  background: #e6f4ea;
  color: var(--green);
}

.badge.claimed {
  background: #e8f0fe;
  color: #174ea6;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.result-actions .btn {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

.result-actions .btn.soft {
  background: #e8f0fe;
  color: #174ea6;
}

.result-actions .btn.quiet {
  border: 1px solid var(--line);
  background: var(--surface);
  color: #3c4043;
}

.result-actions .btn.quiet:hover {
  background: #f8fafd;
  color: var(--blue);
}

.results-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}

.results-pagination button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: #3c4043;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
}

.results-pagination button:disabled {
  cursor: default;
  opacity: .62;
}

.search-empty {
  margin: 12px;
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.search-empty h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
}

.search-empty p,
.search-empty ul {
  margin: 0;
}

.search-empty ul {
  padding-left: 18px;
  margin-top: 8px;
}

.autocomplete-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 10px;
  right: 10px;
  z-index: 20;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(60, 64, 67, .22);
}

.autocomplete-group {
  padding: 8px;
}

.autocomplete-group h4 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .06em;
}

.autocomplete-item {
  padding: 8px 10px;
  border-radius: 8px;
}

.autocomplete-item:hover {
  background: #e8f0fe;
  color: #174ea6;
}

.mobile-view-toggle {
  display: none;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.mobile-view-toggle .btn {
  flex: 1 1 0;
  min-height: 38px;
  border-radius: 999px;
}

@media (max-width: 1180px) {
  .search-layout {
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  }

  .result-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body.app-body .app-content:has(.smart-search-shell) {
    padding: 12px;
  }

  .companies-discovery-header {
    align-items: start;
    flex-direction: column;
  }

  .companies-view-mode {
    width: 100%;
    justify-content: space-between;
  }

  .search-input-wrap {
    grid-template-columns: 1fr;
  }

  .smart-search-top {
    top: 0;
  }

  .smart-filters {
    align-items: stretch;
  }

  .filter-control,
  .filter-chip {
    flex: 1 1 calc(50% - 8px);
  }

  .search-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .mobile-view-toggle {
    display: flex;
  }

  .search-layout.show-list-only .search-map-pane {
    display: none;
  }

  .search-layout.show-map-only .search-list-pane {
    display: none;
  }

  .search-map-pane {
    position: static;
    height: auto;
    min-height: 0;
  }

  .search-map-pane #smart-search-map {
    min-height: 460px;
  }

  .results-cards {
    height: auto;
    max-height: none;
  }
}

@media (max-width: 620px) {
  .filter-control,
  .filter-chip {
    flex-basis: 100%;
  }

  .search-list-head,
  .map-view-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-card-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .result-score {
    grid-column: 2;
    justify-self: start;
  }
}

/* LinkedIn-style companies directory */
body.app-body .app-content:has(.smart-search-shell) {
  max-width: none;
  min-height: calc(100vh - 56px);
  padding: 16px clamp(14px, 2vw, 28px);
  background: #f4f2ee;
}

.smart-search-shell {
  --surface: #fff;
  --surface-soft: #f3f6f8;
  --line: #d6d3ce;
  --line-soft: #e4e0dc;
  --text: rgba(0, 0, 0, .9);
  --muted: rgba(0, 0, 0, .6);
  --blue: #0a66c2;
  --blue-dark: #004182;
  --green: #057642;
  --shadow: none;
  max-width: 1440px;
  margin: 0 auto;
  gap: 12px;
}

.companies-discovery-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  min-height: auto;
  padding: 4px 0 2px;
}

.companies-kicker,
.panel-kicker {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}

.companies-discovery-header h1 {
  margin: 3px 0 2px;
  color: var(--text);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
}

.companies-discovery-header p {
  max-width: 760px;
  color: var(--muted);
  font-size: 14px;
}

.companies-view-mode {
  gap: 0;
  padding: 3px;
  border-color: var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: none;
}

.companies-view-mode button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.companies-view-mode button.active {
  background: #e8f3ff;
  color: var(--blue);
}

.smart-search-top {
  position: sticky;
  top: 60px;
  z-index: 18;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: none;
}

.search-input-wrap {
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 320px) auto auto;
  gap: 8px;
}

.search-field {
  min-height: 42px;
  border-color: transparent;
  border-radius: 4px;
  background: #eef3f8;
}

.search-field:focus-within {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 1px var(--blue);
}

.search-input-wrap input {
  min-height: 40px;
  font-size: 14px;
}

.search-input-wrap .btn {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 700;
}

.search-input-wrap .btn:not(.soft) {
  background: var(--blue);
  color: #fff;
}

.search-input-wrap .btn:not(.soft):hover {
  background: var(--blue-dark);
}

.search-input-wrap .btn.soft {
  border-color: #a8c7e8;
  background: transparent;
  color: var(--blue);
}

.search-layout {
  display: grid;
  grid-template-columns: 280px minmax(460px, 1fr) 360px;
  gap: 16px;
  align-items: start;
  min-height: 0;
}

.view-companies .search-layout {
  grid-template-columns: 280px minmax(0, 1fr);
}

.view-companies .search-recommended-pane {
  display: none;
}

.workspace-sort-bar {
  display: none;
}

.view-network .search-layout {
  grid-template-columns: 280px minmax(0, 1fr);
}

.view-network .search-recommended-pane,
.view-competitors .search-recommended-pane {
  grid-column: 2;
}

.view-network .search-list-pane,
.view-competitors .search-list-pane {
  display: none;
}

.view-competitors .search-layout {
  grid-template-columns: 280px minmax(0, 1fr);
}

.view-network .company-filter-rail,
.view-competitors .company-filter-rail {
  display: none;
}

.view-network .workspace-sort-bar,
.view-competitors .workspace-sort-bar {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 1;
  justify-content: flex-end;
  padding: 0;
}

.workspace-sort-bar label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.workspace-sort-bar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.workspace-sort-bar select {
  min-height: 34px;
  min-width: 210px;
  border: 1px solid #cfd8e3;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.company-filter-rail,
.search-map-pane {
  position: sticky;
  top: 128px;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.linkedin-side-card,
.smart-filters,
.search-list-pane,
.search-map-pane > .map-view-head,
.search-map-pane > #smart-search-map,
.market-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: none;
}

.linkedin-side-card {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.linkedin-side-card h2,
.linkedin-side-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.linkedin-side-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.linkedin-side-card.compact {
  padding: 12px 16px;
}

.linkedin-side-card.compact a {
  display: block;
  padding: 8px 0;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.smart-filters {
  display: grid;
  gap: 0;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.filter-control {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
}

.filter-control:first-child {
  border-top: 0;
}

.filter-control input,
.filter-control select {
  min-height: 38px;
  border-color: var(--line);
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
}

.filter-control input:focus,
.filter-control select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.filter-chip {
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.filter-chip:has(input:checked) {
  border-color: var(--line-soft);
  background: #e8f3ff;
  color: var(--blue);
}

.search-list-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
}

.search-list-head {
  min-height: 76px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

.search-list-head h2 {
  font-size: 20px;
  font-weight: 600;
}

.search-list-head p {
  color: var(--muted);
  font-size: 13px;
}

.results-cards {
  height: auto;
  max-height: none;
  padding: 0;
  gap: 0;
  overflow: visible;
  background: transparent;
}

.result-card {
  gap: 10px;
  padding: 18px 20px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  background: #fff;
}

.result-card:hover,
.result-card.active {
  transform: none;
  border-color: var(--line-soft);
  box-shadow: inset 3px 0 0 var(--blue);
}

.result-card-head {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.result-avatar {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #e8f3ff;
  color: var(--blue);
  font-size: 22px;
}

.result-card h3 {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.result-card h3:hover {
  color: var(--blue);
  text-decoration: underline;
}

.result-score {
  background: #edf7f0;
  color: var(--green);
}

.result-location {
  display: block;
  width: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.result-desc {
  color: var(--text);
  font-size: 14px;
}

.result-services {
  border-radius: 6px;
  background: #f8fafc;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-actions .btn {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 16px;
}

.result-actions .btn.soft {
  background: var(--blue);
  color: #fff;
}

.result-actions .btn.soft:hover {
  background: var(--blue-dark);
}

.result-actions .btn.quiet {
  border: 1px solid var(--blue);
  background: #fff;
  color: var(--blue);
}

.result-actions .btn.quiet:hover {
  border-color: var(--blue-dark);
  background: #eef3f8;
  color: var(--blue-dark);
}

.results-pagination {
  border-top: 1px solid var(--line-soft);
}

.search-empty {
  margin: 16px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.search-map-pane {
  grid-template-rows: auto minmax(240px, 280px) auto;
  height: auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.search-map-pane > .map-view-head {
  display: grid;
  gap: 10px;
  min-height: 0;
  padding: 14px 16px;
  border-bottom: 0;
}

.search-map-pane #smart-search-map {
  height: 280px;
  min-height: 280px;
  border-top: 0;
  border-radius: 8px;
}

.map-search-legend {
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.map-view-head .btn {
  justify-self: start;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  border-color: var(--blue);
  color: var(--blue);
}

.market-card {
  margin-top: 0;
}

.mobile-view-toggle {
  display: none;
}

@media (max-width: 1280px) {
  .view-companies .search-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .view-network .search-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .view-competitors .search-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .search-layout {
    grid-template-columns: 260px minmax(420px, 1fr) 320px;
    gap: 12px;
  }
}

@media (max-width: 1080px) {
  .search-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .search-map-pane {
    position: static;
    grid-column: 1 / -1;
    grid-template-rows: auto minmax(320px, 360px) auto;
  }

  .search-map-pane #smart-search-map {
    height: 360px;
    min-height: 360px;
  }
}

@media (max-width: 820px) {
  body.app-body .app-content:has(.smart-search-shell) {
    padding: 12px;
  }

  .companies-discovery-header,
  .search-layout,
  .search-input-wrap {
    grid-template-columns: 1fr;
  }

  .companies-view-mode {
    width: 100%;
  }

  .company-filter-rail,
  .search-map-pane {
    position: static;
  }

  .mobile-view-toggle {
    display: flex;
  }

  .search-layout.show-list-only .search-recommended-pane {
    display: none;
  }

  .search-layout.show-recommended-only .search-list-pane,
  .search-layout.show-recommended-only .company-filter-rail {
    display: none;
  }
}

@media (max-width: 560px) {
  .result-card-head {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .result-avatar {
    width: 48px;
    height: 48px;
    font-size: 19px;
  }

  .result-score {
    grid-column: 2;
    justify-self: start;
  }
}

/* Companies workspace: companies/recommendation tabs with shared LinkedIn styling. */
.companies-page-tabs {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.companies-page-tabs button {
  min-width: 124px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.companies-page-tabs button:hover {
  background: #eef3f8;
  color: var(--blue);
}

.companies-page-tabs button.active {
  background: var(--blue);
  color: #fff;
}

.result-network-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.result-network-line span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.result-network-line span:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-left: 2px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
}

.view-recommended .search-layout {
  grid-template-columns: 280px minmax(520px, 1fr) 380px;
}

.view-recommended .company-filter-rail {
  grid-column: 1;
}

.view-recommended .search-recommended-pane {
  grid-column: 2;
  grid-row: 1;
}

.view-recommended .search-list-pane {
  grid-column: 3;
  grid-row: 1;
}

.view-recommended .search-list-head h2 {
  font-size: 17px;
}

.view-recommended .search-list-head {
  min-height: 68px;
  padding: 14px 16px;
}

.view-recommended .result-card {
  padding: 14px 16px;
}

.view-recommended .result-card-head {
  grid-template-columns: 44px minmax(0, 1fr);
}

.view-recommended .result-avatar {
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.view-recommended .result-score {
  grid-column: 2;
  justify-self: start;
}

.view-recommended .result-actions {
  gap: 6px;
}

.view-recommended .result-actions .btn {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.map-compat-hidden {
  display: none;
}

@media (max-width: 1280px) {
  .view-recommended .search-layout {
    grid-template-columns: 260px minmax(460px, 1fr) 320px;
  }
}

@media (max-width: 1080px) {
  .view-recommended .search-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .view-recommended .search-recommended-pane {
    grid-column: 2;
    min-height: 0;
  }

  .view-recommended .search-list-pane {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 820px) {
  .companies-page-tabs {
    display: flex;
    width: 100%;
  }

  .companies-page-tabs button {
    flex: 1 1 0;
    min-width: 0;
  }

  .view-recommended .search-layout {
    grid-template-columns: 1fr;
  }

  .view-recommended .search-recommended-pane,
  .view-recommended .search-list-pane {
    grid-column: 1;
  }

  .view-network .search-list-pane,
  .view-competitors .search-list-pane {
    display: none;
  }

  .view-recommended .search-recommended-pane {
    grid-row: 1;
  }

  .view-recommended .search-list-pane {
    grid-row: 2;
  }
}

.search-recommended-pane {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 132px);
  overflow: auto;
}

.recommendation-header-card h3 {
  margin: 4px 0 6px;
}

.recommended-results-list {
  display: grid;
  gap: 10px;
}

.network-chipbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 2px;
}

.network-chip {
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid #ccd7e4;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  padding-left: 30px;
}

.network-chip.is-active {
  border-color: #9dbbe3;
  background: #eef5ff;
  color: #0a66c2;
  box-shadow: none;
}

.network-chip::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: #7b8796;
}

.network-chip[data-network-filter="all"]::before { background: #6b7c93; }
.network-chip[data-network-filter="verified"]::before { background: #10b981; }
.network-chip[data-network-filter="claimed"]::before { background: #f97316; }
.network-chip[data-network-filter="high_match"]::before { background: #3b82f6; }
.network-chip[data-network-filter="favorites"]::before { background: #ef476f; }

.recommended-card {
  border: 1px solid #d7e0eb;
  border-radius: 12px;
  background: #fff;
  padding: 0;
  box-shadow: none;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.recommended-card:hover {
  border-color: #b9cbe2;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .06);
}

.recommended-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid #e4ebf4;
  border-radius: 12px 12px 0 0;
  background: #f8fbff;
}

.recommended-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.recommended-card[data-tone="good"] .recommended-head {
  background: #f8fbff;
}
.recommended-card[data-tone="warn"] .recommended-head {
  background: #f8fbff;
}

.recommended-head h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recommended-card-tools {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.recommended-icon-btn,
.recommended-action-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
}

.recommended-icon-btn.is-active,
.recommended-icon-btn.is-favorite,
.recommended-icon-btn:hover,
.recommended-action-icon:hover {
  border-color: #9dbbe3;
  background: #eef5ff;
  color: #0a66c2;
}

.recommended-icon-btn.is-favorite {
  border-color: #f4b4c4;
  background: #fff1f4;
  color: #d61f4c;
}

.recommended-icon-btn svg,
.recommended-action-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.recommended-score {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf4ff;
  border: 1px solid #c9d9ef;
  color: #0b66c2;
  font-weight: 700;
  font-size: 12px;
}

.recommended-score-good {
  background: #edf4ff;
  border-color: #c9d9ef;
  color: #0b66c2;
}

.recommended-score-warn {
  background: #edf4ff;
  border-color: #c9d9ef;
  color: #0b66c2;
}

.recommended-score-neutral {
  background: #edf4ff;
  border-color: #c9d9ef;
  color: #0b66c2;
}

.recommended-meta {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  padding: 0 14px;
}

.recommended-label {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 12px;
  color: #1f2937;
}

.recommended-benefits {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  color: #334155;
  font-size: 13px;
}

.recommended-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
}

.recommended-compact-hint {
  margin: 8px 0;
  color: #64748b;
  font-size: 11px;
  padding: 0 14px;
}

.recommended-group {
  border: 1px solid #d6e0ec;
  border-radius: 16px;
  background: #f2f7ff;
  padding: 14px;
}

.recommended-group h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.recommended-group > div {
  display: grid;
  gap: 8px;
}

.view-network .recommended-group > div,
.view-competitors .recommended-group > div {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.view-network .recommended-group,
.view-competitors .recommended-group {
  border-radius: 16px;
  background: #f2f7ff;
  border-color: #d0ddea;
}

.view-network .recommended-head h4,
.view-competitors .recommended-head h4 {
  font-size: 14px;
  letter-spacing: .01em;
}

.view-network .recommended-score,
.view-competitors .recommended-score {
  min-height: 24px;
  padding: 0 9px;
  font-size: 11px;
}

.view-network .recommended-actions .btn,
.view-competitors .recommended-actions .btn {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
}

.recommended-why {
  margin: 0 0 8px;
  color: #475569;
  font-size: 13px;
}

.company-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
}

.company-detail-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .42);
}

.company-detail-modal__panel {
  position: relative;
  width: min(760px, calc(100vw - 28px));
  max-height: min(700px, calc(100vh - 36px));
  overflow: auto;
  margin: 10px auto;
  padding: 0;
  border-radius: 14px;
  border: 1px solid #d9e2ec;
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .22);
}

.company-detail-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.company-detail-modal__header-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.company-detail-modal__status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #94a3b8;
}

.company-detail-modal__status-dot.is-good {
  background: #10b981;
}

.company-detail-modal__status-dot.is-warn {
  background: #f59e0b;
}

.company-detail-modal__status-dot.is-neutral {
  background: #60a5fa;
}

.company-detail-modal__header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 28px;
  line-height: 1.12;
}

.company-detail-modal__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.company-detail-modal__match {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eaf3ff;
  border: 1px solid #b8d1f1;
  color: #0a66c2;
  font-weight: 700;
  font-size: 13px;
}

.company-detail-modal__header .btn.soft {
  border-color: #b8d1f1;
  background: #f7fbff;
  color: #0a66c2;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
}

.company-detail-modal__close {
  position: static;
  width: 32px;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.company-detail-modal__meta {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 14px;
}

.company-detail-modal__status-strip {
  margin: 8px 12px 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #dbe7f4;
  border-radius: 10px;
  background: #f8fbff;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.company-detail-modal__summary {
  margin: 8px 12px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.company-detail-summary-row {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #64748b;
  font-size: 13px;
}

.company-detail-summary-row b {
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.company-detail-modal .recommended-why {
  margin: 10px 16px 0;
  color: #64748b;
  font-size: 14px;
}

.company-detail-modal .recommended-benefits {
  margin: 6px 16px 0;
  color: #334155;
  font-size: 14px;
}

.company-detail-modal .recommended-actions {
  margin: 8px 12px 10px;
}

.company-detail-modal .recommended-actions .btn {
  border-radius: 999px;
  min-height: 34px;
  font-size: 13px;
}

.company-detail-modal .recommended-actions .btn.quiet {
  border-color: #cbd5e1;
  color: #334155;
  background: #fff;
}

@media (max-width: 1160px) {
  .company-detail-modal__summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .company-detail-modal__header h3 {
    font-size: 24px;
  }
  .company-detail-modal__header {
    flex-direction: column;
    align-items: stretch;
  }
  .company-detail-modal__header-actions {
    flex-wrap: wrap;
  }
  .company-detail-modal__status-strip,
  .company-detail-modal__summary,
  .company-detail-modal .recommended-why,
  .company-detail-modal .recommended-benefits,
  .company-detail-modal .recommended-actions {
    margin-left: 12px;
    margin-right: 12px;
  }
}

body.modal-open {
  overflow: hidden;
}

/* LinkedIn-like filter rail: compact, high-contrast, and easy to scan. */
.company-filter-rail {
  top: 116px;
}

.company-filter-rail .linkedin-side-card:first-child {
  border-color: #c9d8e8;
  background: #fff;
}

.smart-filters {
  border-color: #c9d8e8;
  background: #fff;
}

.filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #f8fafc;
}

.filter-panel-head strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.filter-panel-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.filter-panel-head button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #0a66c2;
  border-radius: 999px;
  background: #fff;
  color: #0a66c2;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.filter-panel-head button:hover {
  background: #eef3f8;
}

.filter-control {
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
}

.filter-control span {
  color: #52677f;
  font-size: 13px;
  font-weight: 700;
}

.filter-control input,
.filter-control select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

.filter-control select {
  cursor: pointer;
}

.filter-chip {
  min-height: 46px;
  padding: 0 16px;
  border-top: 1px solid var(--line-soft);
  background: #fff;
  font-weight: 700;
}

.filter-chip input {
  accent-color: #0a66c2;
}

.filter-chip:has(input:checked) {
  background: #e8f3ff;
  color: #0a66c2;
  box-shadow: inset 3px 0 0 #0a66c2;
}

@media (max-width: 820px) {
  .filter-control {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.view-network.view-recommended .search-layout,
.view-competitors.view-recommended .search-layout {
  grid-template-columns: minmax(0, 1fr);
}

.view-network.view-recommended .search-recommended-pane,
.view-competitors.view-recommended .search-recommended-pane {
  grid-column: 1;
  grid-row: 2;
}

.view-network.view-recommended .search-list-pane,
.view-competitors.view-recommended .search-list-pane {
  display: none;
}

@media (max-width: 1280px) {
  .view-network.view-recommended .search-layout,
  .view-competitors.view-recommended .search-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .view-network.view-recommended .search-layout,
  .view-competitors.view-recommended .search-layout {
    grid-template-columns: 1fr;
  }

  .view-network.view-recommended .search-recommended-pane,
  .view-competitors.view-recommended .search-recommended-pane {
    grid-column: 1;
  }
}

/* Compact company filters: visible without long left-rail scrolling. */
.view-companies .workspace-sort-bar {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-end;
}

.view-companies .company-filter-rail {
  grid-column: 1;
  grid-row: 1;
}

.view-companies .search-list-pane {
  grid-column: 2;
  grid-row: 1;
}

.company-filter-rail {
  gap: 10px;
}

.company-filter-rail .linkedin-side-card:first-child {
  gap: 4px;
  padding: 12px 14px;
}

.company-filter-rail .linkedin-side-card:first-child p {
  font-size: 12px;
  line-height: 1.3;
}

.company-filter-rail .smart-filters {
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  overflow: visible;
}

.company-filter-rail .filter-panel-head {
  margin: -10px -10px 0;
  padding: 10px 12px;
  border-radius: 12px 12px 0 0;
}

.company-filter-rail .filter-control {
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #f8fafc;
}

.company-filter-rail .filter-control:first-child {
  border-top: 1px solid #d9e2ec;
}

.company-filter-rail .filter-control input,
.company-filter-rail .filter-control select {
  width: 100%;
  min-height: 36px;
  border-radius: 8px;
}

.filter-pill-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 2px;
}

.filter-pill-group .filter-chip {
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
}

.filter-pill-group .filter-chip input {
  width: 14px;
  height: 14px;
}

.filter-pill-group .filter-chip:has(input:checked) {
  border-color: #0a66c2;
  background: #e8f3ff;
  box-shadow: none;
}

@media (max-width: 820px) {
  .view-companies .workspace-sort-bar,
  .view-companies .company-filter-rail,
  .view-companies .search-list-pane {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Modern LinkedIn-style discovery header. */
.companies-discovery-header {
  grid-template-columns: minmax(0, 1fr);
  max-width: 900px;
  padding-top: 10px;
}

.companies-discovery-header h1 {
  max-width: 820px;
  font-size: clamp(30px, 3vw, 42px);
  letter-spacing: 0;
}

.companies-discovery-header p {
  max-width: 780px;
  font-size: 16px;
  line-height: 1.45;
}

.smart-search-top {
  position: relative;
  top: auto;
  padding: 14px;
  border-color: #d6e2f0;
  border-radius: 18px;
  background: #f7fbff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
}

.search-input-wrap {
  grid-template-columns: minmax(260px, 1.3fr) minmax(220px, .7fr) auto auto;
  gap: 12px;
}

.search-field {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #edf3f8;
}

.search-input-wrap input {
  min-height: 46px;
}

.search-input-wrap .btn {
  min-height: 48px;
}

.companies-workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
}

.companies-page-tabs {
  width: auto;
  padding: 4px;
  border-color: #d6d3ce;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.companies-page-tabs button {
  min-width: 132px;
  min-height: 40px;
  border-radius: 999px;
  color: rgba(0, 0, 0, .68);
  font-size: 14px;
}

.companies-page-tabs button.active {
  background: #0a66c2;
  color: #fff;
}

.companies-workspace-bar .workspace-sort-bar,
.view-companies .companies-workspace-bar .workspace-sort-bar,
.view-network .companies-workspace-bar .workspace-sort-bar,
.view-competitors .companies-workspace-bar .workspace-sort-bar {
  display: flex;
  grid-column: auto;
  grid-row: auto;
  justify-content: flex-end;
  padding: 0;
}

.companies-workspace-bar .workspace-sort-bar label {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.companies-workspace-bar .workspace-sort-bar span {
  color: #52677f;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.companies-workspace-bar .workspace-sort-bar select {
  width: 100%;
  min-width: 230px;
  min-height: 36px;
  border: 1px solid #c5d1df;
  border-radius: 8px;
  background-color: #fff;
}

.filter-control select,
.workspace-sort-bar select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #253858 50%),
    linear-gradient(135deg, #253858 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.filter-combobox {
  position: relative;
  display: block;
  min-width: 0;
}

.filter-combobox input {
  padding-right: 36px;
}

.filter-combobox-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.filter-combobox-toggle::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #253858;
}

.filter-combobox-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #c5d1df;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .16);
}

.filter-combobox-menu.open-up {
  top: auto;
  bottom: calc(100% + 6px);
}

.filter-combobox-menu.is-open {
  display: grid;
  gap: 2px;
}

.filter-combobox-menu button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #111827;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.filter-combobox-menu button:hover,
.filter-combobox-menu button:focus {
  background: #e8f3ff;
  color: #0a66c2;
  outline: 0;
}

.filter-combobox-menu .filter-combobox-empty {
  color: var(--muted);
  cursor: default;
}

.workspace-sort-bar label {
  border-color: #cfd8e3;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.workspace-sort-bar label:hover,
.filter-control:hover {
  border-color: #9dbbe3;
  background: #f8fbff;
}

.workspace-sort-bar select,
.filter-control select,
.filter-control input {
  border-color: #c5d1df;
  background-color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.workspace-sort-bar select:focus,
.filter-control select:focus,
.filter-control input:focus {
  border-color: #0a66c2;
  background-color: #fff;
  box-shadow: 0 0 0 2px rgba(10, 102, 194, .16);
  outline: 0;
}

.workspace-sort-bar select {
  min-height: 38px;
  border-radius: 8px;
  padding-left: 16px;
  color: #111827;
}

.search-layout .workspace-sort-bar {
  display: none;
}

@media (max-width: 900px) {
  .companies-workspace-bar,
  .search-input-wrap {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .companies-page-tabs {
    display: flex;
    width: 100%;
  }

  .companies-page-tabs button {
    flex: 1 1 0;
    min-width: 0;
  }

  .companies-workspace-bar .workspace-sort-bar,
  .companies-workspace-bar .workspace-sort-bar label {
    width: 100%;
  }

  .companies-workspace-bar .workspace-sort-bar select {
    flex: 1;
    min-width: 0;
  }
}

/* Theme alignment override: B2B logistics/network workspace */
body.app-body .app-content:has(.smart-search-shell) {
  background:
    radial-gradient(1200px 420px at 100% -20%, rgba(30, 64, 175, .08), transparent 60%),
    linear-gradient(180deg, #f7f8fa 0%, #f1f4f8 100%);
}

.smart-search-shell {
  --surface: #ffffff;
  --surface-soft: #f5f8fb;
  --line: #cbd5e1;
  --line-soft: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --blue: #1d4ed8;
  --blue-dark: #1e3a8a;
  --green: #15803d;
}

.companies-discovery-header h1 {
  font-weight: 700;
  letter-spacing: -.01em;
}

.companies-discovery-header p {
  color: #334155;
}

.smart-search-top {
  border-color: #cfd8e3;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.search-field {
  background: #f8fafc;
  border: 1px solid #d6dee8;
  border-radius: 10px;
}

.search-input-wrap .btn:not(.soft) {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.search-input-wrap .btn.soft {
  border: 1px solid #b8c7df;
  background: #f8fbff;
  color: #1e40af;
}

.companies-page-tabs {
  border-color: #cfd8e3;
  background: #fff;
}

.companies-page-tabs button {
  color: #334155;
}

.companies-page-tabs button.active {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  color: #fff;
}

.smart-filters,
.search-list-pane,
.linkedin-side-card,
.recommended-group {
  border-color: #cfd8e3;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}

.search-list-head {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.result-card {
  background: #fff;
}

.result-card:hover,
.result-card.active {
  box-shadow: inset 4px 0 0 #1d4ed8;
}

.network-chipbar {
  padding-top: 2px;
}

.network-chip {
  border-color: #cad5e3;
  background: #fff;
  color: #334155;
}

.network-chip.is-active {
  border-color: #9fb5d9;
  background: #e8efff;
  color: #1e40af;
}

.recommended-group {
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
}

.recommended-head {
  background: #ffffff;
}

.recommended-score,
.recommended-score-good,
.recommended-score-warn,
.recommended-score-neutral {
  background: #e8efff;
  border-color: #c7d7f2;
  color: #1e40af;
}

.recommended-why,
.recommended-compact-hint,
.recommended-meta {
  color: #475569;
}

/* Recommendation card layout refinement:
   keep company name + match on one line and pin heart at bottom-right. */
.recommended-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.recommended-company-name,
.recommended-head h4 {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recommended-card-body {
  position: relative;
  padding-bottom: 0;
}

.recommended-favorite-corner {
  position: static;
}

.recommended-favorite-inline {
  margin-left: auto;
}

.view-network .recommended-head,
.view-competitors .recommended-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.recommendation-header-card {
  position: relative;
}

.recommendation-dismiss-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #cad5e3;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.recommendation-dismiss-btn:hover {
  border-color: #9fb5d9;
  background: #eef4ff;
  color: #1e3a8a;
}

.recommendation-header-card.is-hidden {
  display: none;
}

/* Single-scroll behavior: avoid nested scrollbars inside the networking pane */
.search-recommended-pane {
  max-height: none;
  overflow: visible;
}

.selection-questions-box {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #d7e3f4;
  border-radius: 10px;
  background: #f6faff;
  color: #1e3a8a;
  font-size: 13px;
}

.selection-questions-box strong {
  display: block;
  margin-bottom: 6px;
}

.selection-questions-box ol {
  margin: 0;
  padding-left: 18px;
}

.view-competitors .network-chip[data-network-filter="verified"],
.view-competitors .network-chip[data-network-filter="claimed"],
.view-competitors .network-chip[data-network-filter="high_match"] {
  display: none;
}

/* Networking should read like a work queue, not a separate themed board. */
.view-network .recommended-results-list,
.view-competitors .recommended-results-list {
  gap: 14px;
}

.view-network .network-chipbar,
.view-competitors .network-chipbar {
  padding: 0;
}

.view-network .network-chip,
.view-competitors .network-chip {
  min-height: 34px;
  border-color: #d6dee8;
  background: #fff;
  color: #344054;
  font-size: 14px;
  box-shadow: none;
}

.view-network .network-chip.is-active,
.view-competitors .network-chip.is-active {
  border-color: #b6c8df;
  background: #f3f7fc;
  color: #0a66c2;
}

.view-network .recommended-group,
.view-competitors .recommended-group {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.view-network .recommended-group h4,
.view-competitors .recommended-group h4 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 17px;
  font-weight: 700;
}

.view-network .recommended-group > div,
.view-competitors .recommended-group > div {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.view-network .recommended-card,
.view-competitors .recommended-card {
  border-color: #d9e1ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.view-network .recommended-card:hover,
.view-competitors .recommended-card:hover {
  border-color: #b9cbe2;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.view-network .recommended-head,
.view-competitors .recommended-head {
  min-height: 54px;
  padding: 12px 14px;
  border-bottom-color: #edf1f6;
  background: #fff;
}

.view-network .recommended-title,
.view-competitors .recommended-title {
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
}

.view-network .recommended-head h4,
.view-competitors .recommended-head h4 {
  color: #111827;
  font-size: 15px;
  font-weight: 700;
}

.view-network .recommended-score,
.view-network .recommended-score-good,
.view-network .recommended-score-warn,
.view-network .recommended-score-neutral,
.view-competitors .recommended-score,
.view-competitors .recommended-score-good,
.view-competitors .recommended-score-warn,
.view-competitors .recommended-score-neutral {
  min-height: 24px;
  background: #f3f7fc;
  border-color: #d7e3f1;
  color: #0a66c2;
  font-size: 12px;
}

.view-network .recommended-meta,
.view-competitors .recommended-meta {
  font-size: 13px;
  line-height: 1.45;
}

.view-network .recommended-compact-hint,
.view-competitors .recommended-compact-hint {
  margin: 8px 0 2px;
  color: #60728a;
  font-size: 13px;
}

.view-network .recommended-icon-btn,
.view-network .recommended-action-icon,
.view-competitors .recommended-icon-btn,
.view-competitors .recommended-action-icon {
  width: 34px;
  height: 34px;
  border-color: #d6dee8;
  background: #fff;
}

.view-network .recommended-icon-btn.is-favorite,
.view-competitors .recommended-icon-btn.is-favorite {
  border-color: #efb9c5;
  background: #fff6f8;
  color: #d61f4c;
}
