:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1c2330;
  --muted: #5c6674;
  --accent: #2563eb;
  --border: #e3e7ee;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10141b;
    --surface: #1a2029;
    --text: #e6eaf1;
    --muted: #98a2b3;
    --accent: #7aa2ff;
    --border: #2a3341;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.container {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand { font-weight: 700; color: var(--text); font-size: 1.1rem; }
.site-header nav { display: flex; gap: 1rem; }

main { padding: 1.5rem 1rem 3rem; }

.hero { padding: 1rem 0 0.5rem; }
.hero h1 { margin: 0 0 0.25rem; font-size: clamp(1.5rem, 4vw, 2.25rem); }
.hero p { color: var(--muted); margin-top: 0; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.toolbar input[type="search"] {
  flex: 1 1 14rem;
  min-width: 0;
}

.toolbar input,
.toolbar select,
.toolbar button {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.toolbar button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  cursor: pointer;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
}

.stack { display: grid; gap: 1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.card .action { color: var(--muted); font-size: 0.92rem; }

.meta { color: var(--muted); font-size: 0.88rem; }

.report-list { list-style: none; padding: 0; margin: 0; }
.report-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }

.breadcrumbs { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }

.report {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-wrap: break-word;
}

.report h1 { font-size: clamp(1.3rem, 3.5vw, 1.9rem); line-height: 1.3; }
.report h2 { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 1.2rem; }
.report ul { padding-left: 1.25rem; }
.report li { margin: 0.4rem 0; }
.report hr { border: 0; border-top: 1px solid var(--border); }

.data-rows { margin-top: 2rem; }
.data-rows h3 { margin: 1.5rem 0 0.5rem; }

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

.data-rows table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-rows th,
.data-rows td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.data-rows th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.data-rows tbody tr:last-child td { border-bottom: 0; }
.data-rows td:first-child { min-width: 14rem; }
.nowrap { white-space: nowrap; }

.error-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-top: 2rem;
}

.error-box pre {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  overflow-x: auto;
  max-width: 100%;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  padding: 1rem 0 2rem;
}

@media (max-width: 40rem) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .report { padding: 1rem; }
}
