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

/* ── Design System ──────────────────────────────────────────────────────── */
:root {
  /* Core palette */
  --bg: #f6efe0;
  --surface: #fffbf3;
  --surface-2: #fbf4e6;
  --ink: #2a1e14;
  --ink-2: #5a4a3a;
  --muted: #8c7a66;
  --line: #e8dcc4;
  --line-2: #f0e5d0;

  /* Brand */
  --primary: #c8552b;
  --primary-hover: #b0451f;
  --primary-soft: #fbead9;

  /* Accent */
  --sage: #6b8e5a;
  --sage-soft: #e4eddc;
  --rose: #b85a4a;
  --rose-soft: #f6dcd4;

  /* Status */
  --danger: #c0392b;
  --danger-light: #fdecea;
  --success: #2d7a47;
  --success-light: #e8f5ee;

  /* Admin compatibility aliases */
  --gray-100: #f0e5d0;
  --gray-400: #8c7a66;
  --gray-500: #6b5a4a;
  --orange: var(--primary);
}

/* ── Base ───────────────────────────────────────────────────────────────── */
body {
  font-family:
    'Noto Sans TC',
    'PingFang TC',
    'Microsoft JhengHei',
    -apple-system,
    sans-serif;
  background: var(--bg);
  background-image: none;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      1200px 800px at 85% -10%,
      rgba(200, 85, 43, 0.08),
      transparent 60%
    ),
    radial-gradient(
      900px 700px at -10% 110%,
      rgba(107, 142, 90, 0.07),
      transparent 60%
    );
  pointer-events: none;
  z-index: 0;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 251, 243, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
  height: auto;
  padding: 0;
  box-shadow: none;
}

.header-inner {
  width: 100%;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--primary);
  display: grid;
  place-items: center;
  color: white;
  flex-shrink: 0;
  box-shadow:
    0 2px 0 rgba(176, 69, 31, 0.4),
    0 6px 16px -6px rgba(200, 85, 43, 0.6);
}

.brand-mark svg {
  width: 16px;
  height: 16px;
}

.brand-tag {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* Admin page header logo */
.logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 32px;
  position: relative;
  z-index: 1;
}

.poll-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px;
  position: relative;
  z-index: 1;
}

/* ── Hero (index page) ──────────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 36px;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.hero__eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.hero__title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 14px;
}

.hero__title span {
  color: var(--primary);
}

.hero__sub {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* ── Poll Hero ──────────────────────────────────────────────────────────── */
.poll-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 28px;
  max-width: 760px;
}

.hero-left {
  flex: 1;
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

h1.poll-title {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 16px;
  color: var(--ink);
}

.hero-desc {
  color: var(--ink-2);
  font-size: 14px;
  margin: -8px 0 14px;
}

.poll-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  color: var(--ink-2);
  font-size: 14px;
}

.poll-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.poll-meta-item svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

.poll-meta-item strong {
  color: var(--ink);
  font-weight: 600;
}

/* ── Deadline Pill ──────────────────────────────────────────────────────── */
.deadline-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  flex-shrink: 0;
}

.dp-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}

.dp-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.dp-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
}

.dp-icon svg {
  width: 18px;
  height: 18px;
}

/* ── Poll Stack ─────────────────────────────────────────────────────────── */
.poll-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 760px;
  margin: 0 auto;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.02),
    0 8px 24px -16px rgba(74, 50, 30, 0.15);
  position: relative;
}

.card::before {
  display: none;
}

/* Index page cards */
.container .card {
  padding: 28px;
  margin-bottom: 20px;
}

/* Poll page cards */
.poll-stack .card {
  padding: 24px;
  margin-bottom: 0;
}

/* Index card title */
.card__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 20px;
}

/* Poll card head / title */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.card-title-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
}

.card-title-icon svg {
  width: 13px;
  height: 13px;
}

.count-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  padding: 4px 10px;
  border-radius: 999px;
}

.count-chip.badge-full {
  background: var(--rose-soft);
  color: var(--rose);
  border-color: rgba(184, 90, 74, 0.3);
}

/* ── Expired Banner ─────────────────────────────────────────────────────── */
.poll-expired-banner {
  max-width: 760px;
  margin: 0 auto 20px;
  padding: 14px 18px;
  background: #fef0ee;
  border: 1px solid rgba(184, 90, 74, 0.35);
  border-radius: 12px;
  color: #8b2a1e;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
}

/* ── Stats ──────────────────────────────────────────────────────────────── */
.stat-headline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
}

.stat-headline-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--sage);
  background: var(--sage-soft);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.stat-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 12px;
  font-size: 14px;
}

