:root {
  color-scheme: light dark;
  --bg: #faf7f2;
  --fg: #2a2320;
  --muted: #6b6159;
  --accent: #a3561e;
  --line: #e4dccf;
  --card: #ffffff;
  --tint: #f2ebe1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1915;
    --fg: #ece5dc;
    --muted: #a89c8f;
    --accent: #e29a5b;
    --line: #3a322b;
    --card: #26211c;
    --tint: #2f2822;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Segoe UI", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--accent); }

header.site { border-bottom: 1px solid var(--line); }
header.site .wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0.9rem 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.5rem;
}
.brand { font-weight: 700; font-size: 1.25rem; color: var(--fg); text-decoration: none; }
header.site nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.95rem; }
header.site nav a { color: var(--muted); text-decoration: none; }
header.site nav a:hover, header.site nav a[aria-current="page"] { color: var(--accent); }

main { max-width: 760px; margin: 0 auto; padding: 1.5rem 16px 3rem; }
h1 { font-size: 1.75rem; line-height: 1.3; margin: 0.5rem 0 0.75rem; }
h2 { font-size: 1.3rem; line-height: 1.4; margin: 2.5rem 0 0.75rem; padding-top: 1rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
li + li { margin-top: 0.25rem; }

.meta { color: var(--muted); font-size: 0.95rem; }
.notice { background: var(--tint); border-left: 3px solid var(--accent); padding: 0.75rem 1rem; border-radius: 4px; }

.toc { background: var(--tint); border-radius: 8px; padding: 0.75rem 1.25rem; margin: 1.25rem 0; font-size: 0.95rem; }
.toc ul { margin: 0.25rem 0 0; padding: 0; list-style: none; }
.parts { line-height: 2; }

.table { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; line-height: 1.6; }
th, td { padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--tint); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { background: var(--tint); color: var(--muted); border-top: 1px solid var(--line); border-bottom: 0; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; width: 1em; height: 1em; border-radius: 3px; vertical-align: -0.15em; margin-right: 0.4em; border: 1px solid var(--line); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.75rem; margin: 1.5rem 0; }
.cards a { display: block; padding: 1rem 1.1rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.cards a strong { display: block; color: var(--accent); font-size: 1.05rem; margin-bottom: 0.2rem; }
.cards a:hover { border-color: var(--accent); }

footer.site { max-width: 760px; margin: 0 auto; padding: 1.25rem 16px 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
footer.site p { margin: 0.25rem 0; }
