/* Quando — stylesheet */

/* --- Color tokens --- */
:root {
  color-scheme: light dark;

  /* Surfaces */
  --bg-page: #f8f9fb;
  --bg-surface: #fff;
  --bg-muted: #f9fafb;
  --bg-hover: #f3f4f6;

  /* Text */
  --text: #1a1a2e;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --text-dimmed: #9ca3af;
  --text-on-primary: #fff;

  /* Borders */
  --border: #e5e7eb;
  --border-input: #d1d5db;
  --border-subtle: #f3f4f6;

  /* Primary (blue) */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-bg: #eff6ff;
  --primary-ring: rgba(37, 99, 235, 0.15);
  --primary-ring-subtle: rgba(37, 99, 235, 0.1);

  /* Success (green) */
  --success: #16a34a;
  --success-text: #166534;
  --success-bg: #dcfce7;
  --success-bg-subtle: #f0fdf4;
  --success-border: #bbf7d0;
  --success-border-strong: #86efac;

  /* Error (red) */
  --error: #dc2626;
  --error-bright: #ef4444;
  --error-text: #991b1b;
  --error-bg: #fee2e2;
  --error-bg-subtle: #fef2f2;
  --error-border: #fecaca;

  /* Warning (amber) */
  --warning: #d97706;
  --warning-bright: #f59e0b;
  --warning-text: #92400e;
  --warning-bg: #fef3c7;
  --warning-bg-subtle: #fffbeb;

  /* Best slot (blue highlight) */
  --best-bg: #dbeafe;
  --best-bg-subtle: #f0f7ff;
  --best-text: #1d4ed8;
  --best-border: #93c5fd;

  /* Calendar */
  --cal-past: #d1d5db;
}

/* Dark tokens applied via data-theme attribute or system preference */
[data-theme="dark"] {
    --bg-page: #0d1117;
    --bg-surface: #161b22;
    --bg-muted: #1c2128;
    --bg-hover: #21262d;

    --text: #e6edf3;
    --text-secondary: #b1bac4;
    --text-muted: #8b949e;
    --text-dimmed: #6e7681;
    --text-on-primary: #fff;

    --border: #30363d;
    --border-input: #3d444d;
    --border-subtle: #21262d;

    --primary: #58a6ff;
    --primary-hover: #79c0ff;
    --primary-bg: rgba(56, 139, 253, 0.1);
    --primary-ring: rgba(56, 139, 253, 0.3);
    --primary-ring-subtle: rgba(56, 139, 253, 0.15);

    --success: #3fb950;
    --success-text: #7ee787;
    --success-bg: rgba(46, 160, 67, 0.15);
    --success-bg-subtle: rgba(46, 160, 67, 0.1);
    --success-border: #238636;
    --success-border-strong: #3fb950;

    --error: #f85149;
    --error-bright: #da3633;
    --error-text: #ff7b72;
    --error-bg: rgba(248, 81, 73, 0.15);
    --error-bg-subtle: rgba(248, 81, 73, 0.1);
    --error-border: #da3633;

    --warning: #d29922;
    --warning-bright: #e3b341;
    --warning-text: #e3b341;
    --warning-bg: rgba(187, 128, 9, 0.15);
    --warning-bg-subtle: rgba(187, 128, 9, 0.1);

    --best-bg: rgba(56, 139, 253, 0.2);
    --best-bg-subtle: rgba(56, 139, 253, 0.1);
    --best-text: #79c0ff;
    --best-border: #388bfd;

    --cal-past: #484f58;
}
@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --bg-page: #0d1117;
    --bg-surface: #161b22;
    --bg-muted: #1c2128;
    --bg-hover: #21262d;

    --text: #e6edf3;
    --text-secondary: #b1bac4;
    --text-muted: #8b949e;
    --text-dimmed: #6e7681;
    --text-on-primary: #fff;

    --border: #30363d;
    --border-input: #3d444d;
    --border-subtle: #21262d;

    --primary: #58a6ff;
    --primary-hover: #79c0ff;
    --primary-bg: rgba(56, 139, 253, 0.1);
    --primary-ring: rgba(56, 139, 253, 0.3);
    --primary-ring-subtle: rgba(56, 139, 253, 0.15);

    --success: #3fb950;
    --success-text: #7ee787;
    --success-bg: rgba(46, 160, 67, 0.15);
    --success-bg-subtle: rgba(46, 160, 67, 0.1);
    --success-border: #238636;
    --success-border-strong: #3fb950;

    --error: #f85149;
    --error-bright: #da3633;
    --error-text: #ff7b72;
    --error-bg: rgba(248, 81, 73, 0.15);
    --error-bg-subtle: rgba(248, 81, 73, 0.1);
    --error-border: #da3633;

    --warning: #d29922;
    --warning-bright: #e3b341;
    --warning-text: #e3b341;
    --warning-bg: rgba(187, 128, 9, 0.15);
    --warning-bg-subtle: rgba(187, 128, 9, 0.1);

    --best-bg: rgba(56, 139, 253, 0.2);
    --best-bg-subtle: rgba(56, 139, 253, 0.1);
    --best-text: #79c0ff;
    --best-border: #388bfd;

    --cal-past: #484f58;
  }
}

