:root { --bg:#f5f6f8; --fg:#1d1f24; --card:#fff; --accent:#5865f2; --muted:#6b7280; --err:#c62828; --line:#d9dce1; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#1a1b1e; --fg:#e8e9ec; --card:#25272c; --muted:#9aa0aa; --line:#383b42; --err:#ff6b6b; }
}
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--fg); font:16px/1.5 system-ui,sans-serif; }
main { max-width:560px; margin:0 auto; padding:24px 16px 64px; }
header { display:flex; justify-content:space-between; align-items:center; }
h1 { font-size:1.5rem; margin:0; }
h2 { font-size:1rem; margin:20px 0 8px; }
h2:first-child { margin-top:0; }
small { color:var(--muted); font-weight:400; }
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:20px; margin-top:16px; }
.tabs { display:flex; gap:8px; margin-top:16px; }
.tabs button { flex:1; padding:10px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--fg); cursor:pointer; font:inherit; }
.tabs button.active { background:var(--accent); border-color:var(--accent); color:#fff; }
input, textarea { width:100%; padding:10px; border:1px solid var(--line); border-radius:8px; background:var(--bg); color:var(--fg); font:inherit; }
.btn { display:inline-block; margin-top:20px; padding:10px 18px; border:0; border-radius:8px; background:var(--accent); color:#fff; font:inherit; text-decoration:none; cursor:pointer; }
.btn:disabled { opacity:.5; cursor:wait; }
.link { background:none; border:0; color:var(--accent); cursor:pointer; font:inherit; }
.defaults { display:grid; grid-template-columns:repeat(auto-fill,minmax(88px,1fr)); gap:10px; }
.defaults label { border:2px solid var(--line); border-radius:10px; padding:8px; text-align:center; cursor:pointer; font-size:.85rem; }
.defaults input { display:none; }
.defaults label:has(input:checked) { border-color:var(--accent); }
.defaults img { width:100%; aspect-ratio:1; object-fit:contain; }
.error { color:var(--err); }
#status { min-height:1.5em; color:var(--muted); }
#status.error { color:var(--err); }
#result { text-align:center; }
#result img { width:128px; height:128px; object-fit:contain; background:repeating-conic-gradient(#8883 0 25%, transparent 0 50%) 0 0/16px 16px; border-radius:8px; }
