/* The public vote page: mobile-first, widening to a card grid on larger screens. */

.page { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.page--narrow { max-width: 640px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 4px 0; }

.hero { padding: 28px 4px 4px; max-width: 720px; }
.hero h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.hero p { margin-top: 12px; font-size: 15px; line-height: 1.55; color: var(--text-2); }
h1:focus { outline: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 18px 4px 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; font-size: 14px; font-weight: 500;
}
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--ink); font-weight: 600; }

/* Bottom padding keeps the last card clear of the fixed tray. */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 12px; align-items: start; padding-bottom: 220px;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 10px;
}
.card.is-picked { border-color: var(--accent); }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-cat { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.pill { font-size: 12px; font-weight: 600; background: var(--raised); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.card h2 { font-size: 18px; line-height: 1.3; font-weight: 700; }
.card-subtitle { margin-top: 2px; font-size: 14px; line-height: 1.4; color: var(--text-2); }
.card-summary { font-size: 14px; line-height: 1.55; color: var(--muted); }
.card-summary.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card.is-open .card-summary { color: var(--text-2); }
.card-details { display: flex; flex-direction: column; gap: 14px; }
.card-details h3 { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.card-details ul { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; color: #e6e6e6; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; }
.tool { font-size: 12px; line-height: 1.35; background: var(--raised); border-radius: 10px; padding: 6px 10px; }
.needs { font-size: 13px; line-height: 1.5; color: var(--text-2); background: #2a2a2a; border-radius: 12px; padding: 10px 12px; }
.needs strong { color: var(--text); font-weight: 600; }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.card-actions .btn-ghost { padding: 0 4px; font-weight: 500; font-size: 14px; }
.card.is-open .chevron { transform: rotate(180deg); }
.pick { border-color: var(--text); font-size: 14px; }
.pick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 700; }
.pick:disabled { border-color: var(--line-strong); color: var(--faint); font-weight: 500; font-size: 13px; }

.tray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: rgba(23, 23, 23, 0.96); border-top: 1px solid var(--line);
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
}
.tray-inner { max-width: 1100px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.tray-head { flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; }
.tray-head strong { font-size: 13px; font-weight: 600; }
.tray-count { font-size: 12px; color: var(--muted); }
.slots { flex: 1 1 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot { display: flex; align-items: center; gap: 6px; min-width: 0; border: 1px dashed #4b4b4b; border-radius: 12px; padding: 8px; color: var(--faint); font-size: 12px; }
.slot.is-filled { border: 1px solid var(--accent); color: var(--text); font-weight: 500; }
.slot-n { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 999px; border: 1px solid #4b4b4b; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.slot.is-filled .slot-n { border: 0; background: var(--accent); color: var(--ink); font-weight: 700; }
.slot-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tray .btn-primary { flex: 1 1 100%; }
@media (min-width: 900px) {
  .slots { flex: 1 1 auto; }
  .tray .btn-primary { flex: 0 0 260px; }
}

/* Details and done screens. */
.back { margin: 10px 0 0 -6px; }
.screen-head { padding: 12px 4px 0; }
.screen-head h1 { font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.screen-head p { margin-top: 10px; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.ranked { list-style: none; padding: 0; margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.ranked li { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 10px 8px 10px 14px; }
.rank-n { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 999px; background: var(--accent); color: var(--ink); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ranked-text { flex: 1 1 auto; min-width: 0; }
.ranked-title { font-size: 14px; font-weight: 600; line-height: 1.35; }
.ranked-hours { font-size: 12px; color: var(--muted); }
.icon-btn { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--raised); display: flex; align-items: center; justify-content: center; }
.icon-btn:disabled { opacity: 0.35; }
.vote-form { margin-top: 28px; display: flex; flex-direction: column; gap: 18px; padding-bottom: 32px; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fineprint { font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; }

.done { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 18px 20px 32px; }
.done-body { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 32px 0; }
.done-check { width: 64px; height: 64px; border-radius: 999px; background: var(--accent); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.done h1 { font-size: 32px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.done p { font-size: 15px; line-height: 1.55; color: var(--text-2); }
.done ol { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.done li { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 500; }
.done-n { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.loading { padding: 48px 4px; color: var(--muted); font-size: 14px; }
