:root {
  color-scheme: dark;
  --page: #111c19;
  --board: #192d27;
  --card: #203b32;
  --hover: #29483d;
  --line: #3b584d;
  --text: #f5f0df;
  --secondary: #c4d1c7;
  --accent: #f1d18c;
  font-family: system-ui, -apple-system, "PingFang SC", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--page); font-size: 1rem; line-height: 1.65; }
[lang="th"] { font-family: "Leelawadee UI", "Thonburi", "Noto Sans Thai", system-ui, sans-serif; }
a { color: inherit; }
summary:focus-visible, a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1:focus, h2:focus { outline: none; }
.site-header { border-bottom: 1px solid var(--line); }
.site-header a { display: block; max-width: 70rem; margin: auto; padding: 0.85rem clamp(1rem, 4vw, 2rem); font-weight: 700; text-decoration: none; }
main { max-width: 70rem; margin: auto; padding: clamp(1.2rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) 3rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 5vw, 2.85rem); line-height: 1.22; letter-spacing: -0.02em; }
h2 { font-size: 1.1rem; line-height: 1.5; }
.heading { padding-bottom: 1.1rem; }
.heading .progress { margin-top: 0.45rem; }
.progress { color: var(--secondary); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.controls { display: flex; align-items: center; flex-wrap: wrap; gap: 0.65rem; }
.directory-controls, .project-controls { padding: 0 0 1.2rem; }
button, input, select, .control {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--board);
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font: inherit;
}
button, select, .control { cursor: pointer; }
.control { display: inline-flex; align-items: center; text-decoration: none; }
button:hover, .control:hover { background: var(--hover); }
input { min-width: 0; flex: 1; }
input::placeholder { color: var(--secondary); opacity: .9; }
select { max-width: 100%; }
.category { border-top: 1px solid var(--line); }
.category:last-child { border-bottom: 1px solid var(--line); }
.category summary { cursor: pointer; padding: .9rem .2rem; font-weight: 650; }
.category summary::marker { color: var(--accent); }
.category summary .progress { float: right; font-weight: 400; }
.category .directory { padding-bottom: 1rem; }
.directory, .card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.directory-card, .word-card { border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; border-radius: 0.8rem; padding: 0.85rem 1rem; overflow-wrap: anywhere; }
a.directory-card:hover, .word-card:hover { background: var(--hover); }
.directory-card p, .translation, .register { color: var(--secondary); }
.directory-card p { font-size: 0.9rem; }
.directory-card.pending { background: transparent; border-color: #2c423a; }
.word-card { display: flex; flex-direction: column; align-items: flex-start; }
.word-card strong { font-size: 1.22rem; }
.word-number { color: var(--accent); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.lesson { max-width: 52rem; }
.lesson-nav { justify-content: space-between; margin-bottom: 0.75rem; }
.board { border: 1px solid var(--line); border-radius: 0.9rem; background: var(--board); padding: clamp(0.9rem, 4vw, 2rem); }
.board h2 { font-size: clamp(1.6rem, 5vw, 2.55rem); overflow-wrap: anywhere; }
.meaning { font-size: 1.15rem; color: var(--accent); }
.register { font-size: 0.9rem; }
.sample { background: var(--card); border-radius: 0.65rem; margin-top: 1rem; padding: clamp(0.75rem, 3vw, 1.25rem); overflow-wrap: anywhere; }
.example { font-size: clamp(1.1rem, 3vw, 1.4rem); line-height: 1.75; }
.sample .translation { margin-top: 0.3rem; }
.note { margin-top: 1rem; overflow-wrap: anywhere; }
.clipboard-buffer { position: fixed; left: -9999px; }
@media (max-width: 38rem) {
  .directory, .card-grid { grid-template-columns: 1fr; }
  .project-controls select:first-child { flex: 1 1 100%; }
}
