* { box-sizing: border-box; }
:root { color-scheme: light; --paper:#f6f4ed; --ink:#162d26; --muted:#52645c; --green:#164635; --line:#d9dfd2; }
body { margin:0; background:var(--paper); color:var(--ink); font: 17px/1.52 system-ui, sans-serif; }
.shell { max-width:712px; margin:auto; padding:0 max(20px, env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
header { border-bottom:1px solid var(--line); padding:19px 0; }
header a { color:var(--green); display:inline-flex; align-items:center; gap:10px; min-height:44px; font-weight:680; text-decoration:none; }
header span { display:grid; place-items:center; border-radius:11px; width:39px; height:39px; background:var(--green); color:#fff; font:italic 20px Georgia,serif; }
main { padding-top:24px; }
h1,h2 { font-family:Georgia,serif; font-weight:500; line-height:1.08; margin:0 0 15px; }
h1 { font-size:clamp(36px, 8vw, 62px); letter-spacing:-.045em; overflow-wrap:anywhere; }
h2 { font-size:30px; }
p { margin:0 0 14px; }
small,.muted { color:var(--muted); }
small { font-size:14px; }
.hero { background:#183f32; color:#fff9e9; border-radius:24px; padding:clamp(23px,6vw,42px); margin:4px 0 19px; }
.hero p { color:#dbebdc; margin:0; }
.hero h1 { max-width:11ch; }
.actions { display:grid; gap:11px; }
.tile { display:grid; grid-template-columns:48px 1fr auto; gap:14px; align-items:center; min-height:83px; padding:13px 15px; text-decoration:none; color:inherit; border:1px solid var(--line); background:#fffdf7; border-radius:17px; }
.tile strong { display:block; font-size:20px; line-height:1.22; }
.tile .icon { width:48px; height:48px; display:grid; place-items:center; border-radius:13px; color:var(--green); background:#e2eadc; }
.tile:nth-child(2) .icon { background:#f6e5bc; }
.tile:nth-child(3) .icon { background:#e8e5f2; }
.icon svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; }
.foot { margin-top:17px; font-size:15px; color:var(--muted); }
.back { display:inline-flex; align-items:center; min-height:44px; margin:-8px 0 12px; color:var(--green); font-weight:650; }
.panel { background:#fffdf7; border:1px solid var(--line); border-radius:19px; padding:clamp(17px,4vw,26px); margin:0 0 16px; }
.rule { background:#e7eee1; }
.pattern { font-weight:700; white-space:pre-line; overflow-wrap:anywhere; }
.entry { display:grid; grid-template-columns:1fr auto; align-items:baseline; gap:2px 10px; border-top:1px solid var(--line); padding:10px 0; }
.entry span { grid-column:1/-1; }
.example { border-top:1px solid var(--line); padding:11px 0; margin:0; }
.example span,.example small { display:block; }
.example small { margin-top:4px; }
[lang=en] { overflow-wrap:anywhere; }
button,.button { cursor:pointer; font:inherit; font-weight:690; color:white; background:var(--green); border:1px solid var(--green); border-radius:12px; min-height:48px; padding:10px 15px; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; text-align:center; }
.secondary { background:#fffdf7; color:var(--green); border-color:#b5c4b6; }
button:disabled { opacity:.52; cursor:default; }
:focus-visible { outline:3px solid #9a5a19; outline-offset:3px; }
input { width:100%; font:inherit; padding:11px; border:1px solid #879b8b; border-radius:10px; background:#fff; color:var(--ink); margin:6px 0 12px; }
.row,.tokens { display:flex; flex-wrap:wrap; gap:9px; }
.tokens { min-height:54px; margin:8px 0 12px; align-items:center; }
.selection { background:#e7eee1; border-radius:10px; padding:8px; }
.feedback { margin-top:16px; border-radius:12px; background:#e7eee1; padding:14px; }
.feedback.error { background:#ffecd8; color:#623619; }
.feedback p:last-child,.panel p:last-child { margin-bottom:0; }
.storage { background:#ffecd8; padding:10px; border-radius:10px; }
a,button,input { -webkit-tap-highlight-color:rgba(22,70,53,.15); }
[hidden] { display:none !important; }


h3 { font-size:19px; margin:19px 0 9px; }
textarea { display:block; resize:vertical; min-height:112px; width:100%; font:inherit; color:var(--ink); background:white; border:1px solid #879b8b; border-radius:10px; padding:11px; margin:6px 0 14px; }
.course-actions { margin-bottom:15px; }
.course-list { list-style:none; margin:0; padding:0; display:grid; gap:9px; }
.course-list strong + small { display:block; margin-top:4px; }
.course-list .tile { min-height:75px; }
.lesson-index { display:grid; place-items:center; width:42px; height:42px; border-radius:10px; font-weight:700; background:#e2eadc; }
.locked { color:var(--muted); background:transparent; border-style:dashed; }
.locked .lesson-index { background:#ecebe3; }
.topic { color:var(--muted); font-size:19px; }
.word + .word { margin-top:7px; }
.word .example { padding:0 0 9px; border-top:0; }
.word .entry { padding-bottom:5px; }
.exercise-heading { font-size:clamp(32px,7vw,49px); }
.hint-area:not(:empty) { margin-top:12px; background:#f6edca; padding:11px 13px; border-radius:10px; }
.after-answer { margin-top:12px; }
details { margin-bottom:9px; }
summary { cursor:pointer; color:var(--green); font-weight:650; min-height:44px; padding:9px 0; }
summary + p { margin-top:4px; }
.lookup-results { padding-left:20px; margin-bottom:0; }
.check-item { display:flex; align-items:center; gap:10px; min-height:48px; margin-bottom:10px; }
.check-item input { width:22px; height:22px; flex:none; margin:0; accent-color:var(--green); }
#replace:not([hidden]) { margin-top:6px; }

