:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --ink: #1f2933;
  --muted: #5d6b7a;
  --line: #e2e8ee;
  --accent: #1a8fbf;
  --accent-dark: #136a8e;
  --ok: #2bb673;
  --err: #c83a3a;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

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

code {
  background: #eef2f6;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.92em;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
}

.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: var(--muted); font-weight: 500; }
.topbar nav a.nav-cta {
  color: white;
  background: var(--accent);
  padding: 6px 14px;
  border-radius: var(--radius);
}
.topbar nav a.nav-cta:hover { background: var(--accent-dark); text-decoration: none; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 28px 80px;
}

.hero {
  text-align: center;
  padding: 28px 0 36px;
}
.hero h1 {
  font-size: 2.2rem;
  margin: 0 0 12px;
}
.hero .lede { color: var(--muted); font-size: 1.1rem; max-width: 640px; margin: 0 auto 24px; }

.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-weight: 500;
  margin: 0 4px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: white; }
.btn.primary:hover { background: var(--accent-dark); text-decoration: none; }
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn.ghost:hover { background: var(--surface); text-decoration: none; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); }

.status {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.status h2 { margin: 0 0 10px; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.status-list { list-style: none; padding: 0; margin: 0; }
.status-list li { padding: 6px 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dot.ok { background: var(--ok); }
.dot.warn { background: #d8a017; }

.protocols {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.protocols h2 { margin: 0 0 6px; font-size: 1.05rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.protocols p { margin: 0 0 14px; }

.xep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.xep-table th, .xep-table td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.xep-table th {
  background: #f0f4f7;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.xep-table tbody tr:last-child td { border-bottom: none; }
.xep-table tbody tr:hover { background: #f7fafc; }
.xep-table td:first-child { white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88rem; }
.xep-table.about td:nth-child(2) { white-space: nowrap; font-weight: 500; }

.auth {
  max-width: 380px;
  margin: 32px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
}
.auth h1 { margin: 0 0 6px; font-size: 1.5rem; }
.auth .muted { color: var(--muted); margin: 0 0 18px; }
.auth label {
  display: block;
  margin-bottom: 14px;
}
.auth label > span { display: block; font-size: 0.88rem; color: var(--muted); margin-bottom: 4px; }
.auth input[type=text], .auth input[type=password] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  background: #fbfcfd;
}
.auth input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.auth label.row { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.auth label.row > span { margin: 0; }
.auth button { width: 100%; }
.auth .small { font-size: 0.85rem; margin-top: 18px; }

.error {
  background: #fdecec;
  border: 1px solid #f5b5b5;
  color: var(--err);
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 0.92rem;
}

.prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; }
.prose h1 { margin-top: 0; }
.prose table { border-collapse: collapse; margin-top: 8px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 12px; text-align: left; }
.prose th { background: #f0f4f7; }

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

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 24px 16px 36px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
footer p { margin: 4px 0; }