/* --- Reset & base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* --- Focus styles --- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.toggle-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.respond-opt:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.cal-day:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--primary);
  color: var(--text-on-primary);
  padding: 0.5rem 1rem;
  z-index: 100;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}

/* --- Layout --- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Header --- */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo:hover {
  text-decoration: none;
}
.logo-icon {
  flex-shrink: 0;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.gh-link {
  color: var(--text-muted);
  display: inline-flex;
  transition: color 0.15s;
}
.gh-link:hover {
  color: var(--text);
}

/* --- Theme toggle --- */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
}
/* Show only the icon matching the current theme */
.theme-icon-light,
.theme-icon-dark,
.theme-icon-system { display: none; }
[data-theme="light"] .theme-icon-light { display: block; }
[data-theme="dark"] .theme-icon-dark { display: block; }
[data-theme="system"] .theme-icon-system { display: block; }
.user-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.avatar {
  border-radius: 50%;
}
.username {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.inline-form {
  display: inline;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-on-primary);
  background: var(--primary);
  border: 1px solid transparent;
  border-radius: 0.375rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn:hover {
  background: var(--primary-hover);
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}
.btn-lg {
  padding: 0.625rem 1.5rem;
  font-size: 1rem;
}
.btn-outline {
  color: var(--primary);
  background: transparent;
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary-bg);
}
.btn-warn {
  background: var(--warning-bright);
}
.btn-warn:hover {
  background: var(--warning);
}
.btn-danger {
  background: var(--error-bright);
}
.btn-danger:hover {
  background: var(--error);
}
.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0;
}
.btn-link:hover {
  text-decoration: underline;
}
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-dimmed);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}
.btn-icon:hover {
  color: var(--error-bright);
  background: var(--error-bg-subtle);
}

/* --- Inputs --- */
.input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-surface);
  border: 1px solid var(--border-input);
  border-radius: 0.375rem;
  transition: border-color 0.15s;
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring-subtle);
}
.input-time {
  width: auto;
  min-width: 7rem;
}
textarea.input {
  resize: vertical;
}
select.input {
  cursor: pointer;
}

/* --- Forms --- */
.poll-form {
  max-width: 640px;
}
.form-group {
  margin-bottom: 1.25rem;
}
.form-group > label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  color: var(--text-secondary);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}
.form-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.radio-group-horizontal {
  flex-direction: row;
  gap: 1.5rem;
}
.radio-label {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
}
.radio-label small {
  color: var(--text-muted);
  margin-left: 0.25rem;
}
.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.875rem;
}
.checkbox-label input[type="checkbox"] {
  margin: 0 0.5rem 0 0;
  flex-shrink: 0;
}
.tz-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.default-time-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.duration-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.input-duration {
  width: auto;
  min-width: 10rem;
}
.custom-duration {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Alerts --- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}
.alert-error {
  background: var(--error-bg-subtle);
  color: var(--error-text);
  border: 1px solid var(--error-border);
}

