:root {
  color-scheme: dark;
  --font-body: "house-of-cards", ui-serif, Georgia, "Times New Roman", serif;
  --bg: #000000;
  --card: #141414;
  --card-elevated: #1a1a1a;
  --text: #f5f5f5;
  --muted: #a1a1aa;
  --accent: #dc2626;
  --accent-hover: #ef4444;
  --yes: #4ade80;
  --yes-bg: rgba(34, 197, 94, 0.18);
  --yes-border: rgba(74, 222, 128, 0.35);
  --no: #f87171;
  --no-bg: rgba(185, 28, 28, 0.22);
  --no-border: rgba(248, 113, 113, 0.35);
  --border: #2a2a2a;
  --input-bg: #0d0d0d;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 120%;
}

/* Slightly larger type on small screens for readability */
@media (max-width: 768px) {
  html {
    font-size: 132%;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: url("bg.jpeg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.event-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.5rem;
}

.event-title-row h1 {
  margin: 0;
  flex: 1 1 10rem;
  min-width: 0;
}

.event-status-badge {
  flex-shrink: 0;
  margin-top: 0.15em;
  text-shadow: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.event-title-row .event-status-badge.poll-status-finalized-active {
  background: rgba(251, 191, 36, 0.22);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.5);
}

.event-title-row .event-status-badge.poll-status-past {
  background: rgba(113, 113, 122, 0.35);
  color: #e4e4e7;
  border: 1px solid rgba(228, 228, 231, 0.35);
}

.event-title-row .event-status-badge.poll-status-finalized {
  background: rgba(129, 140, 248, 0.2);
  color: #c7d2fe;
  border: 1px solid rgba(129, 140, 248, 0.45);
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 0 0 1.5rem;
}

/* Legibility over background photo */
h1,
h2,
.subtitle,
.help {
  text-shadow:
    0 0 4px rgb(0, 0, 0),
    0 0 14px rgba(0, 0, 0, 0.95),
    0 0 28px rgba(0, 0, 0, 0.72),
    0 1px 3px rgba(0, 0, 0, 1);
}

.card h2,
.card .help,
.card label,
.card .error,
.card .success-banner,
.card .date-label {
  text-shadow: none;
}

.polls-list-panel .help {
  text-shadow: none;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="number"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
}

input[type="datetime-local"] {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #121212 0%, var(--input-bg) 100%);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="datetime-local"]:hover {
  border-color: #3a3a3a;
}

input[type="datetime-local"]:focus {
  outline: none;
  border-color: rgba(220, 38, 38, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 2px rgba(220, 38, 38, 0.22);
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
  padding: 0.3rem;
  margin-left: 0.15rem;
  border-radius: 5px;
  filter: invert(1) brightness(0.85);
}

input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.field {
  margin-bottom: 1rem;
}

.row-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

button,
.btn {
  font-family: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  border-radius: 6px;
  border: none;
  padding: 0.5rem 1rem;
  font-weight: 500;
}

.btn-primary {
  background: var(--accent);
  color: #fafafa;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--card-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #252525;
  border-color: #3f3f3f;
}

.btn-danger {
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.btn-danger:hover {
  background: rgba(127, 29, 29, 0.5);
}

.btn-yes {
  background: var(--yes-bg);
  color: var(--yes);
  border: 2px solid transparent;
}

.btn-yes.selected {
  border-color: var(--yes-border);
  font-weight: 600;
}

.btn-no {
  background: var(--no-bg);
  color: var(--no);
  border: 2px solid transparent;
}

.btn-no.selected {
  border-color: var(--no-border);
  font-weight: 600;
}

.btn-small {
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.checkbox-field input {
  width: auto;
}

.checkbox-field label {
  margin: 0;
  font-weight: 400;
}

.error {
  color: var(--no);
  font-size: 0.875rem;
  margin: 0.5rem 0 0;
}

.success-banner {
  background: var(--yes-bg);
  color: var(--yes);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  border: 1px solid var(--yes-border);
}

.script-actions {
  margin: 0 0 0.75rem;
}

.script-inline-wrap {
  margin-top: 0.75rem;
}

.script-inline-wrap img.event-script-image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.script-inline-wrap iframe.event-script-pdf {
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

/* Blood on the Clocktower — Trouble Brewing reference grid (finalized poll) */
.botc-section h2 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.botc-scroll.table-scroll {
  overflow-x: visible;
  margin: 0;
  -webkit-overflow-scrolling: auto;
}

.botc-grid {
  width: 100%;
  border-collapse: collapse;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, rgba(42, 38, 34, 0.92) 0%, rgba(28, 26, 24, 0.95) 100%);
  border: 1px solid rgba(120, 100, 80, 0.45);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Five columns (player tiers as rows) — fits narrow screens without horizontal scroll */
.botc-grid-transposed {
  min-width: 0;
  table-layout: fixed;
  font-size: clamp(0.58rem, 2.1vw, 0.72rem);
}

.botc-grid th,
.botc-grid td {
  padding: 0.4rem 0.2rem;
  text-align: center;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
  word-break: break-word;
  hyphens: none;
}

.botc-grid thead th {
  font-weight: 700;
  line-height: 1.2;
  padding-top: 0.5rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.botc-grid tbody th {
  font-weight: 700;
}

.botc-grid th:first-child,
.botc-grid td:first-of-type {
  border-left: none;
}

.botc-grid-transposed .botc-col-players {
  color: #f0d080;
  background: rgba(251, 191, 36, 0.07);
}

.botc-grid-transposed .botc-col-townsfolk,
.botc-grid-transposed .botc-col-outsiders {
  color: #7eb8e0;
}

.botc-grid-transposed .botc-col-minions,
.botc-grid-transposed .botc-col-demons {
  color: #c2786a;
}

.botc-tier-highlight {
  outline: 1px solid rgba(250, 204, 21, 0.35);
  outline-offset: -1px;
}

.botc-cell-highlight {
  background: rgba(250, 204, 21, 0.22) !important;
  box-shadow: inset 0 0 0 2px rgba(250, 204, 21, 0.55);
  color: #fef3c7 !important;
}

.final-banner {
  background: rgba(251, 191, 36, 0.22);
  color: #fde68a;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-weight: 500;
  border: 1px solid rgba(251, 191, 36, 0.5);
  text-shadow:
    0 0 6px rgba(0, 0, 0, 0.95),
    0 0 14px rgba(0, 0, 0, 0.85),
    0 1px 2px rgba(0, 0, 0, 1);
}

.final-banner-yes-count {
  color: #86efac;
  font-weight: 600;
  text-shadow:
    0 0 8px rgba(0, 0, 0, 0.95),
    0 0 16px rgba(0, 0, 0, 0.85),
    0 1px 2px rgba(0, 0, 0, 1);
}

.help {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.date-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
}

.date-row input {
  flex: 1;
}

.date-row input[type="datetime-local"] {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 480px) {
  .date-row input[type="datetime-local"] {
    min-width: 15rem;
  }
}

.date-option-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.date-option-row:last-child {
  border-bottom: none;
}

.date-label {
  flex: 1;
  min-width: 200px;
  font-weight: 500;
}

.vote-btns {
  display: flex;
  gap: 0.5rem;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.summary-table th,
.summary-table td {
  text-align: left;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
}

.summary-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8125rem;
}

.met-yes {
  color: var(--yes);
  font-weight: 600;
}

.met-no {
  color: var(--muted);
}

.responses-finalize-wrap {
  margin-bottom: 1rem;
}

.responses-finalize-intro {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.responses-finalize-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.responses-finalize-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-elevated);
}

.responses-finalize-row-info {
  font-size: 0.875rem;
  line-height: 1.35;
  min-width: 0;
  flex: 1 1 12rem;
}

.finalize-count-bubble {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
  line-height: 1.25;
}

.finalize-count-bubble-yes {
  background: var(--yes-bg);
  color: var(--yes);
  border: 1px solid var(--yes-border);
}

.finalize-count-bubble-no {
  background: var(--no-bg);
  color: var(--no);
  border: 1px solid var(--no-border);
}

.responses-finalize-meets {
  color: var(--muted);
  font-weight: 400;
}

.responses-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.responses-table th,
.responses-table td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  text-align: center;
}

.responses-table th:first-child,
.responses-table td:first-child {
  text-align: left;
}

.responses-table tr.responses-table-yes-count-row th {
  border-bottom: none;
  padding-bottom: 0.15rem;
  vertical-align: bottom;
}

.responses-table th.responses-table-octagon-th {
  text-align: center;
}

.yes-count-octagon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0 0.35rem;
  box-sizing: border-box;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #ecfdf5;
  background: linear-gradient(145deg, #15803d 0%, #166534 45%, #14532d 100%);
  clip-path: polygon(
    28% 0%,
    72% 0%,
    100% 28%,
    100% 72%,
    72% 100%,
    28% 100%,
    0% 72%,
    0% 28%
  );
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  filter: drop-shadow(0 0 2px rgba(134, 239, 172, 0.9))
    drop-shadow(0 0 6px rgba(22, 101, 52, 0.6));
}

.responses-table th.responses-table-date-col {
  white-space: normal;
  line-height: 1.3;
  max-width: 6.25rem;
  font-size: 0.75rem;
  vertical-align: bottom;
}

.responses-table th.responses-table-updated-col,
.responses-table td.admin-response-updated {
  min-width: 10ch;
}

.responses-table td.admin-response-updated {
  line-height: 1.25;
}

.admin-response-updated-line {
  display: block;
  white-space: nowrap;
}

.responses-table td.response-ans-yes {
  background: var(--yes-bg);
  color: var(--yes);
  border-color: var(--yes-border);
  font-weight: 600;
}

.responses-table td.response-ans-no {
  background: var(--no-bg);
  color: var(--no);
  border-color: var(--no-border);
  font-weight: 600;
}

.responses-table th.responses-table-final-date-col {
  background: rgba(251, 191, 36, 0.22);
}

.responses-table th.responses-table-final-date-col,
.responses-table td.responses-table-final-date-col {
  border-left-width: 2px;
  border-right-width: 2px;
  border-left-color: #d97706;
  border-right-color: #d97706;
}

.responses-table td.response-ans-yes.responses-table-final-date-col,
.responses-table td.response-ans-no.responses-table-final-date-col {
  border-left-color: #d97706;
  border-right-color: #d97706;
}

.links-block {
  word-break: break-all;
  font-size: 0.875rem;
}

.links-block a {
  color: #fca5a5;
}

.links-block a:hover {
  color: #fecaca;
}

.invite-text {
  min-height: 5rem;
  resize: vertical;
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--border);
}

.hidden {
  display: none !important;
}

.site-logo-link {
  display: block;
  margin-bottom: 1rem;
}

.site-logo-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.site-logo {
  display: block;
  height: auto;
  width: 500px;
  max-width: 100%;
  margin: 0 auto;
}

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

.top-nav-actions .btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.polls-key-details {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.polls-key-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.875rem;
}

.polls-key-details summary:hover {
  color: var(--text);
}

.polls-key-details .help {
  margin-top: 0.5rem;
}

.polls-key-details--hidden {
  display: none;
}

.subtitle code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84em;
  padding: 0.12em 0.4em;
  border-radius: 4px;
  background: var(--card-elevated);
  border: 1px solid var(--border);
}

.polls-list-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem 1.25rem;
}

.polls-list-panel .table-scroll {
  margin-bottom: 0;
}

.polls-list-panel #polls-empty {
  margin: 0.75rem 0 0;
}

.polls-finalized-section {
  margin-top: 1.5rem;
}

.polls-finalized-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.polls-finalized-help {
  margin: 0 0 0.75rem;
}

.table-scroll {
  overflow-x: auto;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.polls-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.polls-admin-table th,
.polls-admin-table td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.polls-admin-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8125rem;
}

.poll-title-cell {
  font-weight: 500;
  max-width: 12rem;
  word-break: break-word;
}

a.poll-title-link {
  color: inherit;
  font-weight: 500;
  text-decoration: none;
}

a.poll-title-link:hover {
  color: #fca5a5;
  text-decoration: underline;
}

a.poll-title-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Public poll list: stable columns (title row is colspan-only, so colgroup sets widths) */
.polls-public-table {
  table-layout: fixed;
}

.polls-public-table col.poll-public-col-status {
  width: 10.5rem;
}

.polls-public-table col.poll-public-col-responses {
  width: 5.5rem;
}

.polls-public-table col.poll-public-col-action {
  width: 5.75rem;
}

/* Open (public) polls: title row above status / responses / action */
.polls-public-table tbody.poll-public-group .poll-public-title-cell {
  padding: 0.65rem 0.65rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

.polls-public-table tbody.poll-public-group .poll-public-colhead-tr th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.35rem 0.65rem 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: bottom;
}

.polls-public-table tbody.poll-public-group .poll-public-colhead-tr th:nth-child(1) {
  text-align: left;
}

.polls-public-table tbody.poll-public-group .poll-public-colhead-tr th:nth-child(2) {
  text-align: center;
}

.polls-public-table tbody.poll-public-group .poll-public-colhead-tr th:nth-child(3) {
  text-align: center;
}

.polls-public-table tbody.poll-public-group .poll-public-colhead-action {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.polls-open-page-footnote {
  margin-top: 2rem;
  margin-bottom: 0;
  max-width: 42rem;
}

.polls-public-table tbody.poll-public-group .poll-public-details-tr td {
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.polls-public-table tbody.poll-public-group .poll-public-details-tr td:nth-child(1) {
  text-align: left;
}

.polls-public-table tbody.poll-public-group .poll-public-details-tr td:nth-child(2) {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.polls-public-table tbody.poll-public-group .poll-public-details-tr td:nth-child(3) {
  text-align: center;
}

.polls-public-table tbody.poll-public-group .poll-public-details-tr td.poll-vote-cell .btn {
  vertical-align: middle;
}

.polls-public-table tbody.poll-public-group:last-child .poll-public-details-tr td {
  border-bottom: none;
}

a.poll-public-title-link {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  text-underline-offset: 0.15em;
}

a.poll-public-title-link:hover {
  text-decoration: underline;
}

a.poll-public-title-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

a.poll-public-title-link--open {
  color: var(--yes);
}

a.poll-public-title-link--open:hover {
  color: #86efac;
}

a.poll-public-title-link--finalized {
  color: #fcd34d;
}

a.poll-public-title-link--finalized:hover {
  color: #fde68a;
}

a.poll-public-title-link--past {
  color: var(--muted);
}

a.poll-public-title-link--past:hover {
  color: #e4e4e7;
}

.poll-date-cell {
  color: var(--muted);
  white-space: nowrap;
}

.poll-links-cell a {
  color: #fca5a5;
}

.poll-links-cell a:hover {
  color: #fecaca;
}

.poll-vote-cell .btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.poll-actions-cell {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .polls-list-panel .table-scroll {
    overflow-x: visible;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
  }

  .polls-list-panel {
    padding: 0.75rem 0.85rem 1rem;
  }

  .polls-admin-table {
    display: block;
    width: 100%;
  }

  .polls-admin-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .polls-admin-table tbody {
    display: block;
  }

  .polls-admin-table tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.65rem;
    background: var(--card-elevated);
  }

  .polls-admin-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .polls-admin-table tbody td {
    display: block;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .polls-admin-table tbody td:last-child {
    border-bottom: none;
    padding-bottom: 0;
    padding-top: 0.5rem;
  }

  .polls-admin-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
  }

  .polls-admin-table tbody td.poll-actions-cell::before {
    content: none;
    display: none;
  }

  .poll-title-cell {
    max-width: none;
    font-size: 0.9375rem;
    padding-top: 0.15rem;
  }

  .poll-date-cell {
    white-space: normal;
    font-size: 0.8125rem;
  }

  .poll-links-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
  }

  .poll-links-cell::before {
    flex: 0 0 100%;
  }

  .poll-actions-cell {
    white-space: normal;
  }

  .poll-actions-cell .btn {
    width: 100%;
    justify-content: center;
  }

  .poll-vote-cell .btn {
    width: 100%;
  }

  /* Public poll list: one card per tbody; title row, then details */
  .polls-public-table tbody.poll-public-group {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.65rem;
    background: var(--card-elevated);
    overflow: hidden;
  }

  .polls-public-table tbody.poll-public-group:last-child {
    margin-bottom: 0;
  }

  .polls-public-table tbody.poll-public-group tr {
    display: block;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    margin-bottom: 0;
    background: transparent;
  }

  .polls-public-table tbody.poll-public-group .poll-public-title-tr td {
    display: block;
    padding: 0.75rem 0.85rem 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .polls-public-table tbody.poll-public-group .poll-public-title-tr td::before {
    content: none;
    display: none;
  }

  .polls-public-table tbody.poll-public-group .poll-public-colhead-tr {
    display: none;
  }

  /* One row for status + responses; full-width action below */
  .polls-public-table tbody.poll-public-group .poll-public-details-tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 0.55rem;
    row-gap: 0;
    padding: 0.5rem 0.75rem 0.65rem;
    align-items: start;
  }

  .polls-public-table tbody.poll-public-group .poll-public-details-tr td {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 0 !important;
    border: none !important;
  }

  .polls-public-table tbody.poll-public-group .poll-public-details-tr td::before {
    margin-bottom: 0.2rem;
    font-size: 0.58rem;
    letter-spacing: 0.06em;
  }

  .polls-public-table tbody.poll-public-group .poll-public-details-tr td.poll-vote-cell {
    grid-column: 1 / -1;
    display: block;
    margin-top: 0.55rem;
    padding-top: 0.55rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  .polls-public-table tbody.poll-public-group .poll-public-details-tr td.poll-vote-cell::before {
    content: none !important;
    display: none !important;
  }
}

.poll-status {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.poll-status-open {
  background: var(--yes-bg);
  color: var(--yes);
  border: 1px solid var(--yes-border);
}

.poll-status-locked-in,
.poll-status-finalized-active {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.poll-status-past {
  background: rgba(113, 113, 122, 0.2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.poll-status-finalized {
  background: rgba(113, 113, 122, 0.22);
  color: #d4d4d8;
  border: 1px solid var(--border);
}

.poll-status-done {
  background: rgba(113, 113, 122, 0.2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.staff-tools-card {
  max-width: 28rem;
}

.staff-tools-intro {
  margin-top: 0;
}

.staff-tools-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

a.staff-tool-btn {
  display: block;
  text-align: center;
  text-decoration: none;
}

/* Native checkbox / calendar chrome on dark */
input[type="checkbox"] {
  accent-color: var(--accent);
}
