:root {
  --ink: #1a1714;
  --paper: #f4efe6;
  --card: #fffdf8;
  --line: #e2d8c8;
  --muted: #6d6458;
  --go: #1b7a45;
  --go2: #145c34;
  --go-soft: #e8f6ee;
  --nogo: #9c2f2f;
  --nogo2: #7a2323;
  --nogo-soft: #f8eaea;
  --accent: #c45c26;
  --accent-soft: #f7efe8;
  --shadow: 0 8px 28px rgba(40, 24, 8, 0.07);
  --shadow-lg: 0 16px 48px rgba(40, 24, 8, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --phone-w: 390px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100dvh; }

a { color: var(--accent); }

.app-shell {
  max-width: var(--phone-w);
  margin: 0 auto;
  padding: 0 0 calc(24px + env(safe-area-inset-bottom, 0));
  min-height: 100dvh;
}

@media (min-width: 480px) {
  body {
    background: linear-gradient(160deg, #e8dfd0 0%, #f4efe6 50%, #ebe3d4 100%);
    padding: 24px 16px 40px;
  }
  .app-shell {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-height: 720px;
    position: relative;
  }
  .app-shell::before {
    content: "";
    display: block;
    width: 120px;
    height: 28px;
    background: #1a1714;
    border-radius: 0 0 16px 16px;
    margin: 0 auto 4px;
  }
}

.screen {
  display: block;
  padding: 16px 18px 24px;
  animation: fadeIn 0.22s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 16px 18px 0;
}

h1 {
  font-size: 1.55rem;
  line-height: 1.2;
  margin: 0 0 10px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.2rem;
  margin: 0 0 12px;
  font-weight: 700;
}

.lede {
  color: var(--muted);
  font-size: 0.98rem;
  margin: 0 0 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card .pad { padding: 18px 18px 22px; }

.hero {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #e8dfd0;
  display: block;
}

.price {
  font-size: 1.15rem;
  font-weight: 750;
  margin: 4px 0 0;
}

.muted { color: var(--muted); font-size: 0.92rem; }
.small { font-size: 0.85rem; }

.prompt {
  font-size: 1.28rem;
  font-weight: 700;
  margin: 16px 0 18px;
  letter-spacing: -0.01em;
}

.countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.countdown::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin: 14px 0 6px;
  color: var(--ink);
}

label .hint {
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

input, textarea, select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 16px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 48px;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #c9b89a;
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.12);
}

.field-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 6px 0 0;
}

.field-error {
  color: var(--nogo);
  font-size: 0.85rem;
  font-weight: 650;
  margin: 6px 0 0;
}

.error-banner {
  background: var(--nogo-soft);
  border: 1px solid #e8c5c5;
  color: var(--nogo);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 650;
  margin-bottom: 8px;
}

.closed-banner {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  font-weight: 700;
  margin-top: 16px;
}

.audience-pill {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--go-soft);
  border: 1px solid #c5e4d0;
  border-radius: var(--radius-sm);
  padding: 14px 14px;
  margin-top: 6px;
}

