* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
}
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.hero h1 { margin: 0 0 8px; font-size: 34px; }
.hero .eyebrow { color: #f87171; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.subtitle { color: #cbd5e1; max-width: 760px; }
.card {
  background: #111827;
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 16px;
  margin-top: 16px;
}
.tabs {
  padding-top: 12px;
}
.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.tab-button {
  width: auto;
  background: transparent;
  border-color: #334155;
  color: #cbd5e1;
}
.tab-button.active {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
.filters,
.inline-stats,
.results,
.countries {
  margin-top: 0;
}
.inline-stats {
  margin: 16px 0;
}
.active-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.75);
}
.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}
.query-field,
.country-field {
  grid-column: span 2;
}
label span { display: block; font-size: 13px; margin-bottom: 8px; color: #94a3b8; }
input, select, button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 14px;
}
select[multiple] {
  min-height: 164px;
}
.country-native-select {
  display: none;
}
.country-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 260px;
  margin-top: 8px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #475569;
  border-radius: 12px;
  background: #0f172a;
}
.country-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}
.country-option:hover,
.country-option:focus-within {
  background: #1e293b;
}
.country-option input {
  width: auto;
  margin: 0;
  accent-color: #dc2626;
}
.country-option span {
  margin: 0;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.country-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px;
  color: #94a3b8;
  font-size: 13px;
}
button {
  background: #dc2626;
  border-color: #dc2626;
  cursor: pointer;
  font-weight: 700;
}
button.secondary {
  background: transparent;
  border-color: #475569;
  width: auto;
}
.inline-button { padding: 8px 12px; }
.actions { display: flex; align-items: end; }
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.result-list { display: grid; gap: 16px; margin-top: 16px; overflow-x: hidden; }
.countries-table { margin-top: 16px; overflow-x: auto; }
.countries-table table { width: 100%; border-collapse: collapse; }
.countries-table th, .countries-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid #1e293b; vertical-align: top; }
.countries-table th { color: #94a3b8; font-size: 13px; }
.country-block {
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 12px;
  background: #0b1220;
}
.country-header { margin-bottom: 10px; }
.section-label { color: #94a3b8; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.company-logo { max-width: 180px; max-height: 72px; display: block; margin: 12px 0; object-fit: contain; background: #fff; padding: 8px; border-radius: 10px; }
.chapter-groups { display: grid; gap: 10px; }
.chapter-group { border: 1px solid #1e293b; border-radius: 12px; padding: 12px; overflow: hidden; }
.chapter-browser {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}
.chapter-list-pane,
.chapter-detail-pane {
  min-width: 0;
}
.chapter-list-pane {
  display: grid;
  gap: 10px;
}
.chapter-list-card,
.chapter-detail-card {
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 12px;
  background: #0f172a;
}
.chapter-list-card {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.chapter-list-card.active {
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.25) inset;
}
.chapter-header-detail {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}
.chapter-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.members-panel-detail {
  margin-top: 12px;
}
.chapter-header { display: grid; gap: 3px; margin-bottom: 10px; }
.chapter-label { color: #94a3b8; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.chapter-header h4 { margin: 0; font-size: 16px; }
.chapter-trigger {
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.chapter-trigger:hover {
  color: #bfdbfe;
  text-decoration: underline;
}
.chapter-address, .chapter-meta { margin: 0; color: #cbd5e1; font-size: 13px; }
.description { color: #cbd5e1; white-space: pre-line; }
.country-header h3 { margin: 0; font-size: 24px; }
.media-frame {
  width: 72px;
  min-width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.company-frame {
  width: 80px;
  min-width: 80px;
}
.member-photo,
.company-logo,
.company-logo-placeholder {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #111827;
}
.photo-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: zoom-in;
}
.member-photo-placeholder,
.company-logo-placeholder {
  background: transparent;
  border-color: transparent;
}
.company-logo {
  object-fit: contain;
  background: #fff;
  padding: 6px;
  margin: 0;
}
.member-links { display: flex; flex-wrap: wrap; gap: 8px; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.members-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.member-grid-header,
.member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}
.member-grid-header {
  color: #94a3b8;
  font-size: 12px;
  padding: 0 0 4px;
  border-bottom: 1px solid #1e293b;
}
.member-row {
  padding: 12px 0;
  border-bottom: 1px solid #1e293b;
}
.member-row:last-child { border-bottom: 0; }
.member-person-cell,
.member-company-cell,
.member-person-meta,
.member-company-meta,
.member-company-top {
  min-width: 0;
}
.member-person-cell {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.member-person-meta,
.member-company-meta {
  display: grid;
  gap: 4px;
}
.member-role {
  color: #cbd5e1;
  font-size: 13px;
}
.member-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fca5a5;
  font-size: 12px;
}
.member-company-top {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.compact-links,
.compact-text {
  font-size: 13px;
}
.member-phone {
  color: #93c5fd;
  font-size: 13px;
}
.icon-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #111827;
  color: #93c5fd;
  text-decoration: none;
}
.icon-link:hover {
  border-color: #60a5fa;
  color: #bfdbfe;
}
.compact-text,
.member-role,
.member-grid-header span,
.chapter-address,
.chapter-meta,
.member-person-meta strong,
.member-company-meta strong,
.compact-links a,
.member-company-meta a {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.status-enriched { background: rgba(34, 197, 94, 0.14); color: #86efac; }
.status-indexed { background: rgba(59, 130, 246, 0.14); color: #93c5fd; }
.status-no_data { background: rgba(245, 158, 11, 0.14); color: #fcd34d; }
.status-pending { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; }
.status-note { margin-top: 6px; color: #94a3b8; font-size: 12px; max-width: 320px; }
.image-modal {
  border: 0;
  padding: 24px;
  background: rgba(15, 23, 42, 0.96);
  max-width: min(92vw, 960px);
}
.image-modal::backdrop {
  background: rgba(2, 6, 23, 0.85);
}
.image-modal-content {
  display: block;
  max-width: min(86vw, 880px);
  max-height: 82vh;
  border-radius: 14px;
}
.image-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: auto;
  padding: 8px 10px;
}
a { color: #93c5fd; }
.empty, .muted { color: #94a3b8; }
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .query-field,
  .country-field { grid-column: span 1; }
  .country-picker { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .chapter-browser { grid-template-columns: 1fr; }
  .chapter-list-card,
  .chapter-header-detail { display: grid; }
  .member-grid-header { display: none; }
  .member-row { grid-template-columns: 1fr; }
  .member-person-cell { grid-template-columns: 72px minmax(0, 1fr); }
  .member-company-top { grid-template-columns: 80px minmax(0, 1fr); }
}
