:root {
  --bg: #fbfaf7;
  --fg: #1f2328;
  --muted: #5d6670;
  --line: #e3e0d8;
  --accent: #127a4a;
  --accent-soft: #e6f4ec;
  --code-bg: #f1efe9;
  --warn-bg: #fff6e0;
  --warn-line: #e8c46a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181b;
    --fg: #e6e6e3;
    --muted: #9aa3ad;
    --line: #2e3237;
    --accent: #5fd197;
    --accent-soft: #1c2e25;
    --code-bg: #23262a;
    --warn-bg: #2d2717;
    --warn-line: #8a6d24;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans", sans-serif;
}
a { color: var(--accent); }

.site-header, .content, .site-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}
.site-header { padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.site-title { font-weight: 700; text-decoration: none; color: var(--fg); }
.content { padding-top: 8px; padding-bottom: 32px; }
.site-footer { padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

h1 { font-size: 1.75rem; line-height: 1.25; margin: 0.6em 0 0.4em; }
h2 { font-size: 1.25rem; margin: 1.8em 0 0.5em; }
h3 { font-size: 1.05rem; margin: 1.4em 0 0.4em; }

/* Tables scroll sideways on narrow screens instead of breaking the page. */
table { display: block; overflow-x: auto; border-collapse: collapse; margin: 1em 0; max-width: 100%; }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--code-bg); }

code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.92em; }
blockquote { margin: 1em 0; padding: 0.6em 1em; border-left: 4px solid var(--warn-line); background: var(--warn-bg); }
blockquote p { margin: 0.3em 0; }

/* Example sentences: Portuguese on top, English below. */
.ex { list-style: none; padding: 0; }
.ex li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ex .pt { font-weight: 600; display: block; }
.ex .ipa { display: block; font-size: 0.9em; color: var(--accent); font-family: "Charis SIL", "Doulos SIL", "Gentium Plus", "Noto Sans", "Lucida Grande", sans-serif; }
.ex .en { color: var(--muted); display: block; }

details { margin: 0.8em 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
summary { cursor: pointer; font-weight: 600; }

/* Contents page */
.lead { color: var(--muted); }
.progress { display: inline-block; background: var(--accent-soft); color: var(--accent); padding: 2px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.toc-chapter h2 { margin-bottom: 0.1em; }
.ch-num { display: inline-block; min-width: 1.8em; color: var(--accent); }
.ch-summary { margin: 0 0 0.4em; color: var(--muted); font-size: 15px; }
.toc-items { list-style: none; padding: 0; margin: 0; }
.toc-items li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.toc-items .planned { color: var(--muted); }
.item-id { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); margin-right: 6px; }
.toc-items .published a { text-decoration: none; font-weight: 600; }
.toc-items .published::after { content: " ✓"; color: var(--accent); }

/* Lesson page */
.lesson-meta { color: var(--muted); font-size: 14px; margin: 1em 0 0; }
.goal { background: var(--accent-soft); padding: 10px 14px; border-radius: 8px; }
.sources { margin-top: 2.5em; padding-top: 0.5em; border-top: 2px solid var(--line); font-size: 15px; }
.sources ol { padding-left: 1.3em; }
.sources li { margin-bottom: 0.6em; overflow-wrap: anywhere; }
.source-use, .status-note { color: var(--muted); }
.status { font-weight: 600; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 2em; font-size: 15px; }
.lesson-nav .next { text-align: right; margin-left: auto; }
