/* ==========================================================================
   Dev Hub — vote.css (Voting tool, on top of shared.css)
   ========================================================================== */

body {
  padding: 6vh 6vw 8vh;
}

.wrap {
  max-width: 62rem;
  margin: 0 auto;
}

/* ---------- Poll list ---------- */
.poll-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.poll-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  transition: border-color 0.15s ease;
}

.poll-card:hover {
  border-color: var(--ink);
}

.poll-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.poll-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.1rem;
}

.poll-question {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.poll-meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--muted);
}

.poll-your-vote {
  font-size: 0.8rem;
  color: var(--ink);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--line);
}

.empty-state {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 1rem 0;
}

/* ---------- New-poll creation form ---------- */
.poll-form-panel {
  margin-bottom: 2rem;
}

.option-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.option-row input {
  flex: 1;
}

.method-fields {
  border-top: 1px dashed var(--line);
  padding-top: 0.9rem;
  margin-top: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* ---------- Single-poll detail header ---------- */
.poll-detail-header {
  margin-bottom: 1.75rem;
}

.poll-detail-header h1 {
  font-size: clamp(1.4rem, 3.5vw, 1.85rem);
}

.poll-detail-question {
  font-size: 1rem;
  color: var(--ink);
  margin: 0.5rem 0 0;
}

.poll-detail-meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
}

.status-badge.open { background: #dcfce7; color: #166534; }
.status-badge.closed { background: #fef3c7; color: #92400e; }
.status-badge.published { background: #e5e5e5; color: #333; }

.poll-admin-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.poll-attachment {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ---------- Ballot forms ---------- */
.ballot-panel {
  margin-bottom: 2rem;
}

.fptp-options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 1rem 0;
}

.fptp-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.92rem;
}

.fptp-option:has(input:checked) {
  border-color: var(--ink);
  background: var(--panel);
}

.fptp-option input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  flex-shrink: 0;
}

.write-in-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.write-in-row input[type="text"] {
  flex: 1;
}

.ranked-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.ranked-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.ranked-position {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  width: 1.4rem;
  flex-shrink: 0;
}

.ranked-label {
  flex: 1;
  font-size: 0.92rem;
}

.ranked-move-btns {
  display: flex;
  gap: 0.3rem;
}

/* ---------- Bracket ---------- */
.bracket-rounds {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1rem 0;
}

.bracket-round-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.bracket-matchups {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bracket-matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}

.bracket-side {
  padding: 0.5rem 0.7rem;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.88rem;
  text-align: center;
  background: var(--panel);
}

.bracket-side.picked {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

.bracket-side.bye {
  cursor: default;
  color: var(--muted);
  font-style: italic;
}

.bracket-vs {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
}

.bracket-champion {
  text-align: center;
  padding: 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.2rem;
  margin-top: 1rem;
}

.bracket-champion .label {
  display: block;
  font-family: 'Archivo', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

/* ---------- Results ---------- */
.results-panel {
  margin-top: 1.5rem;
}

.result-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
}

.result-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.result-bar-label .winner-tag {
  font-weight: 700;
}

.result-bar-track {
  height: 0.55rem;
  background: var(--panel);
  border-radius: 999px;
  overflow: hidden;
}

.result-bar-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 999px;
}

.ranked-round-block {
  margin-bottom: 1.25rem;
}

.ranked-round-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.write-ins-box {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.write-ins-box h3 {
  font-family: 'Archivo', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.write-ins-box ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
}

/* ---------- Personal Keys admin panel ---------- */
.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
}

.key-row.revoked {
  opacity: 0.5;
}

.key-row-label {
  font-weight: 600;
}

.key-row-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.new-key-reveal {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--panel);
}

.new-key-reveal code {
  display: block;
  font-size: 0.9rem;
  padding: 0.5rem 0.65rem;
  background: var(--paper);
  border-radius: 4px;
  margin: 0.5rem 0;
  word-break: break-all;
}

.new-key-warning {
  font-size: 0.78rem;
  color: var(--error);
  font-weight: 600;
}
