:root {
  --bg: #fbf8f2;
  --surface: #ffffff;
  --text: #1f1d1a;
  --muted: #6b665e;
  --line: #e4ddd0;
  --accent: #bc002d;
  --accent-soft: #fbe9ed;
  --code-bg: #f3efe7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --surface: #201f1d;
    --text: #ece8e1;
    --muted: #a39d93;
    --line: #34312d;
    --accent: #ff5c78;
    --accent-soft: #3a1f25;
    --code-bg: #2a2825;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}

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

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

header.site {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
header.site .wrap {
  display: flex; align-items: center; gap: 12px;
  padding-top: 14px; padding-bottom: 14px;
}
header.site img { width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line); }
header.site .name { font-weight: 700; font-size: 18px; white-space: nowrap; }
header.site nav { margin-left: auto; display: flex; gap: 16px; font-size: 14px; }
header.site nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
header.site nav a:hover, header.site nav a[aria-current="page"] { color: var(--accent); }

.hero { padding: 48px 0 32px; }
.hero .app { display: flex; align-items: center; gap: 20px; }
.hero img { width: 96px; height: 96px; border-radius: 22px; border: 1px solid var(--line); flex: none; }
.hero h1 { margin: 0; font-size: 32px; line-height: 1.3; }
.hero p.lead { margin: 6px 0 0; color: var(--muted); }
.req { margin-top: 20px; font-size: 14px; color: var(--muted); }

main section { padding: 28px 0; border-top: 1px solid var(--line); }
h2 { font-size: 24px; margin: 0 0 16px; }
h3 { font-size: 18px; margin: 28px 0 8px; }
h2 + h3 { margin-top: 8px; }
p { margin: 0 0 12px; }
ul, ol { padding-left: 1.4em; margin: 0 0 12px; }
li { margin: 2px 0; }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.toc a {
  display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); text-decoration: none; color: var(--text); font-size: 14px;
}
.toc a:hover { border-color: var(--accent); color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
}
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card ul { margin: 0; font-size: 14.5px; }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 8px 0 12px; background: var(--surface); }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--code-bg); font-weight: 600; }
.table-scroll { overflow-x: auto; }

code, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em; background: var(--code-bg); border-radius: 4px; padding: 1px 5px;
}
kbd { border: 1px solid var(--line); white-space: nowrap; }
pre {
  background: var(--code-bg); border-radius: 10px; padding: 14px 16px; overflow-x: auto;
  font-size: 14px; line-height: 1.6; margin: 0 0 12px;
}
pre code { background: none; padding: 0; }

details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 10px;
}
details summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 8px; }

.note {
  background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 6px;
  padding: 10px 14px; font-size: 14.5px; margin: 8px 0 12px;
}

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

@media (max-width: 560px) {
  .hero h1 { font-size: 26px; }
  .hero img { width: 72px; height: 72px; border-radius: 16px; }
  header.site .wrap { gap: 8px; }
  header.site img { width: 32px; height: 32px; border-radius: 7px; }
  header.site .name { font-size: 16px; }
  header.site nav { gap: 10px; font-size: 12.5px; }
}
