:root {
  --bg: #ffffff;
  --surface: #f5f7fb;
  --text: #16181d;
  --muted: #5b6270;
  --border: #dde2ea;
  --accent: #2459d6;
  --accent-text: #ffffff;
  --accent-soft: #e8eefc;
  --ok: #1d7a46;
  --warn-bg: #fff6e0;
  --warn-border: #f0d48a;
  --code-bg: #eef1f6;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --surface: #191c23;
    --text: #e8eaef;
    --muted: #a2a9b6;
    --border: #2c313b;
    --accent: #7ea2ff;
    --accent-text: #0b1020;
    --accent-soft: #1d2640;
    --ok: #6fd39b;
    --warn-bg: #2a2412;
    --warn-border: #5c4b1d;
    --code-bg: #20242d;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

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

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

a {
  color: var(--accent);
}

code {
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font:
    0.9em ui-monospace,
    "Cascadia Code",
    Consolas,
    monospace;
  overflow-wrap: anywhere;
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
}

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

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
}

.site-nav {
  display: flex;
  gap: 18px;
}

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

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

main.wrap {
  padding-top: 40px;
  padding-bottom: 56px;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.35rem;
  margin: 40px 0 12px;
}

h3 {
  font-size: 1.05rem;
  margin: 24px 0 6px;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 640px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0 8px;
}

.button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  padding: 0;
  list-style: none;
}

.features li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.features strong {
  display: block;
  margin-bottom: 2px;
}

.features span {
  color: var(--muted);
  font-size: 0.95rem;
}

.note {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 14px 16px;
}

.warning {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 10px;
  padding: 12px 16px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

.table-scroll {
  overflow-x: auto;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 24px 0 40px;
}

.site-footer p {
  margin: 4px 0;
}

/* Demo page */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.card h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.menu li:last-child {
  border-bottom: 0;
}

.field {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.field input,
.field select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

.status {
  color: var(--ok);
  font-weight: 600;
  min-height: 1.6em;
}