/* --- Calendar --- */
.calendar-container {
  max-width: 22rem;
}
.calendar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
}
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.cal-month {
  font-weight: 600;
  font-size: 0.9375rem;
}
.cal-prev,
.cal-next {
  background: none;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.25rem 0.625rem;
  color: var(--text-secondary);
}
.cal-prev:hover,
.cal-next:hover {
  background: var(--bg-hover);
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.calendar-grid > [role="row"],
.cal-header-row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
}
.cal-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.375rem 0;
}
.cal-empty {
  padding: 0.375rem;
}
.cal-day {
  text-align: center;
  padding: 0.5rem 0.25rem;
  font-size: 0.875rem;
  border: none;
  background: none;
  border-radius: 0.25rem;
  cursor: pointer;
  color: var(--text);
  transition: background 0.1s;
}
.cal-day:hover:not([disabled]) {
  background: var(--primary-bg);
}
.cal-day.cal-selected {
  background: var(--primary);
  color: var(--text-on-primary);
  font-weight: 600;
}
.cal-day.cal-selected:hover {
  background: var(--primary-hover);
}
.cal-day.cal-today {
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--primary);
}
.cal-day.cal-past {
  color: var(--cal-past);
  cursor: default;
}

/* --- Weekday picker --- */
.weekday-container {
  max-width: 22rem;
}
.weekday-picker {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}
.weekday-btn {
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-input);
  border-radius: 0.375rem;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.1s;
}
.weekday-btn:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.weekday-btn.weekday-selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-on-primary);
  font-weight: 600;
}
.weekday-btn.weekday-selected:hover {
  background: var(--primary-hover);
}

/* --- Selected slots --- */
.selected-slots {
  min-height: 3rem;
}
.slot-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.slot-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
}
.slot-date {
  font-weight: 600;
  font-size: 0.875rem;
  min-width: 7rem;
}
.slot-times {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
}
.slot-time-entry {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.remove-date {
  margin-left: auto;
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 4rem 0 2rem;
}
.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.consent-notice {
  font-size: 0.8125rem;
  color: var(--text-dimmed);
  margin-top: 0.75rem;
}
.hero-sub {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 2rem 0;
}
@media (max-width: 600px) {
  .features {
    grid-template-columns: 1fr;
  }
}
.feature {
  text-align: center;
}
.feature h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}
.feature p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --- Page header --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0 1rem;
  gap: 1rem;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* --- Poll view --- */
