* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans JP",
    sans-serif;
  background: #f5f6f8;
  color: #1c1c1c;
}

button,
input {
  font: inherit;
}

.header {
  background: white;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.logo {
  margin: 0;
  font-size: 22px;
}

nav {
  display: flex;
  gap: 8px;
}

.nav-button {
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.nav-button:hover,
.nav-button.active {
  background: #eeeeee;
}

.create-poll-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(115, 87, 255, 0.24);
  transition: 0.2s ease;
}

.create-poll-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(115, 87, 255, 0.28);
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 20px 80px;
}

.hero {
  text-align: center;
  margin: 0 0 20px;
  padding: 18px 0 8px;
}

.eyebrow {
  margin-bottom: 8px;
  font-weight: 700;
  color: #666;
}

.hero h2 {
  margin: 0;
  font-size: 34px;
}

.hero-text {
  color: #777;
}

.vote-card,
.create-section,
.created-vote-card {
  background: white;
  border: 1px solid #e6e6e6;
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

.category {
  display: inline-block;
  background: #eeeeee;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.question {
  font-size: 26px;
  margin: 18px 0 8px;
}

.description {
  color: #777;
  margin-bottom: 26px;
}

.vote-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.vote-button {
  border: 2px solid #222;
  background: white;
  border-radius: 12px;
  padding: 18px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  transition: 0.2s;
}

.vote-button:hover {
  transform: translateY(-2px);
  background: #f4f4f4;
}

.vote-button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.results {
  margin-top: 28px;
}

.hidden {
  display: none;
}

.result-row {
  margin-bottom: 18px;
}

.result-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress {
  height: 12px;
  background: #ededed;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  transition: width 0.4s ease;
}

.option-a-bar {
  background: #222;
}

.option-b-bar {
  background: #888;
}

.total-votes {
  text-align: center;
  color: #777;
}

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: min(320px, calc(100vw - 32px));
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  box-shadow: 0 14px 32px rgba(26, 26, 36, 0.18);
  color: #fff;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: auto;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: linear-gradient(135deg, #1f9d75, #3ec1a0);
  border-color: rgba(20, 124, 92, 0.4);
}

.toast-error {
  background: linear-gradient(135deg, #d9495d, #ef6671);
  border-color: rgba(164, 32, 52, 0.45);
}

.toast-info {
  background: linear-gradient(135deg, #4e73ff, #6a8dff);
  border-color: rgba(54, 89, 182, 0.35);
}

.create-section h2,
.section-title {
  margin-top: 0;
}

#createVoteForm {
  display: grid;
  gap: 20px;
}

#createVoteForm .form-group {
  margin: 0;
}

#createVoteForm label {
  display: block;
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--ink);
}

#createVoteForm input,
#createVoteForm select {
  width: 100%;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid #cccccc;
  border-radius: 10px;
  outline: none;
}

#createVoteForm input:focus,
#createVoteForm select:focus {
  border-color: #333;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.create-button {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(115, 87, 255, 0.2);
}

.create-button:hover {
  background: linear-gradient(135deg, var(--purple-dark), #db327f);
}

.created-votes {
  display: grid;
  gap: 18px;
}

.created-vote-card h3 {
  margin-top: 0;
  font-size: 21px;
}

.poll-question-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.poll-question-link {
  color: inherit;
  text-decoration: none;
}

.poll-question-link:hover {
  text-decoration: underline;
}

.poll-card-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.poll-menu-button {
  width: 30px;
  height: 30px;
  border: 1px solid #d9d4f5;
  background: #fff;
  color: var(--purple-dark);
  border-radius: 10px;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: 0.2s ease;
}

.poll-menu-button:hover {
  background: var(--soft-purple);
}

.poll-report-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 140px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 30px rgba(32, 33, 58, 0.12);
  z-index: 20;
}

.poll-report-menu[hidden] {
  display: none;
}

