:root {
  --bg: #f2f2f7;
  --card: #fff;
  --text: #111;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #007aff;
  --danger: #ff3b30;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
}
.wrap { max-width: 480px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.tree {
  text-align: center;
  padding: 20px 12px 16px;
}
.tree .userid {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.tree .trunk {
  width: 2px;
  height: 18px;
  background: var(--line);
  margin: 8px auto 0;
}
.tree .stores {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: stretch;
}
.tree .store {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 8px;
  background: #fafafa;
  cursor: pointer;
  min-width: 0;
}
.tree .store:active { background: #eee; }
.tree .store .code { font-weight: 700; font-size: 1rem; }
.tree .store .name { color: var(--muted); font-size: 0.75rem; margin-top: 4px; }
input, button {
  font: inherit;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-top: 8px;
}
button {
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.err { color: var(--danger); font-size: 0.875rem; margin-top: 8px; }
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--card);
  width: 100%; max-width: 480px;
  border-radius: 16px 16px 0 0;
  padding: 16px 16px 28px;
  max-height: 80dvh; overflow: auto;
}
.modal h2 { margin: 0 0 8px; font-size: 1.1rem; }
.eq-row {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.muted { color: var(--muted); font-size: 0.8rem; }
.rec {
  display: none;
  align-items: center; gap: 8px;
  background: #fff1f0; color: var(--danger);
  padding: 8px 12px; border-radius: 10px; margin-bottom: 12px;
  font-weight: 600;
}
.rec.on { display: flex; }
.rec .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger);
  animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0.35; } }