.poll-header {
  padding: 1.5rem 0 1rem;
}
.poll-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.poll-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.poll-description {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.poll-link {
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tz-label {
  font-family: monospace;
  font-size: 0.8125rem;
  background: var(--bg-hover);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.badge-closed {
  background: var(--error-bg);
  color: var(--error-text);
}
.badge-expired {
  background: var(--warning-bg);
  color: var(--warning-text);
}
.badge-chosen {
  background: var(--success-bg);
  color: var(--success-text);
}
.chosen-banner {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  margin: 0.75rem 0;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.chosen-ics-btn {
  margin-left: auto;
  font-size: 0.8125rem;
}
.poll-deadline {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.respondent-tz {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 0.25rem;
}
.respondent-tz::before {
  content: "\00b7 ";
}
.respondent-comment {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Poll toolbar --- */
.poll-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem 0 0;
}

/* --- View toggle --- */
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--border);
  border-radius: 0.375rem;
  padding: 2px;
  width: fit-content;
  margin: 1rem 0 0;
}
.view-toggle-btn {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.15s;
}
.view-toggle-btn.active {
  background: var(--bg-surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.view-toggle-btn:hover:not(.active) {
  color: var(--text-secondary);
}

/* --- Response grid --- */
.results-section,
.respond-section {
  margin: 1.5rem 0;
}
.results-section h2,
.respond-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.grid-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.response-grid {
  border-collapse: collapse;
  font-size: 0.875rem;
  width: auto;
  min-width: 100%;
}
.response-grid th,
.response-grid td {
  padding: 0.5rem 0.75rem;
  text-align: center;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.response-grid th {
  background: var(--bg-muted);
  font-weight: 600;
  font-size: 0.8125rem;
}
.name-col {
  text-align: left !important;
  font-weight: 500;
  min-width: 8rem;
  position: sticky;
  left: 0;
  background: var(--bg-surface);
  z-index: 1;
}
thead .name-col {
  background: var(--bg-muted);
}
.slot-col {
  min-width: 6.5rem;
}
.slot-col.chosen {
  background: var(--success-bg) !important;
}
.slot-col.best {
  background: var(--primary-bg) !important;
}
.slot-header {
  font-size: 0.8125rem;
  line-height: 1.3;
}
.slot-local-time {
  font-size: 0.6875rem;
  color: var(--text-dimmed);
  font-weight: 400;
  min-height: 1em;
}

/* Response values */
.value-cell {
  font-size: 1rem;
  font-weight: 600;
}
.value-yes {
  background: var(--success-bg-subtle);
  color: var(--success);
}
.value-no {
  background: var(--error-bg-subtle);
  color: var(--error);
}
.value-maybe {
  background: var(--warning-bg-subtle);
  color: var(--warning);
}
.total-cell {
  font-weight: 700;
  background: var(--bg-muted);
}
.total-cell.best {
  background: var(--best-bg) !important;
  color: var(--best-text);
}
.total-label {
  font-weight: 600;
  color: var(--text-muted);
}

/* Response input */
.input-cell {
  padding: 0.375rem !important;
}
.toggle-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid var(--border);
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 1.125rem;
  font-weight: 700;
  transition: all 0.1s;
}
.toggle-btn.value-yes {
  border-color: var(--success);
}
.toggle-btn.value-no {
  border-color: var(--error);
}
.toggle-btn.value-maybe {
  border-color: var(--warning);
}
.toggle-btn:hover {
  transform: scale(1.05);
}
.kbd-hint {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  text-align: center;
}
.kbd-hint kbd {
  display: inline-block;
  padding: 0.1rem 0.375rem;
  font-family: inherit;
  font-size: 0.6875rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  background: var(--surface);
  min-width: 1.25rem;
  text-align: center;
}

/* --- List view: results --- */
.slot-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.slot-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
}
.slot-card-best {
  border-color: var(--best-border);
  background: var(--best-bg-subtle);
}
.slot-card-chosen {
  border-color: var(--success-border-strong);
  background: var(--success-bg-subtle);
}
.slot-card-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.slot-card-time {
  font-weight: 600;
  font-size: 0.9375rem;
}
.slot-card-local-time {
  font-size: 0.75rem;
  color: var(--text-dimmed);
}
.slot-card-summary {
  margin-left: auto;
  font-size: 0.8125rem;
  display: flex;
  gap: 0.75rem;
}
.summary-yes {
  color: var(--success);
  font-weight: 600;
}
.summary-maybe {
  color: var(--warning);
}
.slot-card-respondents {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.respondent-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.respondent-chip.value-yes {
  background: var(--success-bg);
  color: var(--success-text);
}
.respondent-chip.value-maybe {
  background: var(--warning-bg);
  color: var(--warning-text);
}
.respondent-chip.value-no {
  background: var(--bg-hover);
  color: var(--text-dimmed);
}

/* --- List view: respond --- */
.respond-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.respond-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}
.respond-card-time {
  flex: 1;
  min-width: 0;
}
.respond-card-time .slot-header {
  font-weight: 600;
  font-size: 0.875rem;
}
.respond-card-buttons {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}
.respond-opt {
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border-input);
  border-radius: 0.25rem;
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.1s;
}
.respond-opt:hover {
  border-color: var(--text-dimmed);
}
.respond-opt.active[data-opt="yes"] {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success-text);
}
.respond-opt.active[data-opt="maybe"] {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning-text);
}
.respond-opt.active[data-opt="no"] {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error-text);
}