.poll-report-menu-item {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 10px 12px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.poll-report-menu-item:hover {
  background: var(--soft-purple);
  color: var(--purple-dark);
}

.copy-link-button {
  flex-shrink: 0;
  border: 1px solid #d9d4f5;
  background: #fff;
  color: var(--purple-dark);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
  white-space: nowrap;
}

.copy-link-button:hover {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

.created-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.created-buttons button {
  min-height: 58px;
  padding: 12px 14px;
  background: white;
  border: 1px solid #d9d4f5;
  border-radius: 14px;
  cursor: pointer;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--ink);
}

.created-result {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.poll-total-votes {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.empty-state {
  border: 1px dashed #d0d0d0;
  background: #f9f9f9;
  color: #555;
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  font-size: 1rem;
  line-height: 1.7;
}

.feed-state {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.feed-state-inner {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.feed-state-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(115, 87, 255, 0.2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: feed-state-spin 0.9s linear infinite;
}

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

.feed-state-message {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink);
}

.feed-state-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft-purple);
  color: var(--purple-dark);
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
}

.feed-state-button:hover {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

@media (max-width: 600px) {
  .header-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 14px;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
    margin-top: 0;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-button {
    flex: 0 0 auto;
    min-height: 40px;
    white-space: nowrap;
  }

  .container {
    width: 100%;
    padding: 28px 14px 56px;
  }

  .hero {
    padding: 16px 4px 6px;
    margin-bottom: 8px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 14vw, 3.2rem);
  }

  .hero-text {
    font-size: 0.98rem;
    margin-bottom: 14px;
  }

  .feed-tabs {
    gap: 6px;
    padding: 5px;
  }

  .feed-tab {
    min-height: 38px;
    font-size: 0.9rem;
  }

  .mobile-feed-toggle {
    display: flex !important;
  }

  .create-section,
  .polls-section,
  .genres-section {
    padding: 20px 16px;
    border-radius: 18px;
  }

  .section-heading {
    display: block;
    margin-bottom: 22px;
  }

  .section-description {
    margin-top: 8px;
    font-size: 0.88rem;
  }

  .genre-list {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .genre-item {
    min-height: 48px;
    padding: 10px;
    font-size: 0.82rem;
  }

  .poll-card,
  .created-vote-card {
    padding: 18px;
  }

  .question {
    font-size: 23px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .create-dialog-header {
    padding: 18px 18px 10px;
  }

  .create-dialog-form {
    padding: 18px;
  }

  .poll-options,
  .created-buttons {
    grid-template-columns: 1fr;
  }

  .poll-options button,
  .created-buttons button {
    min-height: 46px;
  }

  .gauge-label {
    font-size: 0.78rem;
  }

  .footer-inner {
    display: grid;
    gap: 14px;
    padding: 24px 14px;
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
  }
}

/* MinVote theme */
:root {
  --primary: #6C4CF5;
  --primary-hover: #5B3EE8;
  --primary-soft: #F3F0FF;
  --accent: #E94B9B;
  --accent-soft: #FFF0F7;
  --teal: #27BEB7;
  --blue: #4F7DE8;
  --text-primary: #17172B;
  --text-secondary: #667085;
  --border: #E8E6F0;
  --background: #FAFAFD;

  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --purple: var(--primary);
  --purple-dark: var(--primary-hover);
  --pink: var(--accent);
  --soft-purple: var(--primary-soft);
  --soft-pink: var(--accent-soft);
  --cyan: var(--teal);
  --orange: var(--accent);
  --surface: #ffffff;
  --soft-cyan: #EAFBF9;
  --yellow: #E8C86A;
}

body {
  color: var(--ink);
  background: var(--background);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid rgba(232, 229, 244, 0.9);
  backdrop-filter: blur(16px);
  transform: translateY(0);
  transition: transform 190ms ease, box-shadow 190ms ease;
  will-change: transform;
}

.feed-state-error .feed-state-message {
  white-space: pre-line;
}

.site-header.is-scroll-hidden {
  transform: translateY(calc(-100% - 2px));
}

.site-header.is-scrolled:not(.is-scroll-hidden) {
  box-shadow: 0 5px 16px rgba(42, 34, 84, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}

.header-inner {
  max-width: 1120px;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
  line-height: 0;
}

.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  display: block;
  width: auto;
  height: 42px;
  max-width: min(36vw, 420px);
  object-fit: contain;
  flex-shrink: 0;
}

.mobile-brand-name,
.create-poll-label-mobile {
  display: none;
}

@media (max-width: 520px) {
  .brand-logo {
    height: 28px;
    max-width: min(30vw, 120px);
  }
}

.main-nav {
  display: flex;
  gap: 6px;
}

.nav-button {
  color: var(--muted);
  transition: 0.2s ease;
}

.nav-button:hover,
.nav-button.active {
  color: var(--primary-hover);
  background: var(--primary-soft);
}

@media (max-width: 600px) {
  .site-header {
    padding-top: env(safe-area-inset-top);
  }

  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 10px;
    min-height: 0;
    padding: 5px 14px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    justify-content: flex-start;
    gap: 8px;
    line-height: 1;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
    max-width: 34px;
  }

  .mobile-brand-name {
    display: inline;
    overflow: hidden;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
  }

  .create-poll-button {
    grid-column: 2;
    grid-row: 1;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.88rem;
    box-shadow: 0 6px 16px rgba(115, 87, 255, 0.2);
  }

  .create-poll-label-desktop { display: none; }
  .create-poll-label-mobile { display: inline; }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 4px;
    overflow: visible;
    padding: 0;
  }

  .nav-button {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 7px 6px;
    font-size: 0.9rem;
    white-space: nowrap;
  }
}

.container {
  max-width: 1120px;
}

.hero {
  padding: 18px 0 12px;
}

.eyebrow,
.section-label {
  color: var(--primary);
  letter-spacing: 0.18em;
}

.hero h1 {
  color: var(--ink);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing: -0.08em;
  line-height: 1.08;
  margin: 0;
}

.hero-text,
.section-description {
  color: var(--muted);
}

.hero-text {
  margin: 10px auto 16px;
  max-width: 460px;
}

.create-button {
  display: inline-flex;
  justify-content: center;
  border: 0;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(108, 76, 245, 0.18);
  transition: 0.2s ease;
}

.create-button:hover {
  background: var(--primary-hover);
  box-shadow: 0 12px 24px rgba(108, 76, 245, 0.22);
  transform: translateY(-2px);
}

.create-dialog {
  width: min(720px, calc(100% - 24px));
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  padding: 0;
  box-shadow: 0 28px 70px rgba(32, 33, 58, 0.22);
}

.create-dialog::backdrop {
  background: rgba(32, 33, 58, 0.4);
  backdrop-filter: blur(3px);
}

.create-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--border);
}

