:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-muted: #f4f4f5;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-muted: #71717a;
  --primary: #18181b;
  --primary-text: #ffffff;
  --accent: #059669;
  --accent-bg: #ecfdf5;
  --accent-border: #a7f3d0;
  --error: #dc2626;
  --radius: 12px;
  --radius-lg: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --surface: #18181b;
    --surface-muted: #27272a;
    --border: #27272a;
    --border-strong: #3f3f46;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --primary: #fafafa;
    --primary-text: #18181b;
    --accent: #34d399;
    --accent-bg: #022c22;
    --accent-border: #065f46;
    --error: #f87171;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide { max-width: 960px; }

.site-header, .site-footer {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-footer {
  border-bottom: none;
  border-top: 1px solid var(--border);
}

.site-header__inner, .site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.site-brand {
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.01em;
}

.site-tagline {
  font-size: 12px;
  color: var(--text-muted);
}

.site-footer__inner {
  font-size: 12px;
  color: var(--text-muted);
}

.page {
  padding: 48px 0;
}

.page__title {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px 0;
}

.page__subtitle {
  color: var(--text-muted);
  margin: 0 0 32px 0;
  white-space: pre-line;
}

.page__eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0 0 4px 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.card__title {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
}

.card--accent {
  background: var(--accent-bg);
  border-color: var(--accent-border);
}
.card--accent .card__title { color: var(--accent); }

.card--empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 24px;
}

.field {
  margin-bottom: 20px;
}

.field__label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}

.field__hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.field__input,
.field__textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}
.field__input:focus,
.field__textarea:focus {
  outline: 2px solid var(--text);
  outline-offset: -1px;
}
.field__textarea { resize: vertical; min-height: 60px; }

.options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.options-list__row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.options-list__row .field__input { flex: 1; margin-bottom: 0; }

.options-list__remove {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.options-list__remove:hover:not(:disabled) {
  color: var(--error);
  border-color: var(--error);
}
.options-list__remove:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-link {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn {
  display: inline-block;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.btn--primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}
.btn--primary:hover { opacity: 0.9; }

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--secondary:hover { background: var(--surface-muted); }

.btn--block { width: 100%; }

.error {
  color: var(--error);
  font-size: 14px;
  margin: 12px 0 0 0;
}

.link-block {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.link-block__url {
  flex: 1;
  background: var(--surface-muted);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  border: 1px solid var(--border);
}

.copy-btn {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.copy-btn:hover { background: var(--surface-muted); }

.vote-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.vote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.vote-table th, .vote-table td {
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.vote-table th { background: var(--surface-muted); font-weight: 500; }
.vote-table th:first-child, .vote-table td:first-child {
  text-align: left;
  font-weight: 500;
}
.vote-table tbody tr:last-child td { border-bottom: none; }

.vote-table th .date-line { display: block; }
.vote-table th .time-line {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: normal;
}

.vote-yes { color: var(--accent); font-size: 18px; }
.vote-no { color: var(--border-strong); font-size: 18px; }

.vote-table .totals-row {
  background: var(--surface-muted);
  font-weight: 500;
}

.vote-table .col-best {
  background: var(--accent-bg);
  color: var(--accent);
}
.vote-table .col-best.totals-cell {
  font-weight: 700;
}

.vote-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.vote-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
}
.vote-option:hover { background: var(--surface-muted); }
.vote-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  margin: 0;
}
.vote-option__date { font-weight: 500; font-size: 14px; }
.vote-option__time { font-size: 12px; color: var(--text-muted); }
.vote-option--checked {
  background: var(--accent-bg);
  border-color: var(--accent-border);
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.muted-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
}
.muted-link:hover { color: var(--text); }

.winner-list { margin: 0; padding: 0; list-style: none; }
.winner-list li { padding: 4px 0; font-weight: 500; }
.winner-list .winner-meta {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: normal;
  margin-left: 6px;
}

.stat-line {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 32px 0;
}