.audience-pill .icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.audience-pill strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.audience-pill p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  transition: transform 0.1s, background 0.15s, opacity 0.15s;
  font-family: inherit;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  color: inherit;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn.go { background: var(--go); color: #fff; }
.btn.go:hover { background: var(--go2); }
.btn.nogo { background: var(--nogo); color: #fff; }
.btn.nogo:hover { background: var(--nogo2); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #2d2824; }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn.ghost:hover { background: rgba(0,0,0,0.03); }
.btn.wa {
  background: #25D366;
  color: #fff;
}

.btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 8px;
}

.btn-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.chip:hover { border-color: #c9b89a; background: var(--accent-soft); }
.chip.selected {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.chip.go-tint.selected { background: var(--go); border-color: var(--go); }
.chip.nogo-tint.selected { background: var(--nogo); border-color: var(--nogo); }

.share-link-box {
  background: #fff;
  border: 1px dashed #c9b89a;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  word-break: break-all;
  color: var(--ink);
  margin: 8px 0 16px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.empty-hero {
  text-align: center;
  padding: 48px 12px 32px;
}
.empty-hero .mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-hero .mark.traffic {
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
}
.tl-housing {
  width: 44px;
  padding: 10px 8px;
  border-radius: 22px;
  background: linear-gradient(180deg, #2c2a28 0%, #1a1816 100%);
  box-shadow: 0 10px 28px rgba(26, 24, 22, 0.28), inset 0 1px 0 rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.tl-lamp {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: block;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.35);
}
.tl-lamp.go {
  background: radial-gradient(circle at 35% 30%, #6ee7a0, var(--go) 55%, #146b3a);
  box-shadow: 0 0 0 2px rgba(27, 122, 69, 0.25), 0 0 14px rgba(27, 122, 69, 0.55), inset 0 2px 4px rgba(0,0,0,0.2);
  animation: tlPulse 2.4s ease-in-out infinite;
}
.tl-lamp.nogo {
  background: radial-gradient(circle at 35% 30%, #f0a09a, var(--nogo, #c0392b) 55%, #8b1e16);
  opacity: 0.92;
}
@keyframes tlPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(27, 122, 69, 0.25), 0 0 10px rgba(27, 122, 69, 0.4), inset 0 2px 4px rgba(0,0,0,0.2); transform: scale(1); }
  50% { box-shadow: 0 0 0 3px rgba(27, 122, 69, 0.35), 0 0 18px rgba(27, 122, 69, 0.7), inset 0 2px 4px rgba(0,0,0,0.2); transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .tl-lamp.go { animation: none; }
}
.empty-hero h1 { margin-bottom: 12px; }
.empty-hero .lede { max-width: 280px; margin: 0 auto 28px; }

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  text-align: left;
}
.feature-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}
.feature-list li:last-child { border-bottom: 1px solid var(--line); }
.feature-list .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--go-soft);
  color: var(--go);
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.tally-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 18px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.stat.go-stat { background: var(--go-soft); border-color: #c5e4d0; }
.stat.nogo-stat { background: var(--nogo-soft); border-color: #e8c5c5; }
.stat .num {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.stat.go-stat .num { color: var(--go); }
.stat.nogo-stat .num { color: var(--nogo); }
.stat .lbl {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.vote-list { list-style: none; padding: 0; margin: 0; }
.vote-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.vote-item:last-child { border-bottom: 0; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 750;
  font-size: 0.9rem;
  flex-shrink: 0;
  color: #fff;
}
.avatar.go { background: var(--go); }
.avatar.nogo { background: var(--nogo); }
.avatar.wait { background: #b0a696; }
.vote-body { flex: 1; min-width: 0; }
.vote-body .name {
  font-weight: 700;
  font-size: 0.98rem;
}
.vote-body .meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
}
.badge.go { background: var(--go-soft); color: var(--go); }
.badge.nogo { background: var(--nogo-soft); color: var(--nogo); }
.badge.wait { background: #f0ebe3; color: var(--muted); }

.chip-inline {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 6px;
  color: var(--ink);
}

.section-label {
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 4px;
}

.thanks {
  text-align: center;
  padding: 36px 12px 20px;
}
.thanks .check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
}
.thanks .check.go { background: var(--go); }
.thanks .check.nogo { background: var(--nogo); }
.thanks h1 { font-size: 1.4rem; }
.thanks .lede { margin-bottom: 8px; }

.open-listing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 12px 0 4px;
  padding: 12px 16px;
  min-height: 48px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1.5px solid var(--ink, #1a1816);
  background: #fff;
  color: var(--ink, #1a1816);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.open-listing:active { transform: scale(0.98); }
.open-listing-arrow { font-size: 1.05em; line-height: 1; }
.prompt-ask {
  margin: 18px 0 14px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 750;
}

.voter-name-bar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}
.voter-name-bar strong { font-weight: 750; }

.demo-note {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin-top: 16px;
}

.preview-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin-top: 6px;
  background: #e8dfd0;
}

.recent-list {
  list-style: none;
  padding: 0 18px 24px;
  margin: 0;
}
.recent-list li { margin: 0; }
.recent-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
}
.recent-list a strong { font-size: 0.95rem; }
.recent-list a span {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.btn.go, .btn.nogo, .btn.primary {
  min-height: 52px;
  font-size: 1.1rem;
}


/* Single Add-a-photo + action sheet (Android camera needs separate capture input) */
.photo-input-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}
.photo-drop {
  position: relative;
  display: block;
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  min-height: 120px;
  padding: 16px;
  margin: 0 0 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.photo-drop.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.photo-drop.has-preview { border-style: solid; }
.photo-drop-ui {
  text-align: center;
  padding: 12px 8px 4px;
  color: var(--muted);
}
.photo-drop-ui.hidden,
.photo-change.hidden,
.preview-thumb.hidden,
.photo-sheet.hidden {
  display: none !important;
}
.photo-drop-ui strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.photo-drop-hint {
  margin: 0 0 14px;
  font-size: 0.92rem;
}
.photo-btn,
.photo-change,
.photo-sheet-btn {
  min-height: 44px;
  min-width: 44px;
  width: 100%;
  margin: 0;
  cursor: pointer;
}
.photo-change { margin-top: 12px; }
.photo-drop .preview-thumb {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 4px;
}
.photo-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.photo-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(26, 23, 20, 0.45);
  cursor: pointer;
}
.photo-sheet-panel {
  position: relative;
  width: 100%;
  max-width: var(--phone-w);
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0));
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.photo-sheet-panel h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  text-align: center;
}
body.sheet-open { overflow: hidden; }


.mine-block {
  margin: 28px 16px 8px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.mine-help { margin: 0 0 12px; }
.mine-empty.hidden { display: none !important; }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li { margin: 0 0 8px; }
.recent-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
}
.recent-list a span { color: var(--accent); font-size: 0.9rem; white-space: nowrap; }
.recent-share {
  display: inline-block !important;
  margin-top: 6px;
  font-size: 0.85rem;
}

/* UX4: prompt chips, why countdown, thanks flip */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}
.prompt-chip.selected,
.why-chip.selected {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--muted, #7a7268);
  margin: -4px 0 12px;
}
#whyText {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  margin-bottom: 4px;
}
.why-note {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted, #7a7268);
}
.check.flip {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: #1f8a4c;
  transition: background 0.35s ease;
  overflow: hidden;
}
.check.flip.show-nogo {
  background: #c0392b;
}
.check.flip .flip-go,
.check.flip .flip-nogo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.check.flip .flip-nogo {
  opacity: 0;
  transform: scale(0.85);
}
.check.flip.show-nogo .flip-go {
  opacity: 0;
  transform: scale(0.85);
}
.check.flip.show-nogo .flip-nogo {
  opacity: 1;
  transform: scale(1);
}
.label .hint,
span.hint {
  font-weight: 400;
  color: var(--muted, #7a7268);
  font-size: 0.9em;
}
