:root {
  color-scheme: light dark;
  --bg: #f5f6f7;
  --text: #151922;
  --muted: #667085;
  --line: #d7dde5;
  --line-strong: #b8c2cf;
  --surface: #ffffff;
  --soft: #eef2f6;
  --accent: #0f766e;
  --accent-soft: #d9f0ec;
  --warn: #9a5b00;
  --bad: #b42318;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --text: #edf0f3;
    --muted: #a2acb8;
    --line: #303946;
    --line-strong: #475467;
    --surface: #171c22;
    --soft: #202832;
    --accent: #45c4b0;
    --accent-soft: #163d39;
    --warn: #e4a63a;
    --bad: #ff746c;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.45;
}

.page-shell {
  width: min(1200px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--line-strong);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 2.2rem;
  line-height: 1.12;
  letter-spacing: 0;
}

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

h3 {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.header-side {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.score-panel {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.score-panel span {
  color: var(--accent);
  font-size: 2.35rem;
  font-weight: 900;
  line-height: 1;
}

.score-panel small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(74px, 1fr));
  gap: 8px;
  width: 170px;
}

.actions a {
  min-width: 74px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.actions a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.notice {
  margin: 20px 0 0;
  padding: 12px 0;
  color: var(--muted);
}

.notice.error {
  color: var(--bad);
}

.report-grid {
  display: grid;
  gap: 0;
  margin-top: 18px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric span,
.metric small {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric strong {
  display: block;
  min-width: 0;
  margin: 3px 0;
  overflow: hidden;
  color: var(--text);
  font-size: 1.14rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.kv {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  gap: 8px 16px;
}

.key {
  color: var(--muted);
  font-size: 0.94rem;
}

.value {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.94rem;
}

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

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

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

th {
  background: var(--soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

code,
pre {
  font-family: var(--mono);
}

pre {
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

@media (max-width: 980px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 18px;
  }

  .report-header,
  .header-side {
    flex-direction: column;
  }

  h1 {
    font-size: 1.75rem;
  }

  .score-panel,
  .actions,
  .actions a {
    width: 100%;
  }

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

  .kv {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
