:root {
  color-scheme: light;
  --background: oklch(0.98 0.005 85);
  --surface: oklch(1 0 0);
  --foreground: oklch(0.129 0.042 264.695);
  --muted: oklch(0.554 0.046 257.417);
  --subtle: oklch(0.968 0.007 247.896);
  --border: oklch(0.929 0.013 255.508);
  --blue: oklch(0.55 0.2 255);
  --red: oklch(0.577 0.245 27.325);
  --green: oklch(0.45 0.12 155);
  --radius: 12px;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.5;
}

main {
  width: 100%;
  padding: 24px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
}

.ranking-table { min-width: 2820px; }

th,
td {
  height: 46px;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  background: var(--subtle);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

td { font-size: 14px; }
.ranking-table td:first-child,
.ranking-table th:first-child { width: 52px; text-align: right; }

.audience-section { margin-bottom: 20px; }

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

.audience-heading h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.audience-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.audience-heading a {
  flex: none;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.audience-heading a:hover,
.audience-heading a:focus-visible { text-decoration: underline; }

.audience-table {
  min-width: 720px;
  table-layout: fixed;
}

.audience-table th:first-child { width: 44%; }
.audience-table th:nth-child(2) { width: 16%; }
.audience-table td:first-child { font-weight: 650; }

.business {
  min-width: 340px;
  white-space: normal;
}

.business-title {
  display: block;
  width: fit-content;
  color: var(--foreground);
  font-weight: 650;
  text-decoration: none;
}

a.business-title:hover,
a.business-title:focus-visible {
  color: var(--blue);
  text-decoration: underline;
}

.maps-link {
  display: block;
  width: fit-content;
  margin-top: 2px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.maps-link:hover,
.maps-link:focus-visible { text-decoration: underline; }

.recommendation {
  width: 340px;
  min-width: 340px;
  white-space: normal;
}

.recommendation-status {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.recommendation p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.recommendation-pitch-now .recommendation-status { color: var(--green); }
.recommendation-validate-first .recommendation-status { color: var(--blue); }
.recommendation-do-not-pitch .recommendation-status { color: var(--red); }

.company-profile {
  width: 370px;
  min-width: 370px;
  white-space: normal;
}

.company-profile p,
.paid-search p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.company-profile p:first-child {
  color: var(--foreground);
  font-size: 13px;
}

.company-profile strong,
.paid-search strong { color: var(--foreground); }

.estimate-label,
.exact-label {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 800;
}

.estimate-label { color: var(--red); }
.exact-label { color: var(--green); }

.field-status {
  display: block;
  margin-top: 4px;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  white-space: normal;
}

.modeled-value strong { color: var(--red); }

.paid-search {
  width: 190px;
  min-width: 190px;
  white-space: normal;
}

.paid-search a {
  display: block;
  width: fit-content;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.paid-search a:hover,
.paid-search a:focus-visible { text-decoration: underline; }

.cpv-field { min-width: 150px; }
.cpv-field strong { color: var(--green); }
.cpv-field .field-status { color: var(--muted); }

.billboard {
  width: 260px;
  min-width: 260px;
  white-space: normal;
}

.billboard > strong { color: var(--red); }

.billboard p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.opportunity { color: var(--blue); font-weight: 800; }

.advertiser-email {
  width: 400px;
  min-width: 400px;
  white-space: normal;
}

.email-subject {
  margin: 0;
  color: var(--foreground);
  font-size: 12px;
  font-weight: 700;
}

.email-template { margin-top: 6px; }

.email-template summary {
  width: fit-content;
  cursor: pointer;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.email-template pre {
  width: 380px;
  margin: 8px 0 0;
  padding: 10px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--subtle);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.copy-email {
  margin-top: 7px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--foreground);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.copy-email:hover,
.copy-email:focus-visible { border-color: var(--blue); color: var(--blue); }

.email-unavailable { color: var(--muted); font-size: 12px; }

.decision { margin-top: 5px; }

.decision summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.decision[open] { padding-bottom: 5px; }

.decision-body {
  width: min(640px, 72vw);
  padding-top: 9px;
  color: var(--foreground);
}

.reasoning { margin: 0 0 10px; }

.decision-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 7px 14px;
  margin: 0;
}

.decision-facts div { min-width: 0; }

.decision-facts dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.decision-facts dd {
  margin: 1px 0 0;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.risks {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--red);
}

.source {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.source a { color: var(--blue); }

.industry { text-transform: capitalize; }
.evidence { text-transform: capitalize; }
.evidence-actual,
.evidence-researched { color: var(--green); font-weight: 700; }
.evidence-industry_prior { color: var(--muted); }
.evidence-unresolved { color: var(--red); font-weight: 700; }

.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td.error-row { color: var(--red); text-align: left; }

@media (max-width: 760px) {
  main { padding: 12px; }
  .audience-heading { align-items: start; flex-direction: column; gap: 4px; }
  .decision-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
