/* Token warna + gaya baca. Dipakai aplikasi dan situs publik.
   Kertas hangat + tinta hijau tua: kesan buku catatan, satu aksen saja. */
:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --sunken: #ede9df;
  --ink: #1d1f1d;
  --muted: #595c56;
  --line: #d9d3c5;
  --accent: #1f6a53;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe4;
  --danger: #a3322a;
  --code-bg: #efebe1;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-read: "Iowan Old Style", "Charter", "Bitstream Charter", Cambria, Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151716;
    --surface: #1b1e1c;
    --sunken: #111312;
    --ink: #e7e5df;
    --muted: #a6a8a1;
    --line: #2f3330;
    --accent: #6fc5a5;
    --accent-ink: #0d1a14;
    --accent-soft: #1f3a30;
    --danger: #f08a80;
    --code-bg: #222623;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #151716;
  --surface: #1b1e1c;
  --sunken: #111312;
  --ink: #e7e5df;
  --muted: #a6a8a1;
  --line: #2f3330;
  --accent: #6fc5a5;
  --accent-ink: #0d1a14;
  --accent-soft: #1f3a30;
  --danger: #f08a80;
  --code-bg: #222623;
  color-scheme: dark;
}

.doc {
  font-family: var(--font-read);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  max-width: 46rem;
  margin: 0 auto;
  overflow-wrap: anywhere;
}
.doc > :first-child { margin-top: 0; }
.doc h1, .doc h2, .doc h3, .doc h4 { line-height: 1.25; margin: 1.8em 0 0.5em; font-weight: 700; }
.doc h1 { font-size: 2.1rem; margin-top: 0.4em; letter-spacing: -0.01em; }
.doc h2 { font-size: 1.45rem; padding-bottom: 0.25em; border-bottom: 1px solid var(--line); }
.doc h3 { font-size: 1.15rem; }
.doc p, .doc ul, .doc ol, .doc blockquote, .doc table, .doc pre, .doc figure { margin: 0 0 1em; }
.doc ul, .doc ol { padding-left: 1.5em; }
.doc li + li { margin-top: 0.2em; }
.doc a { color: var(--accent); text-underline-offset: 0.18em; }
.doc a:hover { text-decoration-thickness: 2px; }
.doc blockquote { margin-left: 0; padding: 0.1em 1em; border-left: 3px solid var(--line); color: var(--muted); }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.doc code { font-family: var(--font-mono); font-size: 0.86em; background: var(--code-bg); padding: 0.12em 0.35em; border-radius: 4px; }
.doc pre { background: var(--code-bg); padding: 0.9em 1em; border-radius: 6px; overflow-x: auto; line-height: 1.5; }
.doc pre code { background: none; padding: 0; font-size: 0.85rem; }
.doc table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; font-family: var(--font-ui); font-size: 0.92rem; }
.doc th, .doc td { border: 1px solid var(--line); padding: 0.4em 0.7em; text-align: left; vertical-align: top; }
.doc th { background: var(--sunken); }
.doc li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.4em; }
.doc input[type="checkbox"] { width: 1.05em; height: 1.05em; margin: 0 0.45em 0 0; vertical-align: -0.12em; accent-color: var(--accent); }
.doc img { max-width: 100%; height: auto; }
.doc pre.mermaid { background: none; text-align: center; font-family: var(--font-ui); overflow-x: auto; padding: 0.5em 0; }
.doc .wikilink-missing { border-bottom: 1px dashed var(--muted); }

/* Situs publik */
body.site { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui); }
.site-head { max-width: 46rem; margin: 0 auto; padding: 1.25rem 16px 0; }
.site-head a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-head a:hover, .site-head a:focus-visible { color: var(--accent); }
body.site .doc { padding: 1.5rem 16px 4rem; }
.page-list { list-style: none; padding: 0; }
.page-list li { padding: 0.6em 0; border-bottom: 1px solid var(--line); }
.page-list .muted, .muted { color: var(--muted); font-family: var(--font-mono); font-size: 0.8rem; margin-left: 0.5em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Layar lebar: diagram dikecilkan agar muat. Layar kecil: ukuran asli + scroll horizontal. */
@media (min-width: 761px) {
  .doc pre.mermaid svg, .diagram-body svg { max-width: 100%; height: auto; }
}
