:root {
  --brand: #8A3B52;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, white);
  --bg: #FAF7F8;
  --card: #FFFFFF;
  --text: #2A1D22;
  --muted: #7B6B71;
  --line: #EADFE3;
  --danger: #B3261E;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); min-height: 100vh; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 96px; }
h1 { font-size: 22px; margin: 8px 0 4px; }
h2 { font-size: 17px; margin: 20px 0 8px; }
p.muted, .muted { color: var(--muted); font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 15px; padding: 12px 16px; border-radius: 10px;
  border: 0; background: var(--brand); color: #fff; cursor: pointer; text-decoration: none;
}
button.block { width: 100%; margin-top: 16px; }
button.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
button.small { padding: 8px 12px; font-size: 13px; }
button.danger { background: var(--danger); }
button:disabled { opacity: .5; cursor: default; }

.tabs { display: flex; gap: 6px; background: var(--brand-soft); padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; background: transparent; color: var(--brand); }
.tabs button.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--brand); color: #fff; }
.topbar .logo { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.2); object-fit: cover;
  display: flex; align-items: center; justify-content: center; font-weight: 700; }
.topbar .name { font-weight: 700; font-size: 16px; }
.topbar .sub { font-size: 12px; opacity: .85; }
.topbar .grow { flex: 1; min-width: 0; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; }
.badge.bronze { background: #A9653A; }
.badge.silver { background: #8E9196; }
.badge.gold { background: #C49A1E; }
.badge.platinum { background: #6F8CA3; }

.colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.colors button { height: 48px; border-radius: 12px; padding: 0; border: 3px solid transparent; }
.colors button.on { border-color: var(--text); }
.colors small { display: block; text-align: center; font-size: 11px; color: var(--muted); margin-top: 2px; }

.choice { display: grid; gap: 8px; }
.choice label { display: flex; gap: 10px; align-items: center; font-weight: 500; margin: 0;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.choice input { width: auto; }

.list .row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list .row:last-child { border-bottom: 0; }
.list .row .grow { flex: 1; min-width: 0; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.pill.off { background: #eee; color: #888; }

.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { flex: 1; text-align: center; padding: 10px 4px; font-size: 12px; color: var(--muted); text-decoration: none; }
.bottomnav a.on { color: var(--brand); font-weight: 700; }
.bottomnav .ico { display: block; font-size: 20px; }

.steps { display: flex; gap: 6px; margin: 8px 0 16px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--brand); }

.logo-preview { width: 72px; height: 72px; border-radius: 16px; background: var(--brand-soft); object-fit: cover; }
.err { color: var(--danger); font-size: 14px; margin-top: 8px; min-height: 1em; }
.idbox { font-family: ui-monospace, Menlo, monospace; background: var(--brand-soft); color: var(--brand);
  padding: 4px 8px; border-radius: 6px; font-weight: 700; }

#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--text); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.show { opacity: 1; }
