:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5c6674;
  --line: #d9dee7;
  --surface: #f7f8fb;
  --panel: #ffffff;
  --green: #147d64;
  --blue: #255f99;
  --red: #a33b35;
  --amber: #966b15;
  --violet: #6d5196;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 14px;
  font-size: 20px;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

nav a {
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  text-decoration: none;
  font-size: 14px;
}

nav a.active,
nav a:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 48px) 56px;
}

.snapshot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  min-height: 104px;
  padding: 14px;
}

.metric-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.metric-link:hover {
  border-color: var(--blue);
  background: #fbfcfe;
}

.metric .label {
  color: var(--muted);
  font-size: 13px;
}

.metric .value {
  display: block;
  margin-top: 12px;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 760;
  line-height: 1;
}

.metric .sub {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 14px;
}

.adoption-funnel {
  margin-bottom: 14px;
}

.funnel-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.funnel-stage {
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: inherit;
  background: #fbfcfe;
  text-decoration: none;
}

.funnel-stage:hover {
  border-color: var(--blue);
  background: var(--panel);
}

.funnel-stage span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.funnel-stage strong {
  color: var(--blue);
  font-size: 24px;
  line-height: 1;
}

.funnel-stage small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.panel {
  padding: 16px;
  min-width: 0;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-heading h2 {
  margin-bottom: 0;
}

.search-form {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.filter-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.filter-field {
  display: grid;
  flex: 1 1 320px;
  gap: 8px;
  max-width: 560px;
}

.search-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.search-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.search-row input[type="search"],
.filter-field select {
  flex: 1 1 280px;
  min-width: min(100%, 280px);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 14px;
}

.filter-field select {
  width: 100%;
}

.search-row input[type="search"]:focus,
.filter-field select:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(37, 95, 153, 0.18);
  outline-offset: 0;
}

.search-button,
.search-clear,
.load-more {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.search-button {
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
  cursor: pointer;
}

.search-button:hover {
  background: #1f527f;
}

.search-clear {
  border: 1px solid var(--line);
  color: var(--blue);
  background: var(--panel);
}

.search-clear:hover,
.load-more:hover {
  background: var(--surface);
}

.load-more {
  border: 1px solid var(--line);
  color: var(--blue);
  background: var(--panel);
  cursor: pointer;
}

.load-more:disabled {
  color: var(--muted);
  cursor: wait;
}

.search-meta {
  margin: 0;
}

.scroll-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.queue-context {
  display: grid;
  grid-template-columns: minmax(180px, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 10px 16px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.queue-context strong {
  display: block;
  margin-top: 4px;
  color: var(--blue);
  font-size: 18px;
  line-height: 1.15;
}

.queue-context .meta {
  margin: 0;
}

.panel.full {
  grid-column: 1 / -1;
}

.names-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.names-main {
  min-width: 0;
}

.names-pagination {
  justify-content: space-between;
  margin: 12px 0;
}

.names-table-wrap {
  overflow-x: hidden;
}

.names-table {
  table-layout: fixed;
  min-width: 0;
}

.names-table th,
.names-table td {
  padding: 8px 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.names-table .col-name {
  overflow: hidden;
}

.name-cell {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.names-table .action-cell {
  min-width: 0;
  max-width: none;
}

.names-table .name-summary-row > td {
  border-top: 2px solid #c8d5e5;
}

.names-table .name-summary-row:first-child > td {
  border-top-width: 1px;
}

.name-detail-row td {
  padding: 0 clamp(14px, 3vw, 38px) 12px clamp(34px, 6vw, 76px);
  border-bottom: 2px solid #c8d5e5;
  background: #fbfcfe;
}

.name-detail {
  overflow: hidden;
  border: 1px solid #d4deeb;
  border-left: 3px solid #9db8d3;
  border-radius: 0 0 6px 6px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(37, 95, 153, 0.04);
}

.name-detail summary {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid transparent;
  background: #f7fafd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.name-detail[open] summary {
  border-bottom-color: #d4deeb;
}

.name-detail-name {
  color: var(--ink);
  font-weight: 760;
}

.name-detail summary span {
  color: var(--muted);
  font-weight: 650;
}

.name-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
  padding: 0 12px 12px;
}

.name-detail-grid section {
  min-width: 0;
  padding: 10px 0;
}

.name-detail-grid h3 {
  margin-bottom: 10px;
}

.compliance-checklist-panel {
  grid-column: 1 / -1;
  padding-bottom: 4px;
}

.compliance-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.checklist-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: start;
  min-width: 0;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 6px;
  padding: 9px;
  background: #fbfcfe;
}

.checklist-item strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.checklist-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.checklist-item > span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--muted);
  background: #ffffff;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.35;
  white-space: nowrap;
}

.checklist-pass {
  border-left-color: var(--green);
}

.checklist-pass > span {
  border-color: rgba(28, 120, 92, 0.25);
  color: var(--green);
}

.checklist-warn {
  border-left-color: #b98217;
}

.checklist-warn > span {
  border-color: rgba(185, 130, 23, 0.28);
  color: #80580e;
}

.checklist-fail {
  border-left-color: var(--red);
}

.checklist-fail > span {
  border-color: rgba(177, 69, 59, 0.24);
  color: var(--red);
}

.checklist-pending,
.checklist-skip {
  border-left-color: #8794a5;
}

.diagnostic-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}

.diagnostic-kv div {
  min-width: 0;
}

.diagnostic-kv dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.diagnostic-kv dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-records,
.dns-evidence-list {
  display: grid;
  gap: 7px;
}

.resource-record {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px 10px;
  align-items: start;
}

.resource-record span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.resource-record a {
  color: var(--blue);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.resource-record code,
.evidence-lines code {
  display: block;
  min-width: 0;
  border: 1px solid #e4e8ef;
  border-radius: 6px;
  padding: 5px 7px;
  overflow-x: auto;
  color: #223047;
  background: #f7f9fc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.resource-record code {
  grid-column: 2;
}

.dns-evidence-item {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.dns-evidence-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.dns-evidence-item header {
  display: grid;
  gap: 3px;
}

.dns-evidence-item header strong {
  color: var(--ink);
  font-size: 12px;
}

.dns-evidence-item header span,
.evidence-lines span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.evidence-lines {
  display: grid;
  gap: 5px;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 220px) 1fr minmax(70px, max-content);
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.bar-link {
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}

.bar-link:hover {
  background: #f4f8fc;
}

.bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e9edf3;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.bar-row:nth-child(3n) .bar-fill {
  background: var(--green);
}

.bar-row:nth-child(3n + 1) .bar-fill {
  background: var(--violet);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: var(--panel);
}

.compact-table-wrap table {
  min-width: 520px;
}

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

th {
  color: var(--muted);
  background: #fbfcfe;
  font-weight: 700;
}

.action-cell {
  display: grid;
  gap: 4px;
  min-width: 180px;
  max-width: 260px;
}

.action-cell span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.action-link,
.verified-badge {
  width: fit-content;
  max-width: 100%;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  text-decoration: none;
}

.action-link {
  border: 1px solid rgba(37, 95, 153, 0.32);
  color: var(--blue);
  background: #f4f8fc;
}

.action-link:hover {
  border-color: var(--blue);
  background: #fff;
}

.verified-badge {
  border: 1px solid rgba(150, 107, 21, 0.36);
  color: #704f0f;
  background: #fff7e0;
}

.definition,
.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  background: var(--panel);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-transform: capitalize;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--surface);
}

.downloads a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 12px;
}

.panel-heading .pagination {
  margin-bottom: 0;
}

.page-link,
.page-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1;
}

.page-link {
  appearance: none;
  color: var(--blue);
  background: var(--panel);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.page-link:hover {
  background: var(--surface);
}

.page-link.disabled,
.page-link:disabled {
  color: var(--muted);
  cursor: default;
  background: var(--surface);
  font-weight: 600;
}

.page-status,
.empty-state {
  color: var(--muted);
}

.empty-state {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: 13px;
}

.status-ok {
  color: var(--green);
}

.status-bad {
  color: var(--red);
}

.loading {
  padding: 20px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .snapshot,
  .grid,
  .funnel-grid,
  .names-layout {
    grid-template-columns: 1fr;
  }

  .queue-context {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .panel-heading,
  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination {
    justify-content: flex-start;
  }

  .bar-row {
    grid-template-columns: minmax(0, 120px) 1fr minmax(50px, max-content);
  }

  .name-detail-grid {
    grid-template-columns: 1fr;
  }

  .resource-record {
    grid-template-columns: 1fr;
  }

  .resource-record code {
    grid-column: 1;
  }
}
