:root {
  color-scheme: dark;
  --bg: #050d19;
  --bg-layer: #0b182a;
  --panel: rgba(11, 27, 44, 0.84);
  --panel-soft: rgba(13, 34, 54, 0.72);
  --border: rgba(142, 188, 228, 0.2);
  --text: #e8f2ff;
  --text-muted: #9eb9d1;
  --accent: #3cb8ff;
  --accent-strong: #16a4ff;
  --success: #36d399;
  --danger: #ff8888;
  --shadow: 0 20px 50px rgba(1, 8, 15, 0.44);
  --card-radius-scale: 0.8;
  --radius-lg: calc(20px * var(--card-radius-scale));
  --radius-md: calc(14px * var(--card-radius-scale));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}

* {
  box-sizing: border-box;
}

body.page-polls {
  margin: 0;
  min-height: 100vh;
  background-image:
    linear-gradient(180deg, rgba(4, 8, 16, 0.84) 0%, rgba(7, 16, 31, 0.76) 42%, rgba(7, 16, 31, 0.9) 100%),
    url('assets/images/Polls%20background.png');
  background-image:
    linear-gradient(180deg, rgba(4, 8, 16, 0.84) 0%, rgba(7, 16, 31, 0.76) 42%, rgba(7, 16, 31, 0.9) 100%),
    image-set(
      url('assets/images/optimized/polls-background-mobile.webp') type('image/webp'),
      url('assets/images/Polls%20background.png') type('image/png')
    );
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
}

@media (min-width: 900px) {
  body.page-polls {
    background-image:
      linear-gradient(180deg, rgba(4, 8, 16, 0.84) 0%, rgba(7, 16, 31, 0.76) 42%, rgba(7, 16, 31, 0.9) 100%),
      image-set(
        url('assets/images/optimized/polls-background-desktop.webp') type('image/webp'),
        url('assets/images/Polls%20background.png') type('image/png')
      );
  }
}

@media (max-width: 768px) {
  body.page-polls {
    background-attachment: scroll;
  }
}

a {
  color: var(--accent);
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.header {
  padding: 1.2rem 0;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand,
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.rocket-icon {
  font-size: 1.25rem;
}

.brand-text {
  display: inline-flex;
  flex-direction: column;
}

.site-title {
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: #d3e5f8;
}

.site-subtitle-home {
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
}

.site-nav a.active {
  background: #deefff;
  color: #081322;
  font-weight: 600;
}

.nav-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.poll-main {
  padding-bottom: 4rem;
}

.poll-intro {
  margin: 2rem 0 1.5rem;
  max-width: 74ch;
}

.poll-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.75rem;
  color: #8ed4ff;
}

.poll-intro h1 {
  margin: 0.2rem 0 0.7rem;
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
  line-height: 1.15;
}

.poll-intro p {
  margin: 0;
  color: var(--text-muted);
}

.poll-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

.poll-lower-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  align-items: start;
}

.poll-lower-grid > * {
  align-self: start;
}

.poll-side-column {
  display: grid;
  gap: 0.95rem;
  align-content: start;
}

.poll-list-panel,
.poll-active-panel,
.poll-analytics-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.poll-list-panel {
  padding: 1rem;
  position: sticky;
  top: 0.7rem;
}

.poll-results-panel {
  align-self: start;
}

.poll-active-panel {
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.poll-analytics-panel {
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.poll-hero-panel {
  background:
    radial-gradient(circle at 10% 20%, rgba(68, 192, 255, 0.13), transparent 45%),
    radial-gradient(circle at 92% 5%, rgba(132, 183, 255, 0.14), transparent 38%),
    var(--panel-soft);
}

.poll-hero-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
}

.poll-hero-copy h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2.3vw, 1.6rem);
  line-height: 1.2;
}

.poll-hero-copy .status-text {
  margin-top: 0.4rem;
}

.poll-hero-nav {
  display: grid;
  gap: 0.2rem;
  align-content: center;
  justify-items: center;
}

.poll-active-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.poll-active-layout .vote-form,
.poll-active-layout .poll-results-panel {
  min-width: 0;
}

