:root {
  --bg: #f6f5f1; --card: #ffffff; --ink: #1c1f1e; --muted: #5f6763; --line: #e2e0d8;
  --accent: #0f766e; --accent-ink: #ffffff; --soft: #e3f1ee; --warn: #b45309; --warn-soft: #fdf1dc;
  --bad: #b42318; --bad-soft: #fde8e6; --ok: #15803d; --ok-soft: #e2f4e7; --lock: #a6aba8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121514; --card: #1b1f1e; --ink: #ecefed; --muted: #9aa39f; --line: #2c3331;
    --accent: #2dd4bf; --accent-ink: #06201d; --soft: #16312d; --warn: #fbbf24; --warn-soft: #352a10;
    --bad: #f97066; --bad-soft: #3a1a17; --ok: #4ade80; --ok-soft: #153021; --lock: #5d6562;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
p { margin: 0 0 10px; }
.loading { padding: 40px 16px; text-align: center; color: var(--muted); }
.top { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1040px; margin: 0 auto; padding: 10px 16px 0; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-weight: 700; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand b { color: var(--accent); }
.who { font-size: 0.82rem; color: var(--muted); display: flex; gap: 10px; align-items: center; }
nav { display: flex; gap: 2px; overflow-x: auto; margin-top: 6px; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav a { padding: 8px 11px; white-space: nowrap; text-decoration: none; color: var(--muted); font-size: 0.92rem; border-bottom: 2px solid transparent; }
nav a.on { color: var(--ink); border-color: var(--accent); font-weight: 600; }
main { max-width: 1040px; margin: 0 auto; padding: 22px 16px 60px; }
.eyebrow { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.sub { color: var(--muted); margin-bottom: 18px; max-width: 70ch; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat .v { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 0.82rem; color: var(--muted); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 0.78rem; font-weight: 600; background: var(--soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.mute { background: var(--line); color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.steps li:first-child { border-top: 0; }
.steps input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.steps .done { color: var(--muted); text-decoration: line-through; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 10px; font-size: 0.9rem; text-decoration: none; }
.prompt { background: var(--soft); border-radius: 10px; padding: 12px; font-size: 0.92rem; white-space: pre-wrap; margin-bottom: 8px; }
label { display: block; font-size: 0.86rem; font-weight: 600; margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=url], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit;
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 14px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.small { padding: 4px 9px; font-size: 0.84rem; }
button.danger { color: var(--bad); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 200px; }
.mt { margin-top: 12px; }
.muted { color: var(--muted); font-size: 0.9rem; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.week { margin-bottom: 18px; }
.week-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { display: block; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px; min-height: 74px; text-decoration: none; color: var(--ink); font-size: 0.8rem; line-height: 1.3; }
.day b { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.day.done { background: var(--ok-soft); border-color: transparent; }
.day.now { border-color: var(--accent); box-shadow: 0 0 0 2px var(--soft); }
.day.locked { color: var(--lock); background: transparent; border-style: dashed; }
.day.redo { background: var(--warn-soft); }
@media (max-width: 720px) { .days { grid-template-columns: repeat(2, 1fr); } h1 { font-size: 1.4rem; } }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 118px 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 0.9rem; }
.feed li:first-child { border-top: 0; }
.feed time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.82rem; }
.feed .adm { color: var(--warn); }
.note { border-left: 3px solid var(--accent); background: var(--soft); padding: 10px 12px; border-radius: 0 8px 8px 0; margin-bottom: 12px; }
.note.warn { border-color: var(--warn); background: var(--warn-soft); }
.note.ok { border-color: var(--ok); background: var(--ok-soft); }
.quiz fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.quiz legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.quiz label { font-weight: 400; display: flex; gap: 8px; margin: 3px 0; font-size: 0.95rem; }
.quiz .right { color: var(--ok); font-weight: 600; }
.quiz .wrong { color: var(--bad); }
.login { max-width: 420px; margin: 8vh auto 0; padding: 0 16px; }
.login .card { padding: 22px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button.on { background: var(--soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.foot { margin-top: 30px; color: var(--muted); font-size: 0.82rem; text-align: center; }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 99px; font-size: 0.9rem; opacity: 0; pointer-events: none; transition: opacity 0.2s; max-width: 90vw; }
#toast.on { opacity: 1; }
pre.sentence { white-space: pre-wrap; font: inherit; font-size: 0.92rem; background: var(--bg); border: 1px solid var(--line); padding: 10px; border-radius: 8px; margin: 0 0 8px; }
ol.plain, ul.plain { margin: 0; padding-left: 20px; }
ol.plain li, ul.plain li { margin-bottom: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
