:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #16202e;
  --muted: #5a6778;
  --border: #dde3ec;
  --blue: #3d8ef0;
  --blue-strong: #1f6fd1;
  --yellow: #f5c518;
  --code-bg: #eef2f7;
  --warn-bg: #fff7db;
  --warn-border: #f0d36b;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d131c;
    --surface: #151d29;
    --text: #e6ebf2;
    --muted: #9aa7b8;
    --border: #273246;
    --blue: #5ea3f5;
    --blue-strong: #8bbcf8;
    --code-bg: #1c2636;
    --warn-bg: #2a2410;
    --warn-border: #6b5a1c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d131c;
  --surface: #151d29;
  --text: #e6ebf2;
  --muted: #9aa7b8;
  --border: #273246;
  --blue: #5ea3f5;
  --blue-strong: #8bbcf8;
  --code-bg: #1c2636;
  --warn-bg: #2a2410;
  --warn-border: #6b5a1c;
  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, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--blue-strong); }
a:hover { color: var(--blue); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
header.site .wrap {
  display: flex; align-items: center; gap: 12px;
  padding-top: 14px; padding-bottom: 14px;
}
header.site img { width: 36px; height: 36px; }
header.site .brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
header.site nav { margin-left: auto; display: flex; gap: 16px; flex-wrap: wrap; font-size: .95rem; }
header.site nav a { color: var(--muted); text-decoration: none; }
header.site nav a:hover, header.site nav a[aria-current] { color: var(--text); }

.hero { padding: 48px 0 24px; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.2; margin: 0 0 12px; }
.hero p { color: var(--muted); font-size: 1.1rem; margin: 0; max-width: 40em; }

.cards {
  display: grid; gap: 16px; margin: 24px 0 40px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  display: block; padding: 20px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--blue); transform: translateY(-2px); color: var(--text); }
.card h2 { font-size: 1.15rem; margin: 0 0 6px; }
.card p { margin: 0 0 10px; color: var(--muted); font-size: .95rem; }
.card .url { font-size: .85rem; color: var(--blue-strong); word-break: break-all; }

section { margin: 32px 0; }
section h2 { font-size: 1.35rem; margin: 0 0 12px; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px;
}
dl.settings { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
dl.settings dt { color: var(--muted); }
dl.settings dd { margin: 0; min-width: 0; }
code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em;
  background: var(--code-bg); padding: 2px 6px; border-radius: 6px; word-break: break-all;
}
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.note {
  background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: var(--radius);
  padding: 14px 18px; margin: 16px 0;
}
ul.plain { padding-left: 1.2em; margin: 0; }
ul.plain li { margin: 6px 0; }

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

@media (max-width: 560px) {
  header.site nav { display: none; }
  dl.settings { grid-template-columns: 1fr; gap: 2px; }
  dl.settings dd { margin-bottom: 10px; }
}
