:root {
  color-scheme: light;
  --border: #d0d7de;
  --accent: #1d4ed8;
  --card-bg: rgba(0, 0, 0, 0.03);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  max-width: 860px;
  padding: 2rem 1.25rem 4rem;
  margin-inline: auto;
  background: #fff;
  color: #1f2328;
}

header {
  margin-bottom: 2.5rem;
}

h1 {
  margin-bottom: 0.25rem;
}

.tagline {
  color: #57606a;
  max-width: 60ch;
}

.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  margin-right: 0.5rem;
}

.button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

section {
  margin-bottom: 2.5rem;
}

pre {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.example {
  margin-bottom: 1rem;
}

.example pre {
  margin-bottom: 0.5rem;
}

.run-button {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
  cursor: pointer;
}

.run-button:hover {
  background: var(--accent);
  color: #fff;
}

.run-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.example .output {
  margin-top: 0.5rem;
  max-height: 320px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.card h3 {
  margin-top: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

body.wide-page {
  max-width: 1100px;
}

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

.filters select {
  font: inherit;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

#polls-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#polls-table th,
#polls-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

#polls-table th {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 2px solid var(--border);
}

#status {
  text-align: center;
  color: #57606a;
  padding: 1rem 0;
}

#polls-table tr.is-new td {
  background: #fff8e1;
}

#polls-table tbody tr:hover td {
  background: #eaf3ff;
}

.new-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-size: 0.85rem;
  color: #57606a;
}

.new-swatch {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff8e1;
}

#polls-table .responses div {
  white-space: nowrap;
}

#polls-table .responses div + div {
  margin-top: 0.2rem;
}

#pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

#pagination button {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
  cursor: pointer;
}

#pagination button:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
}

#pagination button:disabled {
  opacity: 0.5;
  cursor: default;
}

#page-label {
  color: #57606a;
  font-size: 0.85rem;
}

footer {
  color: #57606a;
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