.best-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.best-card {
  flex: 0 0 auto;
  min-width: 68px;
  padding: 8px 12px 8px 10px;
  background: var(--sage-soft);
  border: 1px solid rgba(107, 142, 90, 0.3);
  border-radius: 9px;
  text-align: center;
  position: relative;
  transition: transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.best-card::after {
  /* content: ''; */
  position: absolute;
  top: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sage)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>")
    center / 10px no-repeat;
}

.best-card-md {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #3f5b33;
  letter-spacing: -0.01em;
}

.best-card-dow {
  display: block;
  font-size: 12px;
  color: #5f7b52;
  margin-top: 2px;
}

/* ── Matrix Table ───────────────────────────────────────────────────────── */
.matrix-wrap {
  overflow-x: auto;
  margin: 0 -24px;
  padding: 0 24px;
}

.matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  min-width: 480px;
}

.matrix th,
.matrix td {
  padding: 10px 8px;
  text-align: center;
}

.matrix th:first-child,
.matrix td:first-child {
  text-align: left;
  padding-left: 12px;
  padding-right: 16px;
  min-width: 110px;
  position: sticky;
  left: 0;
  background: var(--surface);
}

.matrix thead th {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  background: var(--surface);
}

.matrix thead th .mh-md {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  display: block;
}

.matrix thead th .mh-dow {
  font-size: 10px;
  color: var(--muted);
}

.matrix tbody tr td {
  border-bottom: 1px solid var(--line-2);
}

.matrix tbody tr:last-child td {
  border-bottom: none;
}

.matrix tbody tr.you td:first-child {
  color: var(--primary);
  font-weight: 600;
}

.matrix .pname {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.matrix .m-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.you-pill {
  font-size: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 4px;
}

.cell-tick {
  color: var(--sage);
  display: inline-flex;
}

.cell-cross {
  color: #c9b5a0;
  display: inline-flex;
}

.cell-tick svg,
.cell-cross svg {
  width: 14px;
  height: 14px;
}

.matrix tfoot td {
  padding-top: 14px;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.matrix tfoot td:first-child {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.total-num {
  display: inline-block;
  min-width: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
}

.total-num.peak {
  background: var(--sage);
  color: white;
}

/* ── Forms (index page) ─────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

label .required {
  color: var(--primary);
  margin-left: 2px;
}

input[type='text'],
input[type='date'],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  transition: all 0.15s;
  outline: none;
  box-shadow: none;
  background-image: none;
}

input[type='text']:focus,
input[type='date']:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(200, 85, 43, 0.12);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.calendar-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  margin-bottom: 6px;
}

/* ── Toggle ─────────────────────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-row label {
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-2);
  text-transform: none;
  letter-spacing: 0;
}

.toggle-row .toggle-hint {
  font-size: 13px;
  color: var(--muted);
}

.toggle {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--line);
  border-radius: 99px;
  transition: 0.25s;
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 2px 4px rgba(107, 58, 42, 0.25);
}

.toggle input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ── Date Slot Builder (index) ──────────────────────────────────────────── */
#date-slots-list {
  margin-top: 0.75rem;
}

.date-slot-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: var(--surface-2);
}

.date-slot-header {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 8px;
}

.slot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.slot-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(200, 85, 43, 0.3);
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
}

.slot-tag-remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 0.75rem;
  line-height: 1;
}

.slot-tag-remove:hover {
  opacity: 1;
}

.slot-add-row {
  display: flex;
  gap: 0.5rem;
}

.slot-add-row input {
  flex: 1;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
}

.btn-add-slot {
  padding: 8px 14px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(200, 85, 43, 0.3);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-add-slot:hover {
  background: var(--primary);
  color: white;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow:
    0 2px 0 var(--primary-hover),
    0 8px 20px -6px rgba(200, 85, 43, 0.5);
  text-shadow: none;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow:
    0 2px 0 var(--primary-hover),
    0 12px 26px -6px rgba(200, 85, 43, 0.55);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-outline {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--line);
}

.btn-outline:hover {
  background: var(--surface-2);
  border-color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 2px 0 #8b1a12;
}

.btn-danger:hover {
  background: #a03020;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

/* Index page submit button tweaks */
.container #submit-btn {
  border-radius: 12px;
  padding: 16px;
  text-shadow: none;
}

/* Ghost button (poll page header) */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-ghost svg {
  width: 14px;
  height: 14px;
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--ink-2);
}

/* ── Poll Page Submit Button ────────────────────────────────────────────── */
.poll-stack #submit-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-top: 20px;
  transition: all 0.15s;
  box-shadow:
    0 2px 0 var(--primary-hover),
    0 8px 20px -6px rgba(200, 85, 43, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-shadow: none;
}

.poll-stack #submit-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow:
    0 2px 0 var(--primary-hover),
    0 12px 26px -6px rgba(200, 85, 43, 0.55);
}

.poll-stack #submit-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.poll-stack #submit-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.poll-stack #submit-btn:disabled {
  background: #d8c5b0;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-width: 1px;
  border-style: solid;
}

