:root {
  --bg: #ffffff;
  --fg: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card-bg: #f9fafb;
  --warn-bg: #fef3c7;
  --warn-fg: #78350f;
  --error-bg: #fee2e2;
  --error-fg: #991b1b;
  --group-itmf: #1d4ed8;
  --group-authorities: #b91c1c;
  --group-public: #047857;
  --group-unknown: #4b5563;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17;
    --fg: #e5e7eb;
    --muted: #9ca3af;
    --border: #1f2937;
    --card-bg: #111827;
    --warn-bg: #3a2e07;
    --warn-fg: #fde68a;
    --error-bg: #3f1212;
    --error-fg: #fecaca;
    --group-itmf: #3b82f6;
    --group-authorities: #ef4444;
    --group-public: #10b981;
    --group-unknown: #9ca3af;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.lang-switcher {
  display: flex;
  gap: 0.25rem;
}

.lang-switcher button {
  appearance: none;
  font: inherit;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.lang-switcher button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.lang-switcher button:focus-visible {
  outline: 2px solid var(--group-itmf);
  outline-offset: 2px;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

.status {
  padding: 0.75rem 1rem;
  background: var(--error-bg);
  color: var(--error-fg);
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.status a {
  color: inherit;
  text-decoration: underline;
}

.alerts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.alert {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}

.alert .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.group {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--group-unknown);
}

.group-itmf {
  background: var(--group-itmf);
}
.group-authorities {
  background: var(--group-authorities);
}
.group-public {
  background: var(--group-public);
}

.alert h2 {
  margin: 0.5rem 0 0.25rem;
  font-size: 1rem;
  line-height: 1.35;
}

.alert .body {
  margin: 0.25rem 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.alert .agency {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.alert .fallback {
  margin: 0.5rem 0 0;
  padding: 0.4rem 0.6rem;
  background: var(--warn-bg);
  color: var(--warn-fg);
  border-radius: 6px;
  font-size: 0.75rem;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem 1rem 0;
}

.empty-message {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 auto;
  max-width: 28ch;
  line-height: 1.3;
}

.empty-nudge {
  font-size: 0.9rem;
  margin: 0.75rem 0 0;
}

.show-older {
  text-align: center;
  margin: 1rem 0 0;
  color: var(--muted);
}

.linklike {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--group-itmf);
  cursor: pointer;
  text-decoration: underline;
}

.linklike:focus-visible {
  outline: 2px solid var(--group-itmf);
  outline-offset: 2px;
  border-radius: 2px;
}

footer {
  max-width: 720px;
  margin: 2rem auto 1rem;
  padding: 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

footer p {
  margin: 0.25rem 0;
}

footer a {
  color: inherit;
}
