:root {
  --bg: #f6f5f1; --card: #ffffff; --ink: #1d232a; --muted: #66707a; --line: #dedad2;
  --accent: #2f5d8a; --accent-ink: #ffffff; --near: #2e8b57; --mid: #c9922b; --far: #b8483e;
  --radius: 10px; font-size: 17px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5; }
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  max-width: 40rem; margin: 0 auto; padding: 1rem 1rem 0.5rem; }
.brand { font-weight: 650; letter-spacing: 0.01em; }
.progress { color: var(--muted); font-size: 0.9rem; }
main { max-width: 40rem; margin: 0 auto; padding: 0 1rem 2rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; margin: 0.75rem 0; }
h1 { font-size: 1.35rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.05rem; margin: 1.25rem 0 0.5rem; }
p { margin: 0.5rem 0; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
label { display: block; margin: 0.35rem 0; }
fieldset { border: none; padding: 0; margin: 0.75rem 0; }
legend { font-weight: 600; margin-bottom: 0.25rem; }
input[type="text"], textarea, select { width: 100%; font: inherit; padding: 0.65rem 0.75rem;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
input[type="text"]:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 7rem; resize: vertical; }
label.field { margin: 0.9rem 0; font-weight: 600; }
label.field select { display: block; margin-top: 0.35rem; font-weight: 400; max-width: 22rem; }
button { font: inherit; border-radius: 8px; padding: 0.6rem 1.1rem; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); }
button.secondary { background: transparent; color: var(--accent); }
button.quiet { background: transparent; border-color: var(--line); color: var(--muted); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.row.grow > input { flex: 1 1 12rem; }
.actions { display: flex; gap: 0.5rem; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.error { color: var(--far); min-height: 1.4em; margin: 0.4rem 0 0; }
.warn { background: #fff7e6; border: 1px solid #f0d49a; border-radius: 8px; padding: 0.5rem 0.75rem; }
.counter { font-variant-numeric: tabular-nums; color: var(--muted); }
.list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.item { position: relative; display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.75rem; margin: 0.3rem 0; border-radius: 8px; background: #f1efea; overflow: hidden; }
.item .bar { position: absolute; inset: 0 auto 0 0; opacity: 0.22; }
.item span { position: relative; }
.item .rank { font-variant-numeric: tabular-nums; font-weight: 600; }
.item.near .bar { background: var(--near); } .item.mid .bar { background: var(--mid); }
.item.far .bar { background: var(--far); }
.item.invalid { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.item.hint { outline: 2px solid var(--accent); }
.item.latest { box-shadow: 0 0 0 3px var(--ink) inset; font-weight: 700; }
.tag { font-size: 0.78rem; color: var(--muted); margin-left: 0.4rem; }
.answer { font-size: 1.4rem; font-weight: 650; }
.scale { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.scale label { display: inline-flex; gap: 0.3rem; align-items: center; }
.foot { max-width: 40rem; margin: 0 auto; padding: 1rem; color: var(--muted); font-size: 0.82rem; }
.foot a { color: inherit; }
.tips { background: #eef5ee; border: 1px solid #cfe3cf; border-radius: 8px; padding: 0.4rem 1rem 0.6rem; margin: 0.75rem 0; }
.tips h2 { margin: 0.4rem 0; font-size: 1rem; }
.tips ol { padding-left: 1.3rem; }
[hidden] { display: none !important; }
.stepsbar { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: 0.35rem; counter-reset: st; }
.stepsbar li { counter-increment: st; font-size: 0.85rem; padding: 0.25rem 0.6rem; border-radius: 999px;
  background: #f0eee8; color: var(--muted); border: 1px solid var(--line); }
.stepsbar li::before { content: counter(st) ". "; }
.stepsbar li.past { opacity: 0.55; text-decoration: line-through; }
.stepsbar li.now { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
ul.key li { margin: 0.4rem 0; }
.practice-answer { margin: 0.75rem 0; padding: 0.6rem 0.8rem; border-radius: 8px; background: #eef5ee; border: 1px solid #cfe3cf; }
