:root {
  --accent: #635bff;
  --accent-soft: #a594ff;
  --bg: #ffffff;
  --card: #f6f9fc;
  --fg: #0a2540;
  --muted: #425466;
  --border: #e3e8ee;
  --accent-fg: #ffffff;
  --ok: #12805c;
  --ok-bg: #e3f6ee;
  --warn: #8a5a00;
  --warn-bg: #fff3d6;
  --err: #c0392b;
  --err-bg: #fde8e5;
  --info: #425466;
  --info-bg: #eef2f7;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #a594ff;
    --accent-soft: #635bff;
    --bg: #0a2540;
    --card: #0e2d4a;
    --fg: #f6f9fc;
    --muted: #8898aa;
    --border: #1a3a5c;
    --accent-fg: #0a0a0e;
    --ok: #4ad9a8;
    --ok-bg: #0f3a33;
    --warn: #f0c988;
    --warn-bg: #3a2e0e;
    --err: #ff8a76;
    --err-bg: #43201f;
    --info: #b8c4d2;
    --info-bg: #17395a;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 16px;
}
main { max-width: 960px; margin: 0 auto; padding: 32px 0 64px; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 24px; font-size: 0.95rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { font-family: var(--mono); font-size: 0.88em; overflow-wrap: anywhere; }

form { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
input[type="text"] {
  flex: 1;
  min-width: 0;
  width: 100%;
  font: inherit;
  font-family: var(--mono);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--fg);
}
form input[type="text"] { width: auto; min-width: 180px; }
input[type="text"]:focus { outline: 2px solid var(--accent-soft); outline-offset: 1px; }
button[type="submit"] {
  font: inherit; font-weight: 600; padding: 10px 18px; border: none; border-radius: 8px;
  background: var(--accent); color: var(--accent-fg); cursor: pointer;
}
button[type="submit"]:hover { opacity: 0.92; }
button:disabled { opacity: 0.6; cursor: default; }
.btn2 {
  font: inherit; font-size: 0.9rem; padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--fg); cursor: pointer;
}
.more { font-size: 0.9rem; margin: 0 0 6px; }
.more summary { cursor: pointer; color: var(--muted); }
.more label { display: block; color: var(--muted); margin: 8px 0 4px; font-size: 0.85rem; }
.more input { max-width: 360px; }
.hint { font-size: 0.85rem; color: var(--muted); margin: 6px 0 22px; }

.summary {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px;
}
.sum-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sum-head h2 { margin: 0; font-family: var(--mono); font-size: 1.15rem; overflow-wrap: anywhere; }
.sum-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.counts { margin: 8px 0 0; font-weight: 600; }
.counts span { margin-right: 12px; white-space: nowrap; }
.note { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; }
.c-pass { color: var(--ok); }
.c-warn { color: var(--warn); }
.c-fail { color: var(--err); }

.sec { border: 1px solid var(--border); border-radius: 12px; margin: 0 0 16px; overflow: hidden; }
.sec > h2 {
  margin: 0; padding: 12px 16px; font-size: 1.05rem; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline;
}
.sec > h2 small { font-weight: 500; font-size: 0.85rem; color: var(--muted); }
.checks { list-style: none; margin: 0; padding: 0; }
.check { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.check:last-child { border-bottom: 0; }
.badge {
  display: inline-block; text-align: center; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  border-radius: 6px; padding: 3px 0; height: fit-content; margin-top: 2px;
}
.b-pass { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-fail { background: var(--err-bg); color: var(--err); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-wait { background: var(--info-bg); color: var(--muted); }
.check .t { font-weight: 600; overflow-wrap: anywhere; }
.check .d { color: var(--fg); font-size: 0.9rem; overflow-wrap: anywhere; }
.check .f { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.check .f::before { content: "Fix: "; font-weight: 600; }
.check .src { color: var(--muted); font-size: 0.78rem; }
.check.wait .t { color: var(--muted); font-weight: 500; }

.extra details { border-top: 1px solid var(--border); padding: 8px 16px; }
.extra summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; }
.tw { overflow-x: auto; margin: 8px 0 4px; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
th, td { text-align: left; vertical-align: top; padding: 5px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td { font-family: var(--mono); overflow-wrap: anywhere; word-break: break-word; min-width: 60px; }
td.diff { color: var(--warn); }
.chain { font-family: var(--mono); font-size: 0.82rem; margin: 6px 0; overflow-wrap: anywhere; }

.about { margin-top: 32px; font-size: 0.9rem; color: var(--muted); }
.about h2 { font-size: 1rem; color: var(--fg); }
.about ul { padding-left: 20px; }

footer { margin-top: 40px; font-size: 0.85rem; color: var(--muted); }
footer p { margin: 0 0 8px; }
footer p:last-child { margin-bottom: 0; }
footer hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

@media (max-width: 480px) {
  main { padding-top: 12px; }
  .check { grid-template-columns: 46px 1fr; padding: 10px 12px; gap: 8px; }
  .sec > h2 { padding: 10px 12px; }
  .extra details { padding: 8px 12px; }
  form input[type="text"] { min-width: 0; flex-basis: 100%; }
  button[type="submit"] { width: 100%; }
}

/* in plain words, technical details, example */
.plain h3 { font-size: 1rem; margin: 14px 0 8px; }
.plainlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.plainlist .pl { display: flex; gap: 10px; align-items: flex-start; }
.plainlist .pl > div { min-width: 0; }
.plainlist .more { white-space: nowrap; }
.example { font-size: .9rem; color: var(--muted); border-left: 3px solid var(--accent); padding: 6px 10px; margin: 8px 0 0; }
details.tech { margin: 16px 0; }
details.tech > summary, details.about > summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
details.about { margin-top: 24px; }
@media print {
  form, .more, .hint, .sum-actions, footer, details.tech > summary, details.about { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .sec { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}

/* score and examples */
.score { display: inline-flex; align-items: baseline; gap: 4px; margin: 12px 0 0; padding: 6px 14px; border-radius: 12px; border: 1px solid var(--border); }
.score .num { font-size: 2rem; font-weight: 700; line-height: 1; }
.score .of { color: var(--muted); }
.score .grade { margin-left: 10px; font-weight: 700; font-size: 1.2rem; padding: 0 10px; border-radius: 8px; color: #fff; }
.g-A .grade, .g-B .grade { background: #12805c; } .g-C .grade { background: #a86400; } .g-D .grade, .g-F .grade { background: #c0392b; }
.scorehow { margin: 6px 0 0; font-size: .88rem; color: var(--muted); }
.scorehow summary { cursor: pointer; }
.scorehow p { margin: 6px 0; }
.examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 14px; font-size: .88rem; }
.examples .ex { font: inherit; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--fg); cursor: pointer; }
.examples .ex[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
@media print { .examples, .scorehow summary { display: none !important; } }
