:root {
  --bg: #ffffff;
  --text: #1c1c1e;
  --muted: #5c5c63;
  --link: #0b57d0;
  --border: #d9d9de;
  --code-bg: #f2f2f5;
  --mark-bg: #ffe066;
  --mark-text: #1c1c1e;
  --note-bg: #ffc9c9;
  --banner-bg: #b3261e;
  --banner-text: #ffffff;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --text: #e8e8ec;
    --muted: #a3a3ab;
    --link: #8ab4f8;
    --border: #3a3a40;
    --code-bg: #232327;
    --mark-bg: #8a6d00;
    --mark-text: #ffffff;
    --note-bg: #7a2323;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

main, .site-header nav, .site-footer p {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 16px;
}

main { padding-top: 1rem; padding-bottom: 2rem; }

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

.site-header { border-bottom: 1px solid var(--border); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.site-header .brand { font-weight: 700; color: var(--text); text-decoration: none; margin-right: auto; }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.site-footer p { padding-top: 1rem; padding-bottom: 1.5rem; }

h1 { font-size: 1.75rem; line-height: 1.25; margin: 1rem 0 1rem; }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }

.lead { font-size: 1.15rem; }
ul, ol { padding-left: 1.4rem; }
li + li { margin-top: 0.35rem; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { border: 1px solid var(--border); padding: 0.45rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--code-bg); }

mark.placeholder, mark.note {
  color: var(--mark-text);
  background: var(--mark-bg);
  outline: 2px dashed currentColor;
  padding: 0 0.2em;
  border-radius: 3px;
}
mark.note { background: var(--note-bg); }

.draft-banner {
  background: var(--banner-bg);
  color: var(--banner-text);
  padding: 0.6rem 16px;
  text-align: center;
  font-size: 0.95rem;
}
