:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1b1f2a;
  --muted: #5d6475;
  --line: #d9dde5;
  --accent: #b3261e;
  --accent-ink: #ffffff;
  --ok: #1e7a46;
  --warn: #8a5a00;
  --err: #b3261e;
  --focus: #2457c5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141a; --card: #1b1e27; --ink: #e8eaf0; --muted: #a2a8b8; --line: #323746;
    --accent: #e0574e; --ok: #4cc583; --warn: #e5b04a; --err: #ff7b72; --focus: #7aa2ff;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px 64px; }
.brand { font-weight: 800; letter-spacing: 0.2em; color: var(--accent); margin: 0 0 8px; font-size: 14px; }
h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.2; }
.lede { margin: 0 0 8px; color: var(--muted); }
.beta { margin: 0 0 20px; font-size: 13px; color: var(--muted); }
form, .done { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 16px; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-weight: 700; margin-bottom: 10px; padding: 0; }
label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.opt { font-weight: 400; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font: inherit; font-weight: 400;
  color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus, button:focus-visible, .pick:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
[aria-invalid="true"] { border-color: var(--err); }
.row.two { display: grid; gap: 0 12px; }
@media (min-width: 560px) { .row.two { grid-template-columns: 1fr 1fr; } }
.err { display: block; color: var(--err); font-size: 13px; font-weight: 500; margin-top: 4px; min-height: 0; }
.err:empty { display: none; }
.count { display: block; text-align: right; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 4px; }
.hint { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.pick { display: inline-block; cursor: pointer; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick span { display: inline-block; padding: 10px 16px; border: 1px dashed var(--muted); border-radius: 8px; font-weight: 600; }
.thumbs { list-style: none; padding: 0; margin: 12px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs li { position: relative; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,0.65); color: #fff; font-size: 16px; line-height: 28px; cursor: pointer; padding: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; }
.ts { margin: 16px 0; min-height: 65px; }
button { font: inherit; font-weight: 700; padding: 13px 20px; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); width: 100%; }
button:disabled { opacity: 0.6; cursor: wait; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); margin-top: 8px; }
.form-err { font-size: 14px; margin: 0 0 12px; }
.done h2 { margin: 0 0 8px; color: var(--ok); }
.done.warn h2 { color: var(--warn); }
.ref { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 26px; font-weight: 800;
  font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.04em; margin: 4px 0 12px; }
.ref button { width: auto; font-size: 14px; padding: 8px 14px; background: transparent; color: var(--ink); border: 1px solid var(--line); }