.create-dialog-header h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.create-dialog-form {
  display: grid;
  gap: 20px;
  padding: 22px;
}

.report-dialog {
  width: min(540px, calc(100% - 24px));
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  padding: 0;
  box-shadow: 0 28px 70px rgba(32, 33, 58, 0.22);
}

.report-dialog::backdrop {
  background: rgba(32, 33, 58, 0.4);
  backdrop-filter: blur(3px);
}

.report-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--border);
}

.report-dialog-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
}

.report-dialog-form {
  display: grid;
  gap: 20px;
  padding: 22px;
}

.report-dialog-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.report-target {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--soft-purple);
  color: var(--purple-dark);
  font-weight: 700;
  word-break: break-word;
}

.report-reason-list {
  display: grid;
  gap: 10px;
}

.report-reason-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.report-reason-item input {
  accent-color: var(--purple);
}

.report-dialog textarea {
  width: 100%;
  resize: vertical;
  min-height: 110px;
  border: 1px solid #cccccc;
  border-radius: 10px;
  padding: 13px 14px;
  outline: none;
}

.report-dialog textarea:focus {
  border-color: var(--purple);
}

.report-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.secondary-button {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
}

.dialog-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft-purple);
  color: var(--purple-dark);
  font-size: 1.1rem;
  cursor: pointer;
}

.create-section,
.polls-section,
.genres-section {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 50px rgba(66, 55, 125, 0.1);
}

.poll-feed-tools {
  margin-bottom: 14px;
}

.genre-quick-filter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.genre-quick-filter label { white-space: nowrap; }

.genre-quick-filter select {
  width: min(260px, 52vw);
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 11px;
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M2 2l5 5 5-5' fill='none' stroke='%236c4cf5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 9px;
  color: var(--purple-dark);
  font-weight: 700;
  padding: 0 44px 0 14px;
  cursor: pointer;
}

.genre-quick-filter select:hover,
.genre-quick-filter select:focus-visible,
.genre-filter-clear:focus-visible,
.genre-item:focus-visible {
  border-color: var(--primary);
  outline: 3px solid rgba(108, 76, 245, 0.18);
  outline-offset: 2px;
}

.genre-filter-clear {
  min-height: 42px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--soft-purple);
  color: var(--purple-dark);
  padding: 0 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.vote-status-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.vote-status-filter-label {
  white-space: nowrap;
}

.vote-status-filter-options {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}

.vote-status-filter-button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 5px 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.vote-status-filter-button.active {
  background: var(--soft-purple);
  color: var(--purple-dark);
}

.vote-status-filter-button:focus-visible {
  outline: 3px solid rgba(108, 76, 245, 0.18);
  outline-offset: 2px;
}

.genre-filter-clear:hover {
  color: #fff;
  background: var(--primary);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(66, 55, 125, 0.04);
}

