:root {
  --o: #c2410c; --o2: #f97316; --ink: #1c1917; --mut: #6b6560; --line: #e7e5e4; --bg: #fafaf9; --card: #fff;
  --ok: #15803d; --bad: #b91c1c; --accent: #c2410c; --r: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
  background: var(--bg); -webkit-tap-highlight-color: transparent; }
.boot { padding: 40px; text-align: center; color: var(--mut); }
a { color: var(--o); }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 19px; margin: 22px 0 10px; }
h3 { font-size: 16px; margin: 14px 0 6px; }
.muted { color: var(--mut); font-size: 14px; }
.small { font-size: 13px; }
.top { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line);
  padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 800; font-size: 18px; letter-spacing: -.2px; }
.brand span { color: var(--o); }
.top .sp { flex: 1; }
.wrap { max-width: 860px; margin: 0 auto; padding: 18px 16px 96px; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.nav a { flex: 1; text-align: center; text-decoration: none; color: var(--mut); font-size: 12px; padding: 4px 0;
  border-radius: 10px; }
.nav a b { display: block; font-size: 20px; line-height: 1.2; }
.nav a[aria-current] { color: var(--o); font-weight: 700; }
@media (min-width: 900px) { .nav { position: sticky; top: 53px; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line);
  justify-content: center; gap: 6px; } .nav a { flex: 0 0 120px; } .wrap { padding-bottom: 40px; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 12px 0; }
.card.click { cursor: pointer; display: block; color: inherit; text-decoration: none; }
.card.click:hover { border-color: var(--o2); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.btn { appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 12px;
  padding: 11px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
.btn.primary { background: var(--o); border-color: var(--o); color: #fff; }
.btn.wa { background: #15803d; border-color: #15803d; color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 14px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 11px 12px; border: 1px solid #d6d3d1; border-radius: 12px;
  background: #fff; color: var(--ink); min-height: 44px; }
textarea { min-height: 90px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid #fed7aa; border-color: var(--o2); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 14px 0; }
.check input { width: 24px; min-height: 24px; height: 24px; flex: none; margin-top: 2px; accent-color: var(--o); }
.seg { display: flex; background: #f5f5f4; border-radius: 12px; padding: 4px; gap: 4px; margin: 10px 0 16px; }
.seg button { flex: 1; border: 0; background: none; font: inherit; font-weight: 600; padding: 10px; border-radius: 9px;
  cursor: pointer; color: var(--mut); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.hero { border-radius: 20px; padding: 20px; color: #fff; background: linear-gradient(135deg, var(--accent), #1c1917 160%); }
.hero h1 { color: #fff; }
.hero p { margin: 4px 0 0; opacity: .95; }
.moods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0 4px; }
.moods button { border: 2px solid rgba(255,255,255,.35); background: rgba(0,0,0,.14); color: #fff; border-radius: 14px;
  padding: 8px 2px; font: inherit; font-size: 12px; cursor: pointer; }
.moods button b { display: block; font-size: 28px; line-height: 1.2; }
.moods button[aria-pressed="true"] { background: #fff; color: var(--ink); border-color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.kpi span { display: block; color: var(--mut); font-size: 13px; }
.kpi b { font-size: 21px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #f5f5f4; color: #44403c; }
.pill.ok { background: #dcfce7; color: #166534; }
.pill.warn { background: #fef3c7; color: #92400e; }
.pill.o { background: #ffedd5; color: #9a3412; }
.item { display: flex; gap: 12px; align-items: center; }
.item .ic { width: 42px; height: 42px; border-radius: 12px; background: #ffedd5; display: flex; align-items: center;
  justify-content: center; font-size: 20px; flex: none; }
.item.done .ic { background: #dcfce7; }
.bar { height: 10px; background: #f5f5f4; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--o); border-radius: 99px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--mut); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.chart div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
  font-size: 11px; color: var(--mut); height: 100%; }
.chart i { display: block; width: 100%; max-width: 46px; background: var(--o2); border-radius: 6px 6px 0 0; min-height: 2px; }
.code { font: 700 34px/1.2 ui-monospace, Menlo, monospace; letter-spacing: 4px; text-align: center; padding: 12px;
  background: #fff7ed; border: 2px dashed #fdba74; border-radius: 14px; margin: 10px 0; }
.lesson { font-size: 17px; line-height: 1.65; }
.lesson h2, .lesson h3 { margin-top: 22px; }
.lesson pre { background: #1c1917; color: #fafaf9; padding: 12px; border-radius: 12px; overflow-x: auto; font-size: 13px; }
.lesson code { background: #f5f5f4; padding: 1px 5px; border-radius: 5px; font-size: 14px; }
.lesson pre code { background: none; padding: 0; color: inherit; }
.lesson table { margin: 10px 0; }
.video { position: relative; padding-top: 56.25%; border-radius: 14px; overflow: hidden; background: #000; margin: 12px 0; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.quiz fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 10px 0; }
.quiz legend { font-weight: 600; padding: 0 6px; }
.quiz label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.quiz label input { width: 20px; min-height: 20px; height: 20px; flex: none; margin-top: 2px; }
.quiz .right { color: var(--ok); font-weight: 700; }
.quiz .wrong { color: var(--bad); text-decoration: line-through; }
.avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; background: #ffedd5; display: flex;
  align-items: center; justify-content: center; font-weight: 800; color: #9a3412; font-size: 30px; flex: none; }
dialog { border: 0; border-radius: 20px; padding: 0; max-width: min(720px, 94vw); width: 100%; }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog .in { padding: 20px; max-height: 80vh; overflow: auto; }
dialog .ft { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; z-index: 50; display: grid; gap: 8px; }
.toast { background: #1c1917; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90vw; }
.toast.err { background: var(--bad); }
.note { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.note.blue { background: #eff6ff; border-color: #bfdbfe; }
.center { text-align: center; }
.big { font-size: 28px; font-weight: 800; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
