:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #5f5e5a;
  --line: #e4e1da;
  --accent: #2f5d8a;
  --accent-ink: #ffffff;
  --ok: #2e7d4f;
  --warn: #a15c00;
  --err: #b3261e;
  --code: #f2efe9;
  --radius: 10px;
  --max: 860px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --surface: #1f1f1d;
    --text: #ecebe7;
    --muted: #a9a7a0;
    --line: #34332f;
    --accent: #8db4dc;
    --accent-ink: #10202f;
    --ok: #79c497;
    --warn: #e0a85a;
    --err: #f2918a;
    --code: #2a2926;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
header.site { border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
header.site a.brand { font-weight: 700; text-decoration: none; color: var(--text); }
header.site nav a { margin-left: 14px; font-size: 14px; color: var(--muted); text-decoration: none; }
header.site nav a:hover { color: var(--text); }
main { padding: 28px 0 48px; }
h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.3rem; margin: 36px 0 10px; }
h3 { font-size: 1.05rem; margin: 22px 0 6px; }
.lead { color: var(--muted); margin: 0 0 22px; font-size: 1.05rem; }
.badge { display: inline-block; font-size: 13px; color: var(--ok); border: 1px solid currentColor; border-radius: 999px; padding: 1px 10px; margin-bottom: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
input[type="text"], input[type="number"], input[type="password"], select {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit;
}
input[type="color"] { width: 44px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; vertical-align: middle; }
input:focus, select:focus, button:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button, .button {
  display: inline-block; border: 0; border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 600;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none;
}
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.drop {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 26px 16px; text-align: center; color: var(--muted);
  background: var(--surface); cursor: pointer;
}
.drop.over { border-color: var(--accent); color: var(--text); }
.drop input { display: none; }
.status { margin-top: 12px; font-size: 14px; min-height: 1.4em; }
.status.err { color: var(--err); }
.status.ok { color: var(--ok); }
.results { margin-top: 18px; }
.big { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .k { font-size: 13px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
table.text td, table.text th { text-align: left; }
tr.pick td { font-weight: 700; color: var(--ok); }
.tablewrap { overflow-x: auto; }
.swatch { height: 90px; border-radius: 8px; border: 1px solid var(--line); }
.covers { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.covers figure { margin: 0; }
.covers img { max-width: 160px; max-height: 240px; border: 1px solid var(--line); border-radius: 4px; display: block; }
.covers figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }
.filelist { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; }
.filelist li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 4px 0; }
code { background: var(--code); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }
.formula { background: var(--code); padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-family: ui-monospace, monospace; font-size: 14px; }
details { border-top: 1px solid var(--line); padding: 10px 0; }
details summary { cursor: pointer; font-weight: 600; }
.tools { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tools a.card { text-decoration: none; color: var(--text); display: block; }
.tools a.card:hover { border-color: var(--accent); }
.tools .card p { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer.site .wrap { padding-top: 18px; padding-bottom: 28px; display: flex; gap: 16px; flex-wrap: wrap; }
footer.site a { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
footer.site .foot-tools { display: flex; flex-wrap: wrap; gap: 6px 16px; width: 100%; }