.search-icon {
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.98rem;
  outline: none;
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft-purple);
  color: var(--purple-dark);
  font-weight: 800;
  cursor: pointer;
}

.feed-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--soft-purple);
}

.feed-tab {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.feed-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(108, 76, 245, 0.16);
}

.mobile-feed-toggle {
  display: none;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--soft-purple);
}

.mobile-feed-toggle-btn {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.mobile-feed-toggle-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(108, 76, 245, 0.16);
}

.swipe-feed {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;

  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.swipe-feed[hidden] {
  display: none;
}

/* Author display:grid otherwise overrides the browser's hidden attribute rule. */
.created-votes[hidden] {
  display: none;
}

.swipe-feed .swipe-poll-card {


  min-height: 100%;
}

.swipe-feed .created-vote-card {
  margin-bottom: 0;
}

.genres-section {
  margin-top: 0;
  margin-bottom: 24px;
  padding: 28px;
  border-top: 4px solid var(--primary);
}

.genres-section[hidden] { display: none; }

.genres-section h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.genre-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.genre-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text-primary);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  text-align: left;
  transition: 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.genre-item:hover {
  color: var(--primary-hover);
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-2px);
}

.genre-toggle-button {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--soft-purple);
  color: var(--purple-dark);
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.genre-toggle-button:hover {
  color: #fff;
  border-color: var(--purple);
  background: var(--purple);
}

.poll-card[hidden] {
  display: none;
}

.genre-page[hidden] {
  display: none;
}

.genre-page {
  padding: 28px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 50px rgba(66, 55, 125, 0.1);
}

.genre-page h2 { margin: 0 0 6px; }
.genre-page-description { margin: 0 0 20px; color: var(--muted); }
.genre-search-box { margin-bottom: 14px; }

.back-button {
  margin-bottom: 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--purple-dark);
  background: var(--soft-purple);
  cursor: pointer;
  font-weight: 700;
}

.back-button:hover {
  color: #fff;
  border-color: var(--purple);
  background: var(--purple);
}

@media (max-width: 600px) {
  .genre-quick-filter {
    width: 100%;
  }

  .genre-quick-filter select {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .vote-status-filter {
    width: 100%;
  }

  .genres-section,
  .genre-page {
    padding: 20px 16px;
    border-radius: 18px;
  }
}

.create-section {
  border-top: 4px solid var(--primary);
}

.polls-section {
  border-top: 4px solid var(--primary);
  padding: 22px 22px 18px;
}

input {
  border-color: var(--border);
  color: var(--ink);
  background: #fcfbff;
}

input:focus,
select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(115, 87, 255, 0.12);
}

select {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
  outline: none;
  color: var(--ink);
  background: #fcfbff;
  cursor: pointer;
}

.created-votes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 700px) {
  .created-votes {
    grid-template-columns: 1fr;
  }
}

.search-empty-state {
  padding: 28px 20px;
  border: 1px dashed rgba(113, 101, 176, 0.45);
  border-radius: 16px;
  background: rgba(124, 106, 210, 0.04);
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.created-vote-card {
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  border-top: 0;
  background: #fff;
  box-shadow: 0 12px 28px rgba(66, 55, 125, 0.08);
  padding: 18px 18px 16px;
}

.created-vote-card .poll-genre {
  color: var(--primary);
  background: var(--primary-soft);
}

.poll-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(66, 55, 125, 0.06);
}

.poll-card h3 {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1.45;
}

.poll-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.poll-genre {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--purple-dark);
  background: var(--soft-purple);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.poll-time {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.poll-question-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.poll-question-row h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.35;
  color: var(--ink);
}

.poll-question-link {
  color: inherit;
  text-decoration: none;
}

.poll-question-link:hover {
  text-decoration: underline;
}

.copy-link-button {
  flex-shrink: 0;
  border: 1px solid #d9d4f5;
  background: #fff;
  color: var(--purple-dark);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
  white-space: nowrap;
}

.copy-link-button:hover {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

.poll-detail-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(66, 55, 125, 0.08);
  padding: 18px;
}

.poll-detail-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.poll-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.poll-detail-card .secondary-button {
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.ranking-page {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 50px rgba(66, 55, 125, 0.1);
  padding: 18px;
}

.ranking-header {
  margin-bottom: 12px;
}

.ranking-period-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.ranking-period-tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 9px 14px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.ranking-period-tab.active {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

.ranking-list {
  display: grid;
  gap: 12px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  padding: 14px 16px;
  box-shadow: 0 10px 24px rgba(66, 55, 125, 0.04);
}

.ranking-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--soft-purple);
  color: var(--purple-dark);
  font-weight: 900;
  font-size: 1.05rem;
}

