:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #17191c;
  --ink-2: #454a52;
  --muted: #6c727c;
  --line: #dcdad3;
  --accent: #2f6fed;
  --accent-ink: #ffffff;
  --danger: #b3261e;
  --paper: #ffffff;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131416;
    --surface: #1b1d20;
    --ink: #eef0f3;
    --ink-2: #c3c8d0;
    --muted: #8e95a0;
    --line: #2d3036;
    --accent: #6f9cff;
    --accent-ink: #0b1220;
    --danger: #ff8a80;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
  padding: 18px 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.node {
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent);
  background: var(--surface);
}
.who { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--muted); font-size: 14px; }
main { max-width: 920px; margin: 0 auto; padding: 8px 16px 72px; }
h1 { margin: 0; font-size: clamp(26px, 5vw, 38px); line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
.hero { display: flex; flex-direction: column; gap: 18px; padding-top: 6vh; max-width: 62ch; }
.lede { font-size: 18px; color: var(--ink-2); }
.quiet { color: var(--muted); font-size: 14px; }
ul.quiet { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button.secondary { background: transparent; color: var(--accent); }
.button:disabled { opacity: 0.55; cursor: progress; }
.button:focus-visible, .link:focus-visible, .drop:focus-within, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.link { border: 0; padding: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
details { color: var(--ink-2); }
summary { cursor: pointer; color: var(--muted); font-size: 14px; width: max-content; max-width: 100%; }
.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; max-width: 420px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-2); }
.stack input {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: 14px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.work { display: flex; flex-direction: column; gap: 24px; padding-top: 12px; }
.panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 16px;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
}
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-title { font-weight: 600; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.modes legend { padding: 0; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.mode {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.mode:has(input:checked) { border-color: var(--accent); }
.mode input { margin-top: 4px; accent-color: var(--accent); }
.mode span { display: flex; flex-direction: column; gap: 2px; }
.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.error { color: var(--danger); }
.result { display: flex; flex-direction: column; gap: 16px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
figure { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
figure img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  /* Drawings are dark ink on light paper in both themes. */
  background: var(--paper);
}
figcaption { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) {
  .modes, .compare { grid-template-columns: 1fr; }
}