@media (max-width: 480px) {
  .respond-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .respond-card-buttons {
    justify-content: stretch;
  }
  .respond-opt {
    flex: 1;
    text-align: center;
  }
}

.hidden-notice {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  background: var(--bg-muted);
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

/* --- Dashboard --- */
.empty-state {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-muted);
}
.empty-state p {
  margin-bottom: 1rem;
}
.poll-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 2rem;
}
.poll-card {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.poll-card:hover {
  border-color: var(--primary);
  box-shadow: 0 1px 3px var(--primary-ring-subtle);
  text-decoration: none;
}
.poll-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.poll-card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}
.poll-card-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.poll-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
}

/* --- Admin --- */
.admin-info {
  margin-bottom: 1.5rem;
}
.admin-actions {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.5rem 0 2rem;
}
.admin-action-group {
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}
.admin-action-group h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.admin-action-group .muted {
  margin-bottom: 0.75rem;
}
.choose-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.choose-form .input {
  width: auto;
  min-width: 16rem;
}
.share-link .input {
  font-family: monospace;
  font-size: 0.8125rem;
  cursor: text;
}
.danger-zone {
  border-color: var(--error-border);
}
.danger-zone h3 {
  color: var(--error);
}

/* --- Edit poll --- */
.edit-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.edit-section h2 {
  margin-bottom: 0.5rem;
}
.existing-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.existing-slot-chip {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  background: var(--surface);
  color: var(--text-muted);
}
.alert-info {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  background: var(--info-bg, #dbeafe);
  color: var(--info, #2563eb);
  border: 1px solid var(--info, #2563eb);
  font-size: 0.875rem;
}
.alert-success {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--success-bg, #dcfce7);
  color: var(--success, #16a34a);
  border: 1px solid var(--success, #16a34a);
}

/* --- Stats --- */
.stats-section {
  margin: 2.5rem 0 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.stats-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}
.top-creators h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.creator-list {
  list-style: none;
  padding: 0;
}
.creator-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-subtle);
}
.creator-item:last-child {
  border-bottom: none;
}
.creator-name {
  font-weight: 500;
  color: var(--text-secondary);
}
.creator-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* --- API tokens --- */
.alert-token {
  background: var(--success-bg-subtle);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  margin: 0.75rem 0;
  font-size: 0.875rem;
}
.token-display {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  font-family: monospace;
  font-size: 0.8125rem;
  word-break: break-all;
  user-select: all;
}
.token-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.token-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
}
.token-expired {
  opacity: 0.6;
}
.token-create-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* --- Account / data section --- */
.account-section {
  margin: 2rem 0 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.account-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}
.account-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* --- Prose (privacy policy) --- */
.prose {
  max-width: 640px;
  padding: 1.5rem 0 2rem;
}
.prose h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.prose h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.prose p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}
.prose ul {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}
.prose li {
  margin-bottom: 0.375rem;
  line-height: 1.6;
}

/* --- Collapsible sections --- */
.collapsible-section > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.collapsible-section > summary::-webkit-details-marker {
  display: none;
}
.collapsible-section > summary h2 {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.collapsible-section > summary h2::before {
  content: "\25B6";
  font-size: 0.625rem;
  transition: transform 0.15s;
  color: var(--text-dimmed);
}
.collapsible-section[open] > summary h2::before {
  transform: rotate(90deg);
}
.collapsible-section > summary:hover h2 {
  color: var(--primary);
}

/* --- Footer --- */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-dimmed);
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* --- Utilities --- */
.hidden {
  display: none;
}
.d-flex {
  display: flex;
}
.mt-1 {
  margin-top: 1rem;
}
.pt-1 {
  padding-top: 1rem;
}
.max-w-sm {
  max-width: 14rem;
}
.max-w-md {
  max-width: 18rem;
}
.max-w-select {
  max-width: 10rem;
}
.text-error {
  color: var(--error);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}
.respondent-name {
  font-size: 0.8125rem;
}
