:root {
  color: #17212b;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  background: #eef3f4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #eef3f4;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid #d9e1e5;
}

.topbar-inner,
.page-content {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar-inner {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar-link {
  color: #0d6e6e;
  font-size: 14px;
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.topbar-link:hover {
  color: #084f4f;
}

.site-name {
  color: #17212b;
  font-size: 22px;
  font-weight: 720;
  line-height: 1.15;
}

.dashboard-nav {
  display: flex;
  min-height: 38px;
  border: 1px solid #cbd7dc;
  border-radius: 6px;
  overflow: hidden;
}

.dashboard-nav a {
  min-width: 94px;
  padding: 9px 14px;
  border-right: 1px solid #cbd7dc;
  color: #40505f;
  background: #ffffff;
  font-size: 14px;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}

.dashboard-nav a:last-child {
  border-right: 0;
}

.dashboard-nav a:hover {
  background: #edf5f4;
}

.dashboard-nav a.is-active {
  color: #ffffff;
  background: #0d6e6e;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: #17212b;
  font-size: 28px;
  font-weight: 720;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  color: #17212b;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.eyebrow {
  color: #526170;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.page-content {
  padding: 28px 0 56px;
}

.hero {
  max-width: 960px;
  padding: 12px 0 34px;
}

.hero h1 {
  font-size: 38px;
  letter-spacing: -0.02em;
}

.hero > p:last-child {
  max-width: 820px;
  margin-top: 14px;
  color: #40505f;
  font-size: 16px;
  line-height: 1.6;
}

.hero a {
  color: #0d6e6e;
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.hero a:hover {
  color: #084f4f;
}

.info-page {
  max-width: 860px;
}

.info-page section {
  padding: 30px;
  border: 1px solid #d5e0e4;
  background: #ffffff;
}

.info-page h1 {
  font-size: 34px;
  letter-spacing: -0.02em;
}

.info-page h2 {
  margin-top: 28px;
}

.info-page p:not(.eyebrow) {
  margin-top: 14px;
  color: #40505f;
  line-height: 1.65;
}

.site-footer {
  border-top: 1px solid #d9e1e5;
  background: #ffffff;
}

.footer-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-footer p,
.footer-links a {
  color: #526170;
  font-size: 13px;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.footer-links a:hover {
  color: #0d6e6e;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #d5e0e4;
  background: #ffffff;
}

.summary-item {
  min-height: 132px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.summary-item + .summary-item {
  border-left: 1px solid #d5e0e4;
}

.summary-label,
.summary-detail {
  color: #526170;
  font-size: 13px;
  line-height: 1.4;
}

.summary-item strong {
  color: #17212b;
  font-size: 30px;
  line-height: 1.2;
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 24px 0 10px;
}

.segmented-control {
  display: inline-flex;
  min-height: 38px;
  border: 1px solid #cbd7dc;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.range-button {
  min-width: 78px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid #cbd7dc;
  color: #40505f;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
}

.range-button:last-child {
  border-right: 0;
}

.range-button:hover {
  background: #edf5f4;
}

.range-button.is-active {
  color: #ffffff;
  background: #0d6e6e;
}

.chart-section,
.leaderboards-section,
.errors-section {
  padding: 26px 0 28px;
  border-top: 1px solid #cad8dd;
}

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

.section-heading .eyebrow {
  margin-bottom: 5px;
}

.delta {
  color: #526170;
  font-size: 14px;
  line-height: 1.4;
  text-align: right;
}

.chart-frame {
  position: relative;
  height: 290px;
  padding: 18px 18px 12px;
  border: 1px solid #d5e0e4;
  background: #ffffff;
}

.leaderboard-mode-control {
  display: inline-flex;
  min-height: 38px;
  border: 1px solid #cbd7dc;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.leaderboard-mode,
.category-mode,
.leaderboard-sort,
.category-sort {
  border: 0;
  color: #40505f;
  background: transparent;
  font-weight: 650;
}

.leaderboard-mode,
.category-mode {
  padding: 0 12px;
  border-right: 1px solid #cbd7dc;
  font-size: 14px;
}

.leaderboard-mode:last-child,
.category-mode:last-child {
  border-right: 0;
}

.leaderboard-mode:hover,
.category-mode:hover,
.leaderboard-sort:hover,
.category-sort:hover {
  background: #edf5f4;
}

.leaderboard-mode.is-active,
.category-mode.is-active {
  color: #ffffff;
  background: #0d6e6e;
}

.leaderboard-table-wrap {
  background: #ffffff;
}

.leaderboard-expansion {
  display: flex;
  justify-content: center;
  min-height: 42px;
  padding-top: 12px;
}

.leaderboard-row-toggle {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #cbd7dc;
  border-radius: 6px;
  color: #0d6e6e;
  background: #ffffff;
  font-size: 14px;
  font-weight: 650;
}

.leaderboard-row-toggle:hover {
  border-color: #9fb4bc;
  background: #edf5f4;
}

.leaderboard-row-toggle[hidden] {
  display: none;
}

.row-toggle-icon {
  display: inline-block;
  margin-left: 6px;
  transition: transform 120ms ease;
}

.leaderboard-row-toggle[aria-expanded="true"] .row-toggle-icon {
  transform: rotate(180deg);
}

.leaderboard-table {
  min-width: 900px;
  font-size: 15px;
}

.leaderboard-table th {
  padding: 0;
}

.leaderboard-table th[data-column="rank"] {
  padding: 0 14px;
  vertical-align: middle;
}

.leaderboard-table td {
  padding: 9px 12px;
}

.leaderboard-sort,
.category-sort {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  text-align: left;
  text-transform: uppercase;
}

.leaderboard-sort span,
.category-sort span {
  display: none;
  margin-left: 3px;
  color: #0d6e6e;
}

.leaderboard-table th[aria-sort="ascending"] .leaderboard-sort span,
.leaderboard-table th[aria-sort="descending"] .leaderboard-sort span,
.leaderboard-table th[aria-sort="ascending"] .category-sort span,
.leaderboard-table th[aria-sort="descending"] .category-sort span {
  display: inline;
}

.leaderboard-table th[data-column="campaignCount"] .leaderboard-sort,
.leaderboard-table th[data-column="viewCount"] .leaderboard-sort,
.leaderboard-table th[data-column="spendCents"] .leaderboard-sort,
.leaderboard-table th[data-column="minCpmMicros"] .leaderboard-sort,
.leaderboard-table th[data-column="maxCpmMicros"] .leaderboard-sort,
.leaderboard-table th[data-column="avgCpmMicros"] .leaderboard-sort,
.leaderboard-table th[data-column="campaignCount"] .category-sort,
.leaderboard-table th[data-column="viewCount"] .category-sort,
.leaderboard-table th[data-column="spendCents"] .category-sort,
.leaderboard-table th[data-column="minCpmMicros"] .category-sort,
.leaderboard-table th[data-column="maxCpmMicros"] .category-sort,
.leaderboard-table th[data-column="avgCpmMicros"] .category-sort,
.leaderboard-table td[data-column="campaignCount"],
.leaderboard-table td[data-column="viewCount"],
.leaderboard-table td[data-column="spendCents"],
.leaderboard-table td[data-column="minCpmMicros"],
.leaderboard-table td[data-column="maxCpmMicros"],
.leaderboard-table td[data-column="avgCpmMicros"] {
  text-align: right;
}

.leaderboard-table th[data-column="campaignCount"],
.leaderboard-table th[data-column="viewCount"],
.leaderboard-table th[data-column="spendCents"],
.leaderboard-table th[data-column="minCpmMicros"],
.leaderboard-table th[data-column="maxCpmMicros"],
.leaderboard-table th[data-column="avgCpmMicros"] {
  text-align: right;
}

.leaderboard-table th[data-column="campaignCount"] > .leaderboard-sort,
.leaderboard-table th[data-column="viewCount"] > .leaderboard-sort,
.leaderboard-table th[data-column="spendCents"] > .leaderboard-sort,
.leaderboard-table th[data-column="minCpmMicros"] > .leaderboard-sort,
.leaderboard-table th[data-column="maxCpmMicros"] > .leaderboard-sort,
.leaderboard-table th[data-column="avgCpmMicros"] > .leaderboard-sort,
.leaderboard-table th[data-column="campaignCount"] > .category-sort,
.leaderboard-table th[data-column="viewCount"] > .category-sort,
.leaderboard-table th[data-column="spendCents"] > .category-sort,
.leaderboard-table th[data-column="minCpmMicros"] > .category-sort,
.leaderboard-table th[data-column="maxCpmMicros"] > .category-sort,
.leaderboard-table th[data-column="avgCpmMicros"] > .category-sort {
  text-align: right !important;
}

.leaderboard-table a {
  color: #0d6e6e;
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.leaderboard-table a:hover {
  color: #084f4f;
}

.leaderboard-table td.is-column-maximum {
  color: #17212b;
  font-weight: 700;
}

.leaderboard-table td.is-campaign-link-cell {
  cursor: pointer;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.leaderboard-table td.is-campaign-link-cell:hover,
.leaderboard-table td.is-campaign-link-cell:focus-visible {
  color: #084f4f;
  text-decoration-line: underline;
}

.leaderboard-table tbody tr.is-row-highlighted td {
  background: #f7f9fa;
}

.platforms-page {
  padding-top: 32px;
}

.platform-hero {
  max-width: 880px;
  padding: 4px 0 30px;
}

.platform-hero h1 {
  font-size: 36px;
}

.platform-hero > p:not(.eyebrow):not(.snapshot-meta) {
  max-width: 780px;
  margin-top: 12px;
  color: #40505f;
  font-size: 16px;
  line-height: 1.6;
}

.snapshot-meta {
  margin-top: 14px;
  color: #0d6e6e;
  font-size: 13px;
  font-weight: 700;
}

.methodology {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.6fr);
  gap: 34px;
  padding: 26px 0 30px;
  border-top: 1px solid #cad8dd;
  border-bottom: 1px solid #cad8dd;
}

.methodology-intro > p:last-child {
  margin-top: 10px;
  color: #40505f;
  font-size: 14px;
  line-height: 1.6;
}

.metric-definitions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border: 1px solid #d5e0e4;
  background: #ffffff;
}

.metric-definitions div {
  min-width: 0;
  padding: 16px 18px;
}

.metric-definitions div:nth-child(even) {
  border-left: 1px solid #e1e8eb;
}

.metric-definitions div:nth-child(n + 3) {
  border-top: 1px solid #e1e8eb;
}

.metric-definitions dt {
  color: #17212b;
  font-size: 13px;
  font-weight: 750;
}

.metric-definitions dd {
  margin: 6px 0 0;
  color: #526170;
  font-size: 13px;
  line-height: 1.5;
}

.metric-definitions code {
  color: #334451;
  font-size: 12px;
}

.platform-section {
  padding: 30px 0 16px;
}

.platform-section + .platform-section {
  padding-top: 36px;
}

.platform-section-heading {
  align-items: end;
}

.section-description {
  max-width: 430px;
  color: #526170;
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
}

.platform-table {
  min-width: 920px;
  font-size: 14px;
}

.platform-table th:not(:first-child),
.platform-table td:not(:first-child) {
  text-align: right;
}

.platform-table td:first-child {
  color: #17212b;
  font-weight: 700;
}

.platform-table tbody tr.is-row-highlighted td {
  background: #f7f9fa;
}

.platform-table [data-column].is-column-highlighted {
  background: #f1f5f6;
}

.platform-table tbody tr.is-row-highlighted .is-column-highlighted {
  background: #e4eeee;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.leaderboard-table [data-column].is-column-highlighted {
  background: #f1f5f6;
}

.leaderboard-table tbody tr.is-row-highlighted .is-column-highlighted {
  background: #e9eef0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #d5e0e4;
  background: #ffffff;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #e1e8eb;
  text-align: left;
  vertical-align: top;
}

th {
  color: #526170;
  background: #f8fafb;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td:nth-child(1),
td:nth-child(2),
td:nth-child(3) {
  white-space: nowrap;
}

@media (max-width: 700px) {
  .topbar-inner,
  .page-content {
    width: min(100% - 24px, 1180px);
  }

  .topbar-inner {
    min-height: 0;
    padding: 22px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-link {
    align-self: flex-start;
  }

  .dashboard-nav {
    width: 100%;
  }

  .dashboard-nav a {
    flex: 1;
  }

  h1 {
    font-size: 25px;
  }

  .site-name {
    font-size: 20px;
  }

  .hero {
    padding: 4px 0 26px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .info-page section {
    padding: 24px;
  }

  .info-page h1 {
    font-size: 28px;
  }

  .footer-inner {
    width: min(100% - 24px, 1180px);
    min-height: 0;
    padding: 20px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .summary {
    grid-template-columns: 1fr;
  }

  .summary-item {
    min-height: 104px;
  }

  .summary-item + .summary-item {
    border-top: 1px solid #d5e0e4;
    border-left: 0;
  }

  .toolbar {
    justify-content: stretch;
  }

  .segmented-control {
    width: 100%;
  }

  .range-button {
    flex: 1;
  }

  .leaderboard-mode-control {
    width: 100%;
  }

  .leaderboard-mode,
  .category-mode {
    flex: 1;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .methodology {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .metric-definitions {
    grid-template-columns: 1fr;
  }

  .metric-definitions div:nth-child(even) {
    border-left: 0;
  }

  .metric-definitions div + div {
    border-top: 1px solid #e1e8eb;
  }

  .section-description {
    text-align: left;
  }

  .delta {
    text-align: left;
  }

  .chart-frame {
    height: 240px;
    padding: 14px 8px 10px;
  }

}

/* Contact Form Styles */
.contact-section {
  margin-top: 40px;
  border-top: 1px solid #cad8dd;
  padding-top: 30px;
}

.contact-form {
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 600;
  font-size: 14px;
  color: #40505f;
}

.form-input {
  padding: 10px 12px;
  border: 1px solid #cbd7dc;
  border-radius: 6px;
  font-size: 15px;
  background: #ffffff;
  color: #17212b;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: #0d6e6e;
  outline: none;
}

.form-button {
  align-self: flex-start;
  padding: 10px 20px;
  border: 0;
  background: #0d6e6e;
  color: #ffffff;
  font-weight: 650;
  font-size: 15px;
  border-radius: 6px;
  transition: background 0.15s;
}

.form-button:hover {
  background: #084f4f;
}

.form-button:disabled {
  background: #cbd7dc;
  color: #72818c;
  cursor: not-allowed;
}

.status-message {
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.status-message.success {
  background: #edf5f4;
  border: 1px solid #bcdad7;
  color: #0c4d4d;
}

.status-message.error {
  background: #fdebee;
  border: 1px solid #f9cad2;
  color: #961122;
}