.poll-nav-btn {
  width: 1.9rem;
  height: 1.55rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #d9f8ff;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 8px rgba(114, 216, 255, 0.62), 0 0 18px rgba(90, 212, 255, 0.28);
  filter: drop-shadow(0 0 5px rgba(90, 212, 255, 0.42));
  transition: color 0.18s ease, filter 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
  animation: poll-nav-arrow-pulse 2.3s ease-in-out infinite;
}

.poll-nav-btn:hover,
.poll-nav-btn:focus-visible {
  color: #ffffff;
  filter: drop-shadow(0 0 9px rgba(114, 216, 255, 0.82));
  outline: 0;
  transform: translateY(-1px) scale(1.08);
}

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

.poll-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  animation: none;
}

@keyframes poll-nav-arrow-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 4px rgba(90, 212, 255, 0.32));
  }

  50% {
    filter: drop-shadow(0 0 9px rgba(114, 216, 255, 0.68));
  }
}

.analytics-refresh-badge {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(22, 164, 255, 0.55);
  color: #b9e7ff;
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  background: rgba(22, 164, 255, 0.12);
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.analytics-kpi-card {
  border: 1px solid var(--border);
  border-radius: calc(12px * var(--card-radius-scale));
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.035);
}

.analytics-kpi-card h3 {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.analytics-kpi-card p {
  margin: 0.25rem 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.analytics-block {
  border: 1px solid var(--border);
  border-radius: calc(12px * var(--card-radius-scale));
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.03);
}

.analytics-block h3 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #d1ebff;
}

.analytics-panel-head {
  align-items: center;
}

