:root {
  --navy: #16335e;
  --blue: #0060e0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #13213a;
  --muted: #5b6b82;
  --line: #dce3ee;
  --soft: #eaf1fd;
  --ok: #0f7a55;
  --ok-bg: #e3f5ee;
  --warn: #9a5b00;
  --warn-bg: #fdf1dc;
  --bad: #b3261e;
  --bad-bg: #fbe7e5;
  --head: #16335e;
  --code-bg: #0f1d33;
  --code-ink: #dbe7ff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1625; --card: #15223a; --ink: #e6edf7; --muted: #9aabc4; --line: #2a3b57; --soft: #1b2d4d;
    --blue: #6aa5ff; --head: #c4d7f7; --ok: #5fd3a5; --ok-bg: #12352a; --warn: #f2b860; --warn-bg: #3a2b12;
    --bad: #ff8a80; --bad-bg: #3d1a18; --code-bg: #0a1220; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1625; --card: #15223a; --ink: #e6edf7; --muted: #9aabc4; --line: #2a3b57; --soft: #1b2d4d;
  --blue: #6aa5ff; --head: #c4d7f7; --ok: #5fd3a5; --ok-bg: #12352a; --warn: #f2b860; --warn-bg: #3a2b12;
  --bad: #ff8a80; --bad-bg: #3d1a18; --code-bg: #0a1220; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "IBM Plex Sans Thai", "Leelawadee UI", sans-serif; }
h1, h2, h3, .brand { font-family: Outfit, "IBM Plex Sans Thai", system-ui, sans-serif; color: var(--head); line-height: 1.3; }
h1 { font-size: clamp(28px, 5vw, 40px); margin: 0 0 8px; font-weight: 700; }
h2 { font-size: 22px; margin: 32px 0 12px; font-weight: 700; }
h3 { font-size: 17px; margin: 0 0 6px; font-weight: 700; }
a { color: var(--blue); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px 64px; }
header.top { display: flex; align-items: center; gap: 16px; padding: 14px 16px; max-width: 1080px; margin: 0 auto; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; text-decoration: none; color: var(--head); display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--blue); display: inline-block; }
nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 15px; }
nav a:hover, nav a[aria-current="page"] { background: var(--soft); color: var(--head); }
.lede { color: var(--muted); font-size: 18px; margin: 0 0 24px; max-width: 720px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label { font-weight: 600; font-size: 14px; display: block; margin: 0 0 6px; }
input[type="text"], input[type="password"], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
textarea { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-height: 220px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
button, .btn {
  font: 600 15px/1 system-ui, sans-serif; border: 0; border-radius: 10px; padding: 11px 16px; cursor: pointer;
  background: var(--blue); color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
button.ghost, .btn.ghost { background: transparent; color: var(--blue); border: 1px solid var(--line); }
button:disabled { opacity: 0.55; cursor: default; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--soft); color: var(--head); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.msg { padding: 12px 14px; border-radius: 10px; margin: 12px 0; font-size: 15px; }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.bad { background: var(--bad-bg); color: var(--bad); }
.msg.info { background: var(--soft); color: var(--head); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { background: var(--code-bg); color: var(--code-ink); padding: 14px; border-radius: 10px; overflow-x: auto; font-size: 13px; line-height: 1.5; margin: 8px 0 16px; }
code { font-size: 0.92em; background: var(--soft); padding: 1px 5px; border-radius: 5px; }
pre code { background: none; padding: 0; }
.stat { font-family: Outfit, system-ui, sans-serif; font-size: 30px; font-weight: 700; color: var(--head); }
.bar { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.foot { margin-top: 48px; color: var(--muted); font-size: 13px; }
iframe.preview { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
@media (max-width: 640px) { nav { margin-left: 0; } .stat { font-size: 26px; } }

.sep { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; margin: 0 8px; vertical-align: middle; }
