:root {
  --bg: #f6f7f9; --card: #ffffff; --fg: #1b1b1b; --muted: #5e5e5e;
  --line: rgba(0, 0, 0, 0.1); --accent: #5b4bff; --chip: #eef0f4;
  --ok: #0f7b46; --bad: #b42318;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1c20; --card: #23262b; --fg: #ececec; --muted: #a5a5a5;
    --line: rgba(255, 255, 255, 0.12); --accent: #8e82ff; --chip: #32363d;
    --ok: #4ec98a; --bad: #ff8b7d;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 28px 20px 60px; background: var(--bg); color: var(--fg);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 640px; margin: 0 auto; }
header { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
h1 { font-size: 20px; margin: 0 0 2px; }
.sub, .note, .hint { color: var(--muted); }
.sub { margin: 0; font-size: 13px; }
section {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 14px;
}
h2 {
  font-size: 14px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
}
.tag, .count {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  background: var(--chip); color: var(--muted); padding: 2px 7px; border-radius: 5px;
}
.note { font-size: 12.5px; margin: 0 0 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--accent); }
.check span { display: block; }
.check b { font-weight: 600; display: block; }
.check i { font-style: normal; font-size: 12.5px; color: var(--muted); }
.field { margin: 12px 0 0; }
.field.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.field.row .grow { flex: 1 1 120px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], select {
  font: inherit; width: 100%; padding: 7px 9px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
}
input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.hint { font-size: 12px; margin: 5px 0 0; }
button {
  font: inherit; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--chip); color: var(--fg); cursor: pointer; white-space: nowrap;
}
button:hover { filter: brightness(1.05); }
.result { font-size: 12.5px; margin: 10px 0 0; min-height: 1.2em; }
.result.ok { color: var(--ok); }
.result.bad { color: var(--bad); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 12px 0 0; }
.chips li {
  display: flex; align-items: center; gap: 6px; background: var(--chip);
  border-radius: 20px; padding: 3px 5px 3px 11px; font-size: 12.5px;
}
.chips button {
  border: none; background: none; padding: 0 4px; color: var(--muted);
  font-size: 14px; line-height: 1; border-radius: 50%;
}
.chips button:hover { color: var(--bad); }
.stats { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
footer { color: var(--muted); font-size: 12.5px; }
.swatch {
  display: inline-block; width: 22px; height: 4px; border-radius: 2px;
  vertical-align: 2px; margin: 0 2px 0 8px;
}
.swatch.spelling { background: #e5484d; }
.swatch.grammar { background: #2f6fd0; }
.swatch.punctuation { background: #8b5cf6; }
.swatch.style { background: #0f9b8e; }
.saved { color: var(--ok); min-height: 1.2em; }
