/* Follows the device theme; a choice from the theme button (html[data-theme]) overrides it. */
:root {
  color-scheme: light;
  --brand: #3d5afe;
  --text: #1b1c22;
  --muted: #5c5f6e;
  --surface: #ffffff;
  --panel: #f3f4fa;
  --line: #dfe1ec;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #a9b6ff;
    --text: #e6e7ef;
    --muted: #a5a8b8;
    --surface: #121318;
    --panel: #1d1f27;
    --line: #2e313d;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #a9b6ff;
  --text: #e6e7ef;
  --muted: #a5a8b8;
  --surface: #121318;
  --panel: #1d1f27;
  --line: #2e313d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

main { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }

header.page { border-bottom: 1px solid var(--line); margin-bottom: 24px; padding-bottom: 16px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: var(--brand); font-weight: 700; text-decoration: none; letter-spacing: 0.02em; }
.tools { display: flex; align-items: center; gap: 4px; }
.lang, .theme-toggle {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
  font: inherit; font-size: 14px; color: var(--brand);
}
.lang { padding: 0 6px; }
.theme-toggle { background: none; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; min-height: 36px; }
.theme-toggle:hover { background: var(--panel); }
.theme-toggle:focus-visible, .lang:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1 { font-size: 26px; line-height: 1.35; margin: 16px 0 4px; }
.meta { color: var(--muted); font-size: 14px; margin: 0; }
h2 { font-size: 19px; margin: 36px 0 8px; }
h3 { font-size: 16px; margin: 20px 0 4px; }
a { color: var(--brand); }
ul, ol { padding-left: 22px; }
li { margin: 4px 0; }

.summary { background: var(--panel); border-radius: 12px; padding: 12px 16px; }
.summary ul { margin: 4px 0; }

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

nav.links { display: grid; gap: 12px; margin-top: 24px; }
nav.links a { display: block; background: var(--panel); border-radius: 12px; padding: 14px 16px; text-decoration: none; font-weight: 600; }

footer { color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); margin-top: 48px; padding-top: 16px; }