.ranking-details {
  min-width: 0;
}

.ranking-question {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 1.08rem;
  font-weight: 800;
  padding: 0 0 8px;
  cursor: pointer;
}

.ranking-question:hover {
  color: var(--purple-dark);
}

.ranking-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.ranking-vote-count {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.ranking-result {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.poll-comments {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.poll-comments-header {
  margin-bottom: 12px;
}

.poll-comments-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

.poll-comment-form {
  display: grid;
  gap: 10px;
}

.poll-comment-form textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
  box-sizing: border-box;
}

.poll-comment-form textarea:focus {
  outline: 2px solid rgba(115, 87, 255, 0.18);
  border-color: var(--purple);
}

.comment-form-meta {
  display: flex;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.comment-submit-button {
  justify-self: flex-end;
  min-width: 120px;
}

.comment-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.comment-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #faf8ff;
  padding: 12px 12px 10px;
}

.comment-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.comment-time {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.comment-report-button,
.comment-delete-button {
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 800;
}

.comment-body {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-empty-state {
  margin-top: 8px;
}

@media (max-width: 767px) {
  .poll-detail-header-row {
    align-items: flex-start;
  }

  .poll-detail-actions {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }

  .comment-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .comment-actions {
    margin-left: 0;
  }
}

.poll-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.poll-options button {
  min-height: 46px;
  border: 1px solid #d9d4f5;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--purple-dark);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .poll-options button:hover {
    color: #fff;
    border-color: var(--purple);
    background: var(--purple);
    transform: translateY(-2px);
  }
}

.created-buttons button {
  border: 1px solid #d9d4f5;
  color: var(--purple-dark);
  background: #fff;
  transition: 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .created-buttons button:hover {
    color: #fff;
    border-color: var(--purple);
    background: var(--purple);
    transform: translateY(-2px);
  }
}

.vote-choice-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  transform-origin: center;
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.vote-choice-button::before {
  content: "";
  width: 0;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.2s ease;
}

.vote-choice-button.selected {
  color: var(--primary-hover);
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 8px 20px rgba(108, 76, 245, 0.08);
  transform: scale(1.01);
  animation: votePulse 0.35s ease;
}

.vote-choice-button.selected::before {
  content: "✓";
  width: 1.1em;
  opacity: 1;
  font-weight: 900;
  color: var(--primary-hover);
}

.vote-choice-button.selected::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.35), transparent 55%);
  transform: translateX(-100%);
  animation: choiceShimmer 0.6s ease;
}

@keyframes votePulse {
  0% { transform: scale(0.98); }
  45% { transform: scale(1.04); }
  100% { transform: scale(1.02); }
}

@keyframes choiceShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.created-result {
  color: var(--muted);
}

.vote-gauge {
  display: grid;
  gap: 12px;
  margin-top: 0;
  padding: 12px;
  border: 1px solid #eceaf8;
  border-radius: 14px;
  background: #fafbff;
}

.gauge-row {
  display: grid;
  gap: 6px;
}

.gauge-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.gauge-label strong {
  color: var(--primary);
}

.gauge-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9ebf5;
}

.gauge-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  transition: width 0.35s ease;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
}

.footer-links a:hover {
  color: var(--pink);
}

.legal-dialog {
  width: min(820px, calc(100% - 28px));
  max-height: min(86vh, 760px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 70px rgba(32, 33, 58, 0.25);
}

.legal-dialog::backdrop {
  background: rgba(32, 33, 58, 0.48);
  backdrop-filter: blur(3px);
}

.legal-dialog-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
}

.legal-dialog-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 92px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 14px;
  color: var(--purple-dark);
  background: var(--soft-purple);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
}

.legal-content {
  max-height: calc(min(86vh, 760px) - 82px);
  overflow-y: auto;
  padding: 24px;
  line-height: 1.8;
}

.legal-content h3 {
  margin: 28px 0 8px;
  font-size: 1rem;
}

.legal-content p {
  margin: 0 0 14px;
}

.legal-content ol {
  margin: 0 0 14px;
  padding-left: 1.6rem;
}

.legal-content ul {
  margin: 0 0 14px;
  padding-left: 1.6rem;
}

.terms-date {
  margin-top: 30px !important;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .legal-dialog-header,
  .legal-content {
    padding: 18px;
  }

  .legal-dialog-header h2 {
    font-size: 1.1rem;
  }
}

