:root {
  --bg: #ffffff;
  --fg: #16181d;
  --muted: #5b6270;
  --line: #dfe3ea;
  --panel: #f6f7f9;
  --accent: #3f51b5;
  --bad: #c0392b;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --fg: #e7e9ee;
    --muted: #99a1b0;
    --line: #2b2f38;
    --panel: #1b1e24;
    --accent: #8c9eff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  max-width: 52rem;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

h1 { margin: 0 0 .25rem; font-size: 2rem; letter-spacing: -.02em; }
h2 { margin: 2.5rem 0 .75rem; font-size: 1.1rem; }
.lede { margin: 0 0 2rem; color: var(--muted); max-width: 40rem; }
.note { color: var(--muted); font-size: .85rem; }
a { color: var(--accent); }

.bar {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin: .5rem 0;
}

#bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .2s ease;
}

#drop {
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  background: var(--panel);
  transition: border-color .15s ease, background .15s ease;
}

#drop:hover, #drop:focus-visible, #drop.over {
  border-color: var(--accent);
  outline: none;
}

#drop p { margin: 0; }
.link { color: var(--accent); text-decoration: underline; }

.samples {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin: .9rem 0 0;
  font-size: .9rem;
  color: var(--muted);
}

button {
  font: inherit;
  font-size: .9rem;
  padding: .3rem .7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}

button:hover { border-color: var(--accent); color: var(--accent); }

.panes {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: start;
}

@media (max-width: 620px) {
  .panes { grid-template-columns: minmax(0, 1fr); }
}

figure { margin: 0; }

canvas {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

figcaption { margin-top: .5rem; color: var(--muted); font-size: .8rem; }

label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .35rem; }

textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: .95rem;
  line-height: 1.5;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--fg);
  resize: vertical;
  word-break: break-all;
}

.row { display: flex; gap: .75rem; align-items: center; margin: .6rem 0 .8rem; }

.caveats ul { padding-left: 1.1rem; }
.caveats li { margin-bottom: .6rem; }

code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--panel);
  padding: .1em .35em;
  border-radius: 4px;
}

.warn {
  border-left: 3px solid var(--accent);
  padding-left: .7rem;
  margin-bottom: .8rem;
}
