.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats .stat,
.stats .stat:first-child,
.stats .stat + .stat {
  min-width: 0;
  padding: 0 22px;
}

.stats .stat:first-child { padding-left: 0; }
.stats .stat + .stat { border-left: 1px solid var(--line); }

.platform-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-bottom: 32px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.platform-summary strong {
  color: var(--ink);
  font-weight: 600;
}

.directory {
  display: block;
}

.directory-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.directory-row > .client-section:first-child { padding-right: 32px; }
.directory-row > .client-section + .client-section {
  padding-left: 32px;
  border-left: 1px solid var(--line);
}

.client-section {
  padding: 0 0 26px;
  margin: 0 0 26px;
  border-bottom: 1px solid var(--line);
}

.client-section:last-child { margin-bottom: 0; }

.client-head,
.owner-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.client-head {
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.client-head h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
}

.rank {
  color: var(--ink-faint);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.terms-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 7px;
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

.terms-badge.tier {
  color: #604783;
  background: #eee9f5;
}

.terms-badge.percentage {
  color: #825818;
  background: #f8eedc;
}

.tally strong {
  color: var(--ink);
  font-weight: 600;
}

.owner-group {
  margin-top: 14px;
  padding: 12px 14px 10px;
  border-left: 3px solid transparent;
}

.owner-group.agency-group {
  border-left-color: #246b63;
  background: #eef6f4;
}

.owner-group.client-group {
  border-left-color: #74549a;
  background: #f5f1f9;
}

.owner-head { margin-bottom: 7px; }

.owner-head h3,
.owner-head span {
  margin: 0;
  color: var(--ink-faint);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.owner-head h3 {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.07em;
}

.agency-group .owner-head h3 { background: #246b63; }
.client-group .owner-head h3 { background: #74549a; }

.owner-head span {
  letter-spacing: 0;
  text-transform: none;
}

.account-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 18px;
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}

.account-row:nth-child(odd) { background: var(--zebra); }

.platform,
.count {
  color: var(--ink-faint);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

.platform { padding-top: 2px; }
.count { padding-top: 2px; text-align: right; font-variant-numeric: tabular-nums; }

.handles {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  min-width: 0;
}

.handles a {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
}

.handles a:hover,
.handles a:focus-visible {
  color: var(--c-blue, #2a78d6);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat,
  .stats .stat:first-child,
  .stats .stat + .stat {
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .stats .stat:nth-child(odd) { padding-left: 0; }
  .stats .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .directory-row { grid-template-columns: 1fr; }
  .directory-row > .client-section:first-child { padding-right: 0; }
  .directory-row > .client-section + .client-section {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 420px) {
  .account-row { grid-template-columns: 70px minmax(0, 1fr) 16px; gap: 7px; }
  .platform-summary { gap: 7px 14px; }
}
