:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --text: #1f1b16;
  --muted: #6b6258;
  --line: #e6dfd3;
  --accent: #b45309;
  --green: #166534;
  --green-bg: #dcfce7;
  --amber: #92400e;
  --amber-bg: #fef3c7;
  --red: #991b1b;
  --red-bg: #fee2e2;
  --none: #57534e;
  --none-bg: #ece8e1;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17140f;
    --surface: #211d16;
    --text: #f3ede2;
    --muted: #a39a8c;
    --line: #38322a;
    --accent: #f59e0b;
    --green: #86efac;
    --green-bg: #14301f;
    --amber: #fcd34d;
    --amber-bg: #3a2c0a;
    --red: #fca5a5;
    --red-bg: #3b1414;
    --none: #d6d0c6;
    --none-bg: #2e2922;
  }
}

* { box-sizing: border-box; }

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

.site-header, main, .site-footer {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1.125rem; margin: 0 0 4px; }

.langs { display: flex; gap: 4px; }

button {
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  min-height: 44px;
  cursor: pointer;
}

.langs button[aria-pressed="true"] { border-color: var(--accent); font-weight: 600; }

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

.verdict {
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0 24px;
  border: 2px solid var(--line);
  background: var(--surface);
  transition: opacity 0.2s;
}

.verdict.checking { opacity: 0.85; }

.level { font-size: 1.375rem; font-weight: 700; margin: 0 0 4px; line-height: 1.3; }
.run { margin: 0; color: inherit; font-variant-numeric: tabular-nums; }
.run span:empty { display: none; }
.run span + span:not(:empty)::before { content: "· "; }

.level-green { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.level-amber { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); }
.level-red { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.level-pending { color: var(--muted); }

.log-host { margin: 4px 0 0; font-size: 0.875rem; overflow-wrap: anywhere; }
.progress { margin: 12px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.progress:empty, .error-detail:empty, .figures-at:empty { display: none; }
.error-detail { margin: 8px 0 0; font-size: 0.875rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.figures-at { margin: 0 0 12px; font-weight: 600; }

.reasons { margin: 12px 0 0; padding-left: 20px; font-weight: 600; }
.reasons:empty { display: none; }
.timestamps { margin: 4px 0 0; padding: 0; list-style: none; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.timestamps:empty { display: none; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 16px;
}

.actions button { background: var(--surface); color: var(--text); font-weight: 600; }
.last-check { margin: 0; font-size: 0.875rem; color: var(--text); opacity: 0.8; }

.compare { color: var(--muted); margin: 0 0 12px; }

input[type="search"] {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.showing { color: var(--muted); font-size: 0.875rem; margin: 8px 0; }

.stations {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

@media (min-width: 768px) {
  .stations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.station {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.station-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.station-name { font-weight: 600; overflow-wrap: anywhere; }

.chip {
  font-size: 0.8125rem;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.chip-published { background: var(--green-bg); color: var(--green); }
.chip-held { background: var(--none-bg); color: var(--none); }

.station-figures {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  margin: 8px 0 0;
  font-variant-numeric: tabular-nums;
}

.station-figures dt { color: var(--muted); }
.station-figures dd { margin: 0; text-align: right; font-weight: 600; }
.stamp-age { margin: 0.25rem 0 0; font-size: 0.85rem; }
.photo-hash { margin: 0.5rem 0 0; color: var(--muted); font-family: ui-monospace, monospace; font-size: 0.75rem; overflow-wrap: anywhere; }

.site-footer {
  margin-top: 32px;
  padding-top: 12px;
  padding-bottom: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer code { overflow-wrap: anywhere; font-size: 0.8125rem; }
