:root {
  --bg: #f4f2fb;
  --surface: #ffffff;
  --surface-muted: #efeaf9;
  --text: #1e1b2e;
  --muted: #6b6580;
  --border: #ddd6f3;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --danger: #dc2626;
  --ok: #047857;
  --warn: #b45309;
  --shadow: 0 6px 20px rgba(79, 70, 229, 0.14);
}
[data-theme="dark"] {
  --bg: #14121f;
  --surface: #1f1b33;
  --surface-muted: #2a2450;
  --text: #eceaf6;
  --muted: #a9a3c4;
  --border: #3b3562;
  --accent: #a5b4fc;
  --accent-2: #c4b5fd;
  --danger: #f87171;
  --ok: #6ee7b7;
  --warn: #fbbf24;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.wrap { max-width: 980px; margin: 0 auto; padding: 16px; }
.hero {
  background: linear-gradient(135deg, #7c3aed, #4f46e5 55%, #2563eb);
  color: #fff;
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 6px; font-size: 26px; }
.hero p { margin: 4px 0; opacity: 0.92; line-height: 1.55; font-size: 14px; }
.hero .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }
.pill {
  display: inline-block;
  font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 5px 12px;
  background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.4);
}
.pill.ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pill.bad { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
[data-theme="dark"] .pill.ok { background: #064e3b; color: #a7f3d0; }
[data-theme="dark"] .pill.bad { background: #450a0a; color: #fecaca; }
button {
  font: inherit; cursor: pointer;
  border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text);
  padding: 8px 16px; font-weight: 700; font-size: 13.5px;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--danger); border-color: #fecaca; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 14px; }
.tab { padding: 10px 16px; }
.tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 16px 18px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 4px; font-size: 17px; }
.card h3 { margin: 14px 0 6px; font-size: 13px; letter-spacing: 0.5px; color: var(--accent-2); text-transform: uppercase; }
.note {
  font-size: 13px; line-height: 1.65; color: var(--muted);
  background: var(--surface-muted); border-radius: 12px; padding: 11px 13px; margin: 10px 0;
}
.note strong { color: var(--text); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 2px solid var(--border); }
td { padding: 8px; border-bottom: 1px dashed var(--border); vertical-align: top; }
td:last-child, th:last-child { text-align: right; }
input[type="text"], input[type="number"], input[type="url"], textarea, select {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 8px 10px; width: 100%;
}
input[type="number"] { width: 110px; }
textarea { min-height: 110px; font-family: ui-monospace, monospace; font-size: 12.5px; }
label { font-size: 13px; font-weight: 700; display: block; margin: 10px 0 4px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 2px 0 8px; line-height: 1.5; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.field-row > div { flex: 1; min-width: 150px; }
.mono { font-family: ui-monospace, monospace; font-size: 12.5px; word-break: break-all; }
.code-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.code-row .code { font-family: ui-monospace, monospace; font-weight: 700; }
.code-row input { flex: 1; min-width: 140px; }
.msg { font-size: 13.5px; font-weight: 700; margin: 10px 0; line-height: 1.5; }
.msg.ok { color: var(--ok); }
.msg.bad { color: var(--danger); }
.msg.warn { color: var(--warn); }
pre {
  background: var(--surface-muted); border-radius: 12px; padding: 13px;
  overflow: auto; font-size: 12px; line-height: 1.5; max-height: 420px;
  white-space: pre-wrap; word-break: break-all;
}
.badge { font-size: 11px; font-weight: 800; border-radius: 999px; padding: 3px 9px; background: var(--surface-muted); color: var(--muted); white-space: nowrap; }
.badge.red { background: #fef2f2; color: #dc2626; }
.badge.green { background: #ecfdf5; color: #047857; }
[data-theme="dark"] .badge.red { background: #450a0a; color: #fecaca; }
[data-theme="dark"] .badge.green { background: #064e3b; color: #a7f3d0; }
details summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.footer { font-size: 12.5px; color: var(--muted); text-align: center; padding: 18px 8px 30px; line-height: 1.6; }
@media (max-width: 640px) {
  .hero h1 { font-size: 22px; }
  td:last-child, th:last-child { text-align: left; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { border-bottom: 1px solid var(--border); padding: 4px 0; }
  th { display: none; }
}