@media (max-width: 600px) {
  .poll-options {
    grid-template-columns: 1fr;
  }
}
.swipe-feed .feed-state { flex: 0 0 min(82vw, 360px); }

.feed-pagination-control {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-top: 18px;
}

.feed-pagination-control[hidden] {
  display: none;
}

.feed-pagination-button {
  min-width: 132px;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft-purple);
  color: var(--purple-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.feed-pagination-button:hover:not(:disabled) {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

.feed-pagination-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

@media (max-width: 600px) {
  .feed-pagination-button {
    min-width: 144px;
    min-height: 46px;
  }
}

.poll-advanced-settings { margin: 4px 0 16px; }
.poll-advanced-settings summary { cursor: pointer; color: var(--text-muted, #64748b); font-size: 14px; }
.poll-expiration-options { border: 0; margin: 16px 0 0; padding: 0; }
.poll-expiration-options legend { font-weight: 600; margin-bottom: 8px; }
#createVoteForm .poll-expiration-options label { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-weight: 400; }
#createVoteForm .poll-expiration-options input { width: auto; margin: 0; padding: 0; accent-color: var(--primary); }
.poll-card-header:has(.poll-expiration) { flex-wrap: wrap; }
.poll-card-header > .poll-time { order: 1; }
.poll-expiration { font-size: 12px; font-weight: 600; color: var(--purple-dark); }
.poll-expiration.is-expired { font-weight: 600; color: #8b4350; }
.poll-detail-meta .poll-expiration { margin-left: 12px; }
.vote-choice-button:disabled { cursor: not-allowed; opacity: 0.65; }

/* The immersive layout applies only to the existing mobile swipe surface. */
.swipe-navigation { display: none; }
.poll-front-actions {
  display: flex; gap: 10px; margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.poll-front-actions > button {
  flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--primary-soft); color: var(--purple-dark);
  font: inherit; font-size: 13px; cursor: pointer;
}
.poll-front-actions > button:hover { background: var(--soft-purple); }
.poll-front-actions > button:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.swipe-comments-dialog {
  width: min(100%, 620px); max-width: 100%; max-height: 85vh; max-height: 85dvh;
  margin: auto auto 0; padding: 0; border: 0; border-radius: 24px 24px 0 0;
  background: var(--surface, #fff); color: var(--ink);
  box-shadow: 0 -12px 48px rgba(66, 55, 125, .16);
}
.swipe-comments-dialog[open] { display: flex; flex-direction: column; animation: swipe-sheet-in .2s ease-out; }
.swipe-comments-dialog::backdrop { background: rgba(30, 23, 55, .4); }
.swipe-comments-heading { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.swipe-comments-heading h2 { margin: 0; font-size: 18px; }
.swipe-comments-heading button, .swipe-navigation button, .swipe-card-actions button {
  min-height: 44px; border: 1px solid var(--border); border-radius: 12px;
  padding: 8px 14px; background: var(--soft-purple); color: var(--purple-dark); font: inherit; cursor: pointer;
}
.swipe-comments-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px max(20px, env(safe-area-inset-bottom)); }
.swipe-comments-body .poll-comments { border: 0; margin: 0; padding-top: 16px; }
.swipe-comments-body .poll-comments-header { display: none; }
html.swipe-comments-open, .swipe-comments-open body { overflow: hidden; }
.swipe-comments-open .swipe-feed { overflow: hidden; }
@keyframes swipe-sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (max-width: 767px) {
  .swipe-comments-dialog.keyboard-open[open] {
    position: fixed;
    inset: var(--comments-viewport-top, 0px) 0 auto;
    width: 100%;
    height: var(--comments-viewport-height, 100dvh);
    max-width: 100%;
    max-height: var(--comments-viewport-height, 100dvh);
    margin: 0;
    border-radius: 0;
  }
  .swipe-comments-dialog.keyboard-open .swipe-comments-heading { display: none; }
  .swipe-comments-dialog.keyboard-open .swipe-comments-body {
    flex: 1 1 auto;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .swipe-feed { height: calc(100vh - 220px); height: calc(100dvh - 220px); min-height: 380px; border-radius: 20px; }
  .swipe-feed:not([hidden]) + .swipe-navigation { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; }
  .swipe-feed .swipe-poll-card {
    box-sizing: border-box; display: flex; flex-direction: column; gap: 14px;
    min-height: 100%; margin: 0; padding: 20px; border-radius: 20px;
  }
  .swipe-feed .poll-card-header { flex-wrap: wrap; margin: 0; gap: 8px; }
  .swipe-feed .poll-card-actions { margin-left: auto; }
  .swipe-feed .poll-time { display: inline; margin-left: auto; font-size: 11px; }
  .swipe-feed .poll-menu-button { min-width: 44px; min-height: 44px; }
  .swipe-feed .poll-question-row { margin: auto 0 8px; }
  .swipe-feed .poll-question-row h3 { font-size: clamp(23px, 6vw, 32px); line-height: 1.45; margin: 0; overflow-wrap: anywhere; }
  .swipe-feed .created-buttons { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0; }
  .swipe-feed .vote-choice-button {
    position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto;
    text-align: left; gap: 6px 12px; min-height: 72px; padding: 18px;
    font-size: 18px; border: 1px solid var(--border); background: var(--soft-purple); color: var(--ink);
  }
  .swipe-feed .vote-choice-button::before {
    content: ""; display: block; position: absolute; inset: 0 auto 0 0; height: 100%;
    width: var(--result-percent, 0%); border: 0; border-radius: 0; background: var(--primary);
    opacity: .16; transform: none; transition: width .25s ease-out; pointer-events: none;
  }
  .swipe-feed .vote-choice-button::after { display: none; }
  .swipe-feed .vote-choice-button > * { position: relative; z-index: 1; }
  .swipe-feed .swipe-option-label { overflow-wrap: anywhere; }
  .swipe-feed .swipe-option-percent, .swipe-feed .swipe-your-answer { display: none; }
  .swipe-feed .swipe-results-visible .swipe-option-percent { display: block; }
  .swipe-feed .swipe-results-visible .swipe-your-answer:not([hidden]) { display: block; grid-column: 1 / -1; font-size: 12px; color: var(--purple-dark); }
  .swipe-feed .vote-choice-button:disabled { opacity: 1; cursor: default; }
  .swipe-feed .vote-choice-button.selected { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); transform: none; animation: none; }
  .swipe-feed .vote-gauge, .swipe-feed .created-result { display: none; }
  .swipe-feed .poll-total-votes { margin: 0; }
  .swipe-card-actions { display: flex; gap: 12px; margin-top: auto; padding-top: 8px; }
  .swipe-card-actions button { flex: 1; }
  .swipe-feed .feed-state { box-sizing: border-box; min-height: 100%; scroll-snap-align: start; }
  .swipe-feed :focus-visible, .swipe-navigation :focus-visible, .swipe-comments-dialog :focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .swipe-feed .vote-choice-button::before { transition: none; }
  .swipe-comments-dialog[open] { animation: none; }
}

/* Only mobile swipe mode becomes a bounded card deck. List/desktop keep their layout. */
@media (max-width: 767px) {
  .mobile-swipe-active .polls-section:not([hidden]) {
    position: relative;
    display: flex; flex-direction: column; gap: 8px; padding: 10px 16px max(8px, env(safe-area-inset-bottom));
    background: var(--background); overflow: visible;
  }
  .mobile-swipe-active .polls-section > .section-heading { display: none; }
  .mobile-swipe-active .poll-feed-tools, .mobile-swipe-active .feed-tabs,
  .mobile-swipe-active .mobile-feed-toggle { margin: 0; flex-shrink: 0; }
  .mobile-swipe-active .search-box { margin: 0; }
  .mobile-swipe-active .poll-feed-tools input { padding-top: 8px; padding-bottom: 8px; }
  .mobile-swipe-active .swipe-feed {
    position: relative; flex: none; min-height: 360px;
    height: calc(100vh - var(--swipe-header-height, 76px) - 230px);
    height: calc(100dvh - var(--swipe-header-height, 76px) - 230px);
    overflow: visible; overscroll-behavior: auto; isolation: isolate;
    margin: 0 0 14px; border-radius: 20px;
  }
  .swipe-feed .swipe-poll-card {
    position: absolute; inset: 0; min-height: 0; height: 100%; width: 100%;
    gap: 10px; padding: 16px; overflow: hidden; overscroll-behavior: auto;
    touch-action: pan-y; user-select: none; transform-origin: 50% 80%;
    transition: transform .22s ease-out, opacity .22s ease-out; background: #fff;
  }
  .swipe-feed .swipe-current { z-index: 2; transform: translateX(0) rotate(0); }
  .swipe-feed .swipe-preview { z-index: 1; transform: translateY(12px) scale(.96); filter: brightness(.97); pointer-events: none; }
  .swipe-feed .is-dragging { transition: none; will-change: transform; }
  .swipe-feed .poll-card-header { gap: 6px; }
  .swipe-feed .poll-card-actions { order: 2; margin-left: 0; }
  .swipe-feed .poll-menu-button { min-height: 40px; min-width: 40px; }
  .swipe-feed .poll-question-row { margin: auto 0; flex-shrink: 0; }
  .swipe-feed .poll-question-row h3 { font-size: clamp(22px, 6vw, 28px); line-height: 1.35; }
  .swipe-feed .created-buttons { flex-shrink: 0; gap: 8px; }
  .swipe-feed .vote-choice-button { min-height: 58px; padding: 12px 14px; font-size: 16px; }
  .swipe-feed .poll-total-votes { font-size: 12px; }
  .swipe-feed .swipe-card-content {
    display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
    gap: 10px; overflow-y: auto; overscroll-behavior-y: auto; touch-action: pan-y;
  }
  .swipe-feed .swipe-card-content > * { flex-shrink: 0; }
  .swipe-feed .swipe-card-actions {
    display: flex; flex: 0 0 auto; margin-top: 0; padding-top: 8px;
    border-top: 1px solid var(--border); background: #fff;
  }
  .swipe-feed .swipe-card-actions button {
    min-height: 44px; font-size: 13px; padding: 6px 12px;
    background: var(--primary-soft); color: var(--purple-dark);
  }
  .swipe-feed:not([hidden]) + .swipe-navigation { align-items: center; padding: 0; flex-shrink: 0; min-height: 44px; }
  .swipe-navigation button { background: transparent; font-size: 13px; }
  .swipe-hint { font-size: 11px; color: var(--muted); }
  .swipe-hint[hidden] { display: none; }
  .swipe-navigation button { margin-left: auto; }
  .swipe-stack-state { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
}
@media (prefers-reduced-motion: reduce) {
  .swipe-feed .swipe-poll-card { transition: none; }
}

/* Shared threaded comments, in the sheet and on poll details. */
.comments-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; }
.comments-panel-title { margin: 0; font-size: 17px; }
.comments-sort { max-width: 130px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: white; color: var(--ink); }
.comment-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.comment-secondary { min-height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; background: var(--primary-soft); color: var(--purple-dark); font: inherit; font-size: 13px; cursor: pointer; }
.comment-reactions { display: flex; flex-wrap: wrap; gap: 8px; }
.comment-reactions [aria-pressed="true"] { background: var(--primary); color: white; }
.comment-secondary:disabled { opacity: .55; cursor: default; }
.comment-thread { min-width: 0; }
.comment-replies { min-width: 0; }
.comment-reply {
  box-sizing: border-box;
  margin-left: min(calc(var(--thread-depth, 1) * 20px), 80px);
  width: calc(100% - min(calc(var(--thread-depth, 1) * 20px), 80px));
  padding: 12px 10px 12px 14px;
  border-left: 2px solid color-mix(in srgb, var(--primary) 32%, var(--border));
  border-radius: 0 10px 10px 0;
}
.comment-menu { position: relative; }
.comment-menu summary { cursor: pointer; min-width: 44px; min-height: 40px; text-align: center; list-style: none; }
.comment-menu[open] { display: flex; flex-wrap: wrap; gap: 6px; }
.comment-reply-context { padding: 8px; border-radius: 10px; background: var(--primary-soft); font-size: 13px; }
.comment-reply-context[hidden] { display: none; }
.comment-reply-context span { display: block; overflow-wrap: anywhere; }
.inline-reply-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 10px;
  background: #fff;
}
.inline-reply-label { color: var(--purple-dark); font-size: 13px; }
.inline-reply-preview { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.inline-reply-form textarea {
  width: 100%; min-height: 76px; resize: vertical; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink); font: inherit;
}
.inline-reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inline-reply-submit { min-width: 96px; }
.comment-status { font-size: 13px; color: var(--muted); margin: 0; }
.poll-comments > .comment-secondary { margin-top: 12px; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.poll-comments :focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
@media (max-width: 600px) {
  .comment-reply {
    margin-left: min(calc(var(--thread-depth, 1) * 12px), 42px);
    width: calc(100% - min(calc(var(--thread-depth, 1) * 12px), 42px));
    padding-left: 10px;
  }
}
@media (min-width: 768px) {
  .swipe-comments-dialog { margin: auto; border-radius: 20px; width: min(620px, 90vw); }
}
