:root {
  --bg: #f6f4f1;
  --card: #ffffff;
  --ink: #1d1b19;
  --muted: #6f6a64;
  --line: #e6e1da;
  --accent: #b5532e;
  --accent-ink: #ffffff;
  --ok: #2f7d4f;
  --ok-bg: #e9f5ee;
  --warn: #8a5a00;
  --warn-bg: #fff4dc;
  --err: #a8322d;
  --err-bg: #fdecea;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
.loading { color: var(--muted); }

.top { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 8px 0 12px; }
.brand { font-weight: 700; letter-spacing: -0.01em; }
.count { color: var(--muted); font-size: 14px; margin-top: 2px; }
.bar { height: 6px; background: var(--line); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); transition: width 0.3s; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-top: 8px;
}
.eyebrow { margin: 0; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
h1 { font-size: 24px; line-height: 1.25; margin: 6px 0 4px; letter-spacing: -0.01em; }
h3 { font-size: 16px; margin: 22px 0 8px; }
.hint { color: var(--muted); margin: 0 0 4px; }
.small { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

.how { padding-left: 20px; margin: 12px 0 18px; }
.how li { margin: 6px 0; }

.promptbox { position: relative; }
.prompt {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  font: 14px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  background: #faf8f5;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.copy { margin-top: 8px; }

.checks { padding-left: 0; list-style: none; margin: 0; }
.checks li { padding-left: 26px; position: relative; margin: 6px 0; }
.checks li::before { content: "☐"; position: absolute; left: 2px; color: var(--muted); }

.drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: #faf8f5;
  color: var(--muted);
  text-align: center;
  padding: 12px;
  cursor: pointer;
}
.drop.over { border-color: var(--accent); }
.drop img { max-height: 320px; max-width: 100%; border-radius: 10px; }
.file { position: absolute; width: 1px; height: 1px; opacity: 0; }

button {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 18px;
  min-height: 46px;
  cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button:disabled { opacity: 0.45; cursor: default; }
button.wide { width: 100%; margin-top: 12px; }

.nav { display: flex; gap: 10px; justify-content: space-between; margin-top: 24px; flex-wrap: wrap; }
.nav .primary { margin-left: auto; }

.note { border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 15px; }
.note.ok { background: var(--ok-bg); color: var(--ok); }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.err { background: var(--err-bg); color: var(--err); }

.uploaded { font-size: 14px; color: var(--muted); margin-top: 12px; }

.tips { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 4px; }
.tips ul { padding-left: 20px; margin: 6px 0 0; }
.tips li { margin: 6px 0; }

.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; margin-top: 18px; }
.chip { min-height: 40px; padding: 6px 0; font-size: 14px; border-radius: 10px; }
.chip.done { background: var(--ok-bg); border-color: #cfe7d8; color: var(--ok); }
.chip.current { outline: 2px solid var(--accent); outline-offset: 1px; }
.chip.optional { border-style: dashed; }

.summary { list-style: none; padding: 0; margin: 12px 0 0; }
.summary li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.summary .state { white-space: nowrap; color: var(--muted); }
.summary .state.done { color: var(--ok); }

@media (max-width: 480px) {
  h1 { font-size: 21px; }
  .card { padding: 18px 16px; }
  .nav button { flex: 1 1 auto; }
}
