:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #111111;
  --muted: #666666;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e2e2e2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2rem 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

main {
  max-width: 640px;
  margin: 0 auto;
}

.url-input {
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
}

/* Home page hero — scoped to .hero so the report/leaderboard pages (which share
   the same `main` container) are unaffected. */
.hero {
  padding: 3rem 0 2.5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

.hero .tagline {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 2rem;
}

.check-form {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  max-width: 520px;
  margin: 0 auto;
}

.check-form .url-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

.check-form .url-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.check-form button {
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.check-form button:hover {
  background: var(--accent-hover);
}

.cf-turnstile {
  margin: 1.5rem auto 0;
}

.checks-list {
  max-width: 480px;
  margin: 1.5rem auto 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .check-form {
    flex-direction: column;
  }
}

.form-error {
  color: #c0392b;
}

.score {
  font-size: 1.25rem;
}

.submitted-url a {
  color: inherit;
}

.score-history {
  margin: 0.5rem 0 0;
}

.score-history svg.trend-up {
  color: #1a7f37;
}

.score-history svg.trend-down {
  color: #c0392b;
}

.test-another {
  margin: 0.5rem 0 1.5rem;
}

.test-another a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.test-another a:hover {
  text-decoration: underline;
}

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

.sort-controls button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sort-controls button:hover {
  border-color: var(--accent);
}

.sort-controls button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.signal-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.signal-card {
  border: 1px solid #d0d0d0;
  border-left-width: 4px;
  border-radius: 4px;
  padding: 0.75rem 1rem;
}

.signal-card summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

.signal-card summary::-webkit-details-marker {
  display: none;
}

.signal-label {
  font-weight: 600;
}

.signal-summary {
  color: var(--muted);
  flex: 1;
}

.signal-points {
  font-weight: 600;
}

.signal-card.category-positive {
  border-left-color: #1a7f37;
}
.signal-card.category-neutral {
  border-left-color: #3d3d3d;
}
.signal-card.category-negative {
  border-left-color: #c0392b;
}
.signal-card.category-informational {
  border-left-color: #8a8a8a;
}

.signal-points.category-positive {
  color: #1a7f37;
}
.signal-points.category-neutral {
  color: #3d3d3d;
}
.signal-points.category-negative {
  color: #c0392b;
}
.signal-points.category-informational {
  color: #8a8a8a;
}

.signal-detail {
  margin-top: 0.75rem;
}

.signal-detail pre {
  background: rgba(128, 128, 128, 0.1);
  padding: 0.5rem;
  overflow-x: auto;
}

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

.signal-detail dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0;
}

.signal-detail dt {
  font-weight: 600;
  color: var(--muted);
}

.signal-detail dd {
  margin: 0;
  word-break: break-all;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.detail-table th,
.detail-table td {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(128, 128, 128, 0.25);
  word-break: break-all;
}

.leaderboard-table td:first-child,
.leaderboard-table th:first-child,
.leaderboard-table td:nth-child(3),
.leaderboard-table th:nth-child(3) {
  width: 1%;
  white-space: nowrap;
}

footer {
  max-width: 640px;
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(128, 128, 128, 0.25);
  font-size: 0.85rem;
  color: var(--muted);
}

footer a {
  color: inherit;
}
