:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1c1b18;
  --muted: #66635b;
  --line: #dedbd2;
  --accent: #1f5fd1;
  --accent-text: #ffffff;
  --accent-soft: #e8effc;
  --ok: #1d7a45;
  --bad: #b3261e;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15161a;
    --surface: #1e2026;
    --text: #ecebe7;
    --muted: #a09d94;
    --line: #33363f;
    --accent: #7aa7ff;
    --accent-text: #0d1220;
    --accent-soft: #232c40;
    --ok: #6fd39a;
    --bad: #ff8a80;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
header.site { border-bottom: 1px solid var(--line); background: var(--surface); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
header.site nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
header.site nav a:hover { color: var(--text); }
main { padding: 32px 0 48px; }
h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 10px; text-wrap: balance; }
h2 { font-size: 20px; margin: 40px 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 16px; margin: 20px 0 4px; }
p { margin: 0 0 12px; }
.lede { color: var(--muted); font-size: 18px; margin-bottom: 24px; max-width: 60ch; }
.muted { color: var(--muted); font-size: 14px; }

.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.drop {
  border: 2px dashed var(--line); border-radius: 10px; padding: 36px 16px; text-align: center;
  transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop p { margin: 0; }
.drop .big { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.drop .muted { margin-top: 10px; }
.drop input[type=file] { display: none; }

button, .button {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 8px 14px; display: inline-block; line-height: 1.3;
}
button:hover, .button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.primary:disabled { opacity: .6; cursor: default; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; font-size: inherit; }
button.icon { border: 0; background: none; padding: 0 6px; font-size: 20px; line-height: 1; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.options { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 16px; }
.opt { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); min-width: 150px; }
.opt-checkbox { flex-direction: row; align-items: center; gap: 8px; color: var(--text); align-self: end; padding-bottom: 8px; }
.opt select, .opt input[type=number] {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%;
}
.opt input[type=range] { accent-color: var(--accent); width: 100%; }
.opt output { color: var(--text); font-variant-numeric: tabular-nums; }

.list { list-style: none; margin: 16px 0 0; padding: 0; }
.list:empty { display: none; }
.list li {
  display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px;
}
.list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .size { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.status { color: var(--muted); max-width: 50%; text-align: right; }
.status.done { color: var(--ok); }
.status.error { color: var(--bad); }
#results li .name { font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.actions[hidden], .options[hidden] { display: none; }
#notice { color: var(--bad); font-size: 14px; margin: 12px 0 0; }
#notice:empty { display: none; }

ol.steps { padding-left: 20px; margin: 0 0 12px; }
ol.steps li { margin-bottom: 4px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.grid a {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; text-decoration: none; color: var(--text); font-weight: 600; height: 100%;
}
.grid a:hover { border-color: var(--accent); }
.grid a small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }

.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 24px 0 0; padding: 0; list-style: none; }
.points li strong { display: block; }
.points li { color: var(--muted); font-size: 14px; }
.points li strong { color: var(--text); font-size: 16px; }

footer.site { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
