:root {
  --bg: #fcfcfd;
  --surface: #ffffff;
  --surface-alt: #f5f7fa;
  --fg: #111827;
  --muted: #4b5563;
  --border: #e5e7eb;
  --accent: #1d4ed8;
  --accent-soft: #eff6ff;
  --good: #166534;
  --good-bg: #dcfce7;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --code-bg: #f3f4f6;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

header.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header-inner,
main,
footer.site-footer {
  max-width: 820px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.site-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.92rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
}

main {
  padding-top: 36px;
  padding-bottom: 56px;
}

h1 {
  font-size: clamp(1.65rem, 3.2vw, 2.15rem);
  line-height: 1.22;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}

h2 {
  font-size: 1.32rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin: 40px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.08rem;
  line-height: 1.35;
  margin: 26px 0 8px;
}

p { margin: 0 0 14px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 6px; }

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

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.meta-line {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 18px;
}

.callout {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 14px 16px;
  margin: 18px 0 22px;
  font-size: 0.95rem;
}

.callout p:last-child { margin-bottom: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.card h3 { margin-top: 0; margin-bottom: 6px; }

.featured-card {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

.badge-live { background: var(--good-bg); color: var(--good); }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--accent-soft); color: var(--accent); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 20px 0 24px;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.stat-num {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 4px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 540px;
}

th, td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }

th {
  background: var(--surface-alt);
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
}

td.num, th.num { text-align: right; white-space: nowrap; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 2px 5px;
  border-radius: 4px;
  word-break: break-word;
}

pre {
  background: #111827;
  color: #f3f4f6;
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 14px 0 20px;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  word-break: normal;
}

figure.screenshot {
  margin: 18px 0 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

figure.screenshot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
}

figure.screenshot figcaption {
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 8px;
}

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

@media (max-width: 600px) {
  main { padding-top: 24px; }
  .card { padding: 15px 16px; }
  th, td { padding: 8px 10px; font-size: 0.85rem; }
}
