:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-subtle: #ececf0;
  --text: #151517;
  --muted: #696a70;
  --line: rgba(0, 0, 0, 0.08);
  --accent: #0066cc;
  --accent-quiet: #e8f2ff;
  --green: #0a7a3b;
  --green-bg: #e8f7ee;
  --amber: #9a5a00;
  --amber-bg: #fff2cc;
  --red: #9f1d20;
  --red-bg: #fde8e7;
  --radius: 22px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.08);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161618;
    --surface: rgba(34, 34, 38, 0.78);
    --surface-solid: #222226;
    --surface-subtle: #2e2e33;
    --text: #f5f5f7;
    --muted: #a7a7ad;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #66aaff;
    --accent-quiet: rgba(102, 170, 255, 0.14);
    --green: #56d982;
    --green-bg: rgba(29, 155, 90, 0.16);
    --amber: #f3be4d;
    --amber-bg: rgba(196, 128, 0, 0.18);
    --red: #ff7373;
    --red-bg: rgba(221, 70, 70, 0.17);
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 0%, rgba(0, 102, 204, 0.12), transparent 32rem),
    linear-gradient(180deg, var(--bg), var(--bg));
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
}

.brand,
.nav-actions,
.segmented,
.hero-panel,
.view-switch {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
}

.nav-actions {
  gap: 10px;
}

.segmented,
.view-switch {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
}

.segmented-button,
.view-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.segmented-button,
.view-button {
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
}

.segmented-button.active,
.view-button.active {
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.ghost-button {
  min-height: 42px;
  white-space: nowrap;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
}

.segmented-button:active,
.view-button:active,
.ghost-button:active {
  transform: translateY(1px) scale(0.99);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 22px;
  align-items: stretch;
  min-height: 48dvh;
  margin-bottom: 18px;
}

.hero-copy,
.hero-panel,
.toolbar,
.results-section,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(28px, 5vw, 70px);
}

.section-kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 920px;
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.96;
  letter-spacing: -0.065em;
}

.hero-lede {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.45;
}

.hero-panel {
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 28px;
}

.hero-panel > div {
  width: 100%;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.hero-panel > div:last-child {
  border-bottom: 0;
}

.metric-value,
.metric-label,
.insight-value,
.insight-label {
  display: block;
}

.metric-value {
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.9;
  letter-spacing: -0.06em;
  font-weight: 800;
}

.metric-label,
.insight-label {
  margin-top: 9px;
  color: var(--muted);
  font-size: 14px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(160px, 220px));
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
}

.search-box,
.select-box {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  background: var(--surface-solid);
  color: var(--text);
  padding: 0 14px;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-quiet);
}

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

.insight-card {
  min-height: 132px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
}

.insight-card.tinted {
  background: var(--accent-quiet);
}

.insight-card.quiet {
  background: var(--surface);
}

.insight-value {
  font-size: 38px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.results-section {
  padding: 18px;
}

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.results-heading h2 {
  margin-bottom: 8px;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.results-heading p {
  margin: 0;
  color: var(--muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.customer-card {
  display: flex;
  min-width: 0;
  min-height: 360px;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.customer-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 102, 204, 0.32);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
}

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

.company-name {
  margin-bottom: 10px;
  font-size: 21px;
  line-height: 1.14;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.company-original {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.row-number,
.score-pill,
.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.row-number {
  background: var(--surface-subtle);
  color: var(--muted);
}

.score-pill {
  background: var(--accent-quiet);
  color: var(--accent);
}

.description {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.links-row,
.contact-row,
.match-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-chip,
.contact-chip,
.match-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 32px;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.link-chip {
  background: var(--accent-quiet);
  color: var(--accent);
}

.contact-chip {
  color: var(--red);
  background: var(--red-bg);
}

.contact-chip.person {
  color: var(--muted);
  background: var(--surface-subtle);
}

.contact-chip.email {
  color: var(--green);
  background: var(--green-bg);
}

.contact-chip.phone {
  color: var(--amber);
  background: var(--amber-bg);
}

.match-chip {
  background: var(--surface-subtle);
  color: var(--muted);
}

.card-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.table-wrap {
  overflow: auto;
  max-height: 70dvh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-solid);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td {
  font-size: 14px;
  line-height: 1.45;
}

.table-description {
  max-width: 460px;
  color: var(--muted);
}

.empty-state {
  padding: 54px 20px;
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 8px;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar,
  .hero-copy,
  .hero-panel,
  .toolbar,
  .results-section,
  .empty-state {
    background: var(--surface-solid);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 1120px) {
  .hero,
  .toolbar {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .page-shell {
    padding: 10px;
  }

  .topbar,
  .results-heading {
    align-items: stretch;
    flex-direction: column;
    border-radius: 20px;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  .ghost-button {
    min-width: 94px;
    padding: 0 14px;
  }

  .brand {
    width: 100%;
  }

  .hero-copy,
  .hero-panel,
  .results-section {
    padding: 18px;
  }

  h1 {
    font-size: clamp(38px, 13vw, 56px);
  }

  .insights,
  .cards-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .view-switch,
  .segmented {
    width: 100%;
  }

  .view-button,
  .segmented-button {
    flex: 1;
  }
}