.analytics-meta-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.16rem 0.5rem;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.analytics-sparkline {
  margin-top: 0.55rem;
  width: 100%;
  height: 76px;
  display: block;
  color: #5ac9ff;
  background: linear-gradient(180deg, rgba(90, 201, 255, 0.08), rgba(90, 201, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: calc(10px * var(--card-radius-scale));
}

.analytics-segments {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.analytics-segment-card {
  border: 1px solid var(--border);
  border-radius: calc(10px * var(--card-radius-scale));
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
}

.analytics-segment-card h4 {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.analytics-segment-card p {
  margin: 0.2rem 0 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.analytics-segment-card span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.analytics-export-btn {
  padding: 0.45rem 0.7rem;
  font-size: 0.74rem;
}

.analytics-bars {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.analytics-bars--top-polls {
  gap: 0.75rem;
}

.analytics-bars--top-polls .analytics-bar-row {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: calc(10px * var(--card-radius-scale));
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.04);
}

.analytics-bars--top-polls .analytics-bar-top {
  font-size: 0.9rem;
  align-items: flex-start;
}

.analytics-bars--top-polls .analytics-bar-value {
  font-size: 0.82rem;
}

.analytics-outcomes {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.analytics-outcome-item {
  display: grid;
  gap: 0.18rem;
}

.analytics-outcome-top {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.analytics-outcome-label {
  font-weight: 600;
}

.analytics-outcome-value {
  color: var(--text-muted);
  white-space: nowrap;
}

.analytics-outcome-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.analytics-outcome-track span {
  display: block;
  height: 100%;
}

.analytics-outcome-item.is-yes .analytics-outcome-label {
  color: #9cefd4;
}

.analytics-outcome-item.is-yes .analytics-outcome-track span {
  background: linear-gradient(90deg, #5ce0b6, #2ebf94);
}

.analytics-outcome-item.is-no .analytics-outcome-label {
  color: #ffb7aa;
}

.analytics-outcome-item.is-no .analytics-outcome-track span {
  background: linear-gradient(90deg, #ff8f7a, #e26a67);
}

.analytics-outcome-item.is-unsure .analytics-outcome-label {
  color: #9fddff;
}

.analytics-outcome-item.is-unsure .analytics-outcome-track span {
  background: linear-gradient(90deg, #69d1ff, #2f97f1);
}

.analytics-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.analytics-bar-row {
  display: grid;
  gap: 0.25rem;
}

.analytics-bar-row.is-clickable {
  cursor: pointer;
}

.analytics-bar-row.is-clickable:hover,
.analytics-bar-row.is-clickable:focus-visible {
  border-color: rgba(90, 201, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(90, 201, 255, 0.25);
}

.analytics-bar-top {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.83rem;
}

.analytics-bar-label {
  max-width: none;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.analytics-bar-value {
  color: var(--text-muted);
  white-space: nowrap;
}

.analytics-bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.analytics-bar-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #5fd1ff, #169eff);
}

.analytics-meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
}

.poll-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.poll-list-item {
  text-align: left;
  padding: 0.7rem 0.75rem;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.poll-list-item:hover {
  border-color: rgba(155, 204, 245, 0.5);
}

.poll-list-item.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(22, 164, 255, 0.3);
}

.poll-list-item__question {
  display: block;
  font-weight: 600;
  line-height: 1.35;
}

.poll-list-item__meta {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.panel-block {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.panel-block h2,
.panel-block h3 {
  margin-top: 0;
}

.vote-form fieldset {
  margin: 0;
  border: 0;
  padding: 0;
}

.vote-options {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.vote-option {
  display: flex;
  position: relative;
  align-items: flex-start;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: calc(12px * var(--card-radius-scale));
  padding: 0.62rem 0.7rem;
  min-width: 0;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.vote-option[hidden] {
  display: none !important;
}

.vote-option__thumb {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #1b2029;
  flex-shrink: 0;
}

.vote-option__name {
  line-height: 1.25;
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.vote-option__content {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}

.vote-option__source {
  display: block;
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.vote-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.vote-option:hover {
  border-color: rgba(120, 195, 245, 0.42);
}

.vote-option:has(input:checked) {
  border-color: rgba(111, 176, 222, 0.5);
  background: rgba(18, 56, 84, 0.2);
  box-shadow: inset 4px 0 0 rgba(60, 184, 255, 0.95);
}

.vote-option:has(input:focus-visible) {
  outline: 2px solid rgba(146, 220, 255, 0.65);
  outline-offset: 1px;
}

.vote-option--disabled {
  opacity: 0.55;
  border-style: dashed;
}

.vote-option--quote {
  align-items: flex-start;
  padding: 0.65rem 0.72rem;
}

.vote-option--quote .vote-option__name {
  font-size: 0.97rem;
  line-height: 1.4;
  white-space: normal;
}

.vote-options-index {
  border: 1px solid var(--border);
  border-radius: calc(12px * var(--card-radius-scale));
  background: rgba(255, 255, 255, 0.03);
  padding: 0.4rem 0.55rem 0.55rem;
}

.vote-options-index summary {
  cursor: pointer;
  font-weight: 600;
  color: #cfe8fd;
}

.vote-options-index[open] summary {
  margin-bottom: 0.45rem;
}

.vote-options-tools {
  margin-top: 0.35rem;
}

.vote-options-search {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.52rem 0.62rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.vote-options-list {
  --vote-option-visible-rows: 5;
  --vote-option-row-height: 4.15rem;
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: repeat(var(--vote-options-columns, 2), minmax(0, 1fr));
  grid-auto-rows: minmax(var(--vote-option-row-height), auto);
  gap: 0.6rem;
  max-height: calc((var(--vote-option-row-height) * var(--vote-option-visible-rows)) + (0.6rem * (var(--vote-option-visible-rows) - 1)));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
  scrollbar-gutter: stable;
  align-items: start;
}

.vote-options-list--single {
  grid-template-columns: 1fr;
  --vote-option-row-height: 5.6rem;
}

.vote-options-empty {
  margin-top: 0.55rem;
}

@media (max-width: 980px) {
  .vote-options-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .vote-options-list {
    grid-template-columns: 1fr;
  }
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(180deg, #42bcff, #1da5f4);
  color: #07203a;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text-muted);
}

.status-text {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.vote-total {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.result-rows {
  display: grid;
  gap: 0.7rem;
}

.poll-result-insights {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.65rem;
}

.poll-insight-card {
  border: 1px solid rgba(142, 188, 228, 0.3);
  border-radius: calc(12px * var(--card-radius-scale));
  background: linear-gradient(135deg, rgba(39, 76, 124, 0.35), rgba(20, 53, 86, 0.6));
  padding: 0.65rem 0.7rem;
}

.poll-insight-card h4 {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #cce9ff;
}

.poll-insight-card p {
  margin: 0.3rem 0 0;
  font-size: 0.98rem;
  font-weight: 700;
}

.poll-insight-card small {
  margin-top: 0.2rem;
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.poll-donut-grid {
  margin-top: 0.35rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 0.8rem;
}

.poll-donut-card {
  border: 1px solid rgba(142, 188, 228, 0.28);
  border-radius: calc(12px * var(--card-radius-scale));
  background: linear-gradient(160deg, rgba(17, 42, 68, 0.72), rgba(10, 27, 46, 0.9));
  padding: 0.85rem 0.75rem;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.5rem;
}

.poll-donut-ring {
  --pct: 0;
  --tone: #59d0ff;
  width: 116px;
  height: 116px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--tone) calc(var(--pct) * 1%), rgba(255, 255, 255, 0.09) 0);
  box-shadow: 0 0 16px color-mix(in srgb, var(--tone) 42%, transparent);
  position: relative;
}

.poll-donut-ring::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 999px;
  background: rgba(6, 19, 33, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.poll-donut-value {
  position: relative;
  z-index: 1;
  font-weight: 700;
  font-size: 1.05rem;
  color: #e9f6ff;
  letter-spacing: 0.01em;
}

.poll-donut-label {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.25;
  font-weight: 600;
}

.poll-donut-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.result-row__top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
}

.result-row__label {
  font-weight: 600;
}

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

.result-row__bar {
  width: 100%;
  height: 10px;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.result-row__bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #49c3ff, #159dff);
}

.result-full-index {
  margin-top: 0.45rem;
  border: 1px solid var(--border);
  border-radius: calc(10px * var(--card-radius-scale));
  background: rgba(255, 255, 255, 0.03);
  padding: 0.45rem 0.55rem;
}

.result-full-index summary {
  cursor: pointer;
  font-weight: 600;
  color: #cfe8fd;
}

.result-full-index__list {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.6rem;
}

.panel-block-create details {
  cursor: pointer;
}

.panel-block-create summary {
  font-weight: 600;
}

.create-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.create-form label {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.create-form input,
.create-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.62rem 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.create-form input:focus,
.create-form textarea:focus {
  outline: 2px solid rgba(60, 184, 255, 0.4);
  outline-offset: 1px;
}

.footer {
  border-top: 1px solid var(--border);
  background: rgba(3, 9, 16, 0.75);
  padding: 1.6rem 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(11rem, 1.05fr) minmax(10rem, 0.75fr) minmax(10rem, 0.9fr) auto;
  align-items: center;
  gap: 1rem;
}

.footer-inner p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.footer-inner > div:first-child {
  display: contents;
}

.footer-inner > div:first-child .brand {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.footer-nav {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  grid-column: 3;
  grid-row: 1 / span 2;
}

.footer-mission-link {
  color: var(--text-muted);
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 800;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: center;
  width: max-content;
}

.footer-mission-link:hover {
  color: var(--accent);
}

.footer-mission-logo {
  display: block;
  grid-column: 1;
  grid-row: 2;
  width: clamp(4.75rem, 9vw, 7.5rem);
  height: auto;
  margin-top: 0.8rem;
  opacity: 0.72;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.28));
}

.footer-socials {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  grid-column: 4;
  grid-row: 1 / span 2;
}

.footer-socials__title {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-socials__card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  justify-items: start;
  max-width: 16rem;
  padding: 0.75rem;
  border: 1px solid rgba(90, 212, 255, 0.22);
  border-radius: calc(12px * var(--card-radius-scale));
  background: rgba(11, 27, 45, 0.5);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.footer-socials__avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(90, 212, 255, 0.4);
  grid-row: span 2;
}

.footer-socials__handle {
  color: #d7f2ff;
  font-weight: 600;
  line-height: 1.2;
}

.footer-socials__button {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(90, 212, 255, 0.45);
  background: rgba(90, 212, 255, 0.12);
  color: #d7f2ff;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.footer-socials__button:hover,
.footer-socials__button:focus-visible {
  border-color: rgba(120, 226, 255, 0.72);
  background: rgba(90, 212, 255, 0.22);
}

.footer-legal {
  margin-top: 1rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.back-to-top-saucer {
  position: fixed;
  left: 50%;
  bottom: 1.3rem;
  transform: translateX(-50%);
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(7, 16, 31, 0.75);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  box-shadow: 0 14px 28px rgba(2, 8, 20, 0.35);
  backdrop-filter: blur(6px);
  transition: opacity 0.24s ease, transform 0.24s ease, background-color 0.24s ease;
  z-index: 12;
}

.back-to-top-saucer.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.back-to-top-saucer:hover,
.back-to-top-saucer:focus-visible {
  background: rgba(11, 28, 46, 0.92);
  transform: translateX(-50%) translateY(-2px);
}

/* Ensure Greg AI widget is properly styled on poll page. */
body.has-greg-ai chat-bubble-snippet {
  display: none !important;
}

.greg-ai-helper {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.greg-ai-launch {
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.greg-ai-launch:hover,
.greg-ai-launch:focus-visible {
  transform: translateY(-2px) scale(1.02);
}

.greg-ai-avatar {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  object-fit: contain;
  object-position: center;
  display: block;
}

.greg-ai-launch--fallback {
  background: linear-gradient(180deg, #5ad4ff, #2da4cf);
  color: #042033;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.greg-ai-panel {
  width: min(270px, calc(100vw - 1.5rem));
  max-height: min(560px, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(142, 188, 228, 0.24);
  border-radius: 14px;
  background: rgba(8, 21, 35, 0.94);
  box-shadow: 0 18px 38px rgba(1, 8, 15, 0.52);
  overflow: hidden;
}

.greg-ai-panel[hidden] {
  display: none !important;
}

.greg-ai-panel-header {
  display: flex;
  justify-content: flex-end;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.greg-ai-close {
  border: 0;
  background: transparent;
  color: #d7efff;
  cursor: pointer;
}

.greg-ai-messages {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow-y: auto;
  flex: 1;
}

.greg-ai-message {
  display: flex;
}

.greg-ai-message-bubble {
  margin: 0;
  padding: 0.52rem 0.7rem;
  border-radius: 14px;
  max-width: 92%;
  font-size: 0.84rem;
  line-height: 1.45;
  background: linear-gradient(180deg, #ffffff 0%, #f4fcff 100%);
  color: #000000;
}

.greg-ai-message-assistant .greg-ai-message-bubble {
  margin-right: auto;
}

.greg-ai-message-user {
  justify-content: flex-end;
}

.greg-ai-message-user .greg-ai-message-bubble {
  margin-left: auto;
}

.greg-ai-form {
  padding: 0.75rem;
  display: flex;
  gap: 0.55rem;
  align-items: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.greg-ai-input {
  flex: 1;
  min-height: 46px;
  max-height: 100px;
  resize: vertical;
  border: 1px solid rgba(90, 201, 255, 0.35);
  border-radius: 12px;
  padding: 0.5rem 0.62rem;
  background: linear-gradient(180deg, #e6f6ff 0%, #d7ecfb 100%);
  color: #000000;
}

.greg-ai-send {
  border: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #bee8fb 0%, #9fd5ee 100%);
  color: #000000;
  font-weight: 700;
  padding: 0.56rem 0.8rem;
  cursor: pointer;
}

.greg-ai-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 980px) {
  .poll-grid {
    grid-template-columns: 1fr;
  }

  .poll-lower-grid {
    grid-template-columns: 1fr;
  }

  .poll-active-layout {
    grid-template-columns: 1fr;
  }

  .poll-list-panel,
  .poll-results-panel {
    position: static;
  }

  .poll-hero-head {
    grid-template-columns: 1fr;
  }

  .poll-hero-nav {
    grid-auto-flow: column;
    justify-content: start;
  }

  .poll-nav-btn {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 800px) {
  .nav-wrap {
    flex-wrap: wrap;
  }

  .site-nav {
    order: 3;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .footer-inner > div:first-child {
    display: grid;
  }

  .footer-inner > div:first-child .brand,
  .footer-mission-link,
  .footer-mission-logo,
  .footer-nav,
  .footer-socials {
    grid-column: auto;
    grid-row: auto;
    justify-self: start;
  }

  .greg-ai-helper {
    right: 0.7rem;
    bottom: 0.7rem;
  }

  .greg-ai-launch,
  .greg-ai-avatar {
    width: 54px;
    height: 54px;
  }

  .greg-ai-panel {
    width: min(260px, calc(100vw - 1rem));
    max-height: min(520px, calc(100vh - 6rem));
  }
}
