:root {
  color-scheme: light;
  --bg: #eef3fb;
  --ink: #172033;
  --muted: #5c6d86;
  --card: #ffffff;
  --line: #d5e3f5;
  --accent: #0040ff;
  --accent-deep: #123a9c;
  --accent-ink: #ffffff;
  --ok: #0f6b4c;
  --danger: #b4233c;
  --shadow: 0 10px 28px rgba(18, 58, 156, 0.08);
  font-family: "Segoe UI", "Avenir Next", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(900px 280px at 100% -40px, #d7e6ff, transparent 55%),
    var(--bg);
  color: var(--ink);
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

#app { max-width: 720px; margin: 0 auto; padding: 0 16px 48px; }
.top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 -16px 16px;
  padding: 18px 16px 16px;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  border-radius: 0 0 22px 22px;
}
.eyebrow {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  color: #d6e4ff;
}
h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.back, .btn, .ghost, .danger {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
}
.back { background: rgba(255, 255, 255, 0.16); color: #fff; border: 1px solid rgba(255, 255, 255, 0.28); }
.btn { background: var(--accent); color: var(--accent-ink); }
.ghost { background: #fff; border: 1px solid var(--line); color: var(--accent-deep); }
.danger { background: transparent; color: var(--danger); border: 1px solid #f3c3cc; }
.hidden { display: none !important; }

.card, .person, .sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.card { padding: 16px; margin-bottom: 12px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chip {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f0ff;
  color: var(--accent-deep);
}

.person { overflow: hidden; margin-bottom: 12px; }
.person img, .ph {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #e7f0ff;
}
.cropper {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: rgba(18, 32, 64, 0.55);
  display: grid;
  place-items: end center;
  padding: 16px;
}
.cropper-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.crop-view {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 1 / 1;
  margin: 12px auto;
  overflow: hidden;
  border-radius: 16px;
  background: #123a9c;
  touch-action: none;
  cursor: grab;
}
.crop-view img {
  position: absolute;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.ph { display: grid; place-items: center; font-size: 42px; color: #7aa0e8; }
.person .body { padding: 14px 14px 16px; }
.person h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.person[data-mine="true"] { outline: 2px solid var(--accent); }
.bar { height: 8px; border-radius: 99px; background: #e7f0ff; overflow: hidden; margin: 8px 0; }
.bar span { display: block; height: 100%; background: var(--accent); }
.voters { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }

label.field { display: block; margin-bottom: 12px; }
label.field span, .toggle span { display: block; margin-bottom: 6px; font-size: 14px; }
input[type="text"], input[type="url"], textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
}
textarea { min-height: 72px; resize: vertical; }
.toggle {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.toggle input { margin-top: 4px; accent-color: var(--accent); }
.candidate { display: grid; grid-template-columns: 72px 1fr; gap: 10px; margin-bottom: 12px; }
.candidate img, .candidate .ph { width: 72px; height: 72px; border-radius: 12px; aspect-ratio: auto; font-size: 24px; }

.banner {
  background: #e7f0ff;
  border: 1px solid #b9d0ff;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}
.devbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
}
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  margin: 0 auto;
  max-width: 680px;
  background: var(--accent-deep);
  color: #fff;
  padding: 12px 14px;
  border-radius: 14px;
}
.sheet {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  margin: 0 auto;
  max-width: 680px;
  padding: 16px;
  z-index: 2;
}
.empty { padding: 28px 8px; text-align: center; }
h2.block { font-size: 22px; font-weight: 700; margin: 18px 0 8px; }
.place {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
a { color: var(--accent); }