.alert-success {
  background: var(--sage-soft);
  color: #3f5b33;
  border-color: rgba(107, 142, 90, 0.4);
}

.alert-danger {
  background: var(--rose-soft);
  color: #8b2a1e;
  border-color: rgba(184, 90, 74, 0.3);
}

.alert-info {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(200, 85, 43, 0.3);
}

.alert-warning {
  background: #fef3cd;
  color: #7a4f10;
  border-color: #e8c060;
}

/* ── Share Box ──────────────────────────────────────────────────────────── */
.share-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 12px;
}

.share-box + .share-box {
  margin-top: 0.75rem;
}

.share-box__label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.share-box__url {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy {
  padding: 8px 14px;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.btn-copy:hover {
  background: var(--ink-2);
}

.btn-copy.copied {
  background: var(--sage);
}

/* ── Poll Form Fields ───────────────────────────────────────────────────── */
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.field-label .req {
  color: var(--primary);
  margin-left: 2px;
}

.field-label--gap {
  margin-top: 22px;
}

.poll-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  transition: all 0.15s;
  outline: none;
  box-shadow: none;
}

.poll-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(200, 85, 43, 0.12);
}

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

/* ── Date Chip Grid (poll) ──────────────────────────────────────────────── */
.date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.date-chip {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 9px;
  padding: 8px 6px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  color: var(--ink-2);
  transition: all 0.15s ease;
  position: relative;
  user-select: none;
}
.date-chip:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.date-chip .dc-md {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.date-chip .dc-dow {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}
.date-chip .dc-tick {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  transition: all 0.15s ease;
}
.date-chip.selected {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}
.date-chip.selected .dc-md {
  color: var(--primary);
}
.date-chip.selected .dc-dow {
  color: var(--primary);
  opacity: 0.7;
}
.date-chip.selected .dc-tick {
  background: var(--primary);
  color: white;
}
.date-chip.selected .dc-tick svg {
  width: 8px;
  height: 8px;
}

.date-chip.weekend .dc-dow {
  color: #b85a4a;
}
.date-chip.selected.weekend .dc-dow {
  color: var(--primary);
}

.chip-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

/* ── Chip Toolbar ───────────────────────────────────────────────────────── */
.chip-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
}

.mini-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s;
}

.mini-btn:hover {
  background: var(--surface-2);
  border-color: var(--ink-2);
}

.selected-count {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.selected-count strong {
  color: var(--ink);
  font-weight: 700;
}

/* ── Time Slot Options (poll) ───────────────────────────────────────────── */
.time-slot-group {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: var(--surface-2);
}

.time-slot-group__date {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 8px;
}

.time-slot-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.slot-option {
  padding: 0.3rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 500;
}

.slot-option:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.slot-option.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  font-weight: 600;
}

/* ── Result Section (index) ─────────────────────────────────────────────── */
#result-section {
  display: none;
}

#result-section.visible {
  display: block;
}

/* ── Misc ───────────────────────────────────────────────────────────────── */
.loading-overlay {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
  position: relative;
  z-index: 1;
}

.error-wrap {
  max-width: 760px;
  margin: 40px auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

.poll-footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px 32px 40px;
  position: relative;
  z-index: 1;
}

.poll-footer a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

/* Admin page utilities */
.page-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

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

/* ── Spinner ────────────────────────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Flatpickr Overrides ────────────────────────────────────────────────── */
.flatpickr-calendar {
  font-family: inherit !important;
  border-radius: 14px !important;
  border: 1.5px solid var(--line) !important;
  box-shadow: 0 8px 32px rgba(74, 50, 30, 0.16) !important;
  background: var(--surface) !important;
}

.flatpickr-months {
  background: var(--surface-2) !important;
  border-radius: 14px 14px 0 0 !important;
}

.flatpickr-month,
.flatpickr-weekday,
.flatpickr-current-month {
  color: var(--ink) !important;
  fill: var(--ink) !important;
}

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
  fill: var(--ink-2) !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  font-weight: 700 !important;
  color: white !important;
}

.flatpickr-day:hover {
  background: var(--primary-soft) !important;
  border-color: var(--primary) !important;
}

.flatpickr-day.today {
  border-color: var(--primary) !important;
}

.flatpickr-day.today:not(.selected) {
  color: var(--primary) !important;
  font-weight: 700 !important;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  h1.poll-title {
    font-size: 34px;
  }

  .poll-main {
    padding: 24px 20px;
  }

  .poll-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .deadline-pill {
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 12px 16px;
  }

  .brand-tag {
    display: none;
  }

  .container {
    padding: 24px 16px;
  }

  .hero__title {
    font-size: 28px;
  }

  h1.poll-title {
    font-size: 28px;
  }
}
