:root {
  --bg: #f6f1e7;
  --card: #fffdf8;
  --ink: #2b2417;
  --muted: #7a6f5c;
  --line: #e5dccb;
  --accent: #d9a400;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, sans-serif; color: var(--ink); background: var(--bg); }
header { padding: 18px 24px 8px; }
h1 { margin: 0; font-size: 26px; }
h2 { margin: 0 0 8px; font-size: 16px; }
.sub { margin: 4px 0 0; color: var(--muted); }
main { display: grid; grid-template-columns: 340px 1fr; gap: 20px; padding: 12px 24px 40px; }
@media (max-width: 900px) { main { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 12px; border: 2px dashed var(--accent); border-radius: 10px; background: var(--card); cursor: pointer; text-align: center; }
.drop.over { background: #fff3c4; }
.drop small { color: var(--muted); }
.examples { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; margin-top: 10px; font-size: 13px; color: var(--muted); }
.examples .example { padding: 0; border: 2px solid var(--line); border-radius: 6px; background: none; line-height: 0; grid-row: span 2; }
.examples .example:hover { border-color: var(--accent); }
.examples .example img { width: 96px; height: 64px; object-fit: cover; border-radius: 4px; }
.examples .credit { font-size: 11px; }
.examples .credit a { color: inherit; }
.images { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.thumb { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; }
.thumb.active { outline: 2px solid var(--accent); }
.thumb img, .thumb-placeholder { display: block; width: 64px; height: 48px; object-fit: cover; border-radius: 4px; background: #eee6d4; }
.thumb .name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb .n { font-size: 13px; color: var(--muted); }
.thumb .status { color: var(--muted); font-size: 12px; }
.thumb button { font-size: 12px; }
.big { text-align: center; border-radius: 8px; padding: 10px 4px; background: #fff3c4; }
.big b { display: block; font-size: 30px; line-height: 1.1; }
.big span { font-size: 12px; color: var(--muted); }
.big.inline { margin-left: auto; padding: 4px 14px; display: inline-flex; gap: 6px; align-items: baseline; }
.big.inline b { font-size: 22px; }
.row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
button { font: inherit; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.danger { color: #a22; }
.toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 10px; }
.toolbar label { display: inline-flex; gap: 6px; align-items: center; }
.toolbar output { min-width: 2.6em; font-variant-numeric: tabular-nums; }
.canvas-wrap { width: 100%; overflow: auto; }
canvas { display: block; max-width: 100%; height: auto; cursor: crosshair; border-radius: 6px; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.empty { color: var(--muted); padding: 40px; text-align: center; }
.status { font-size: 13px; }
.status.ready { color: #2a7a2a; }
.status.error { color: #a22; }

/* link back to the source, bottom right like on arxiv-comments */
.github-icon { position: fixed; bottom: 10px; right: 10px; display: inline-block; }
.github-icon img { width: 24px; height: 24px; opacity: 0.7; transition: opacity 0.3s; }
.github-icon img:hover { opacity: 1; }
