:root {
  color-scheme: light;
  --ink: #1f1a12;
  --muted: #6e6252;
  --paper: #fff8df;
  --line: #eadca8;
  --accent: #ffd833;
  --accent-strong: #ff7a1a;
  --surface: #ffffff;
  --focus: #008c9e;
  --orange: #ff7a1a;
  --turquoise: #11c5bf;
  --cream: #fff8df;
  --sun-soft: #fff0a6;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 122, 26, 0.2), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(17, 197, 191, 0.2), transparent 30%),
    linear-gradient(135deg, rgba(255, 216, 51, 0.34), rgba(255, 248, 223, 0.88)),
    var(--paper);
}

body {
  display: flex;
  flex-direction: column;
}

button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfc7b7;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  padding: 12px;
  resize: vertical;
}

.shell {
  display: grid;
  flex: 1;
  min-height: calc(100vh - 68px);
  place-items: center;
  padding: 24px;
}

.homeShell {
  flex: 1;
  padding: 24px;
}

.homeHero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 34px;
  align-items: center;
  width: min(1180px, 100%);
  min-height: calc(100vh - 116px);
  margin: 0 auto;
}

.recentPollsSection {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 0 48px;
}

.sectionHeading {
  margin-bottom: 16px;
}

.sectionHeading h2 {
  max-width: 740px;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  line-height: 0.98;
}

.recentPolls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.recentPollCard {
  display: grid;
  min-height: 190px;
  align-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 3px solid #151515;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 8px 9px 0 #151515;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.recentPollCard:nth-child(1) {
  background: var(--accent);
}

.recentPollCard:nth-child(2) {
  background: var(--turquoise);
}

.recentPollCard:nth-child(3) {
  background: var(--orange);
}

.recentPollCard:hover {
  transform: translateY(-3px);
  box-shadow: 11px 13px 0 #151515;
}

.recentPollCard strong {
  font-size: 1.45rem;
  line-height: 1.05;
}

.recentPollCard span {
  line-height: 1.35;
}

.recentPollMeta {
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.heroCopy h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(3.2rem, 10vw, 7.8rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.heroEyebrow {
  color: #a94600;
}

.heroText {
  max-width: 620px;
  margin-bottom: 26px;
  color: #343434;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.45;
}

.heroActions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.heroButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 156px;
  padding: 0 18px;
  text-decoration: none;
}

.heroStage {
  position: relative;
  min-height: 520px;
}

.voteBurst {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 132px;
  min-height: 132px;
  padding: 18px;
  border: 3px solid #151515;
  border-radius: 50%;
  color: #151515;
  font-size: 1.55rem;
  font-weight: 1000;
  box-shadow: 10px 12px 0 #151515;
  transform: rotate(var(--tilt));
}

.burstOne {
  --tilt: -9deg;
  top: 48px;
  left: 12px;
  background: var(--orange);
}

.burstTwo {
  --tilt: 12deg;
  top: 126px;
  right: 4px;
  background: var(--turquoise);
}

.burstThree {
  --tilt: 7deg;
  right: 92px;
  bottom: 82px;
  background: var(--accent);
}

.burstFour {
  --tilt: -13deg;
  left: 28px;
  bottom: 42px;
  background: var(--sun-soft);
}

.pulseRing {
  position: absolute;
  inset: 142px 90px;
  border: 22px solid rgba(17, 197, 191, 0.28);
  border-radius: 50%;
  box-shadow: inset 0 0 0 18px rgba(255, 122, 26, 0.2), 0 0 0 16px rgba(255, 216, 51, 0.22);
}

.poll {
  width: min(100%, 520px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 80px rgba(30, 27, 20, 0.14);
}

.adminShell {
  flex: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.legalShell {
  flex: 1;
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.legalDocument {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 52px rgba(30, 27, 20, 0.12);
}

.legalDocument h1 {
  font-size: clamp(2.2rem, 8vw, 4rem);
}

.legalDocument h2 {
  margin-top: 24px;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.legalDocument p {
  color: var(--muted);
  line-height: 1.65;
}

.legalUpdated {
  font-weight: 800;
}

.adminHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.adminHeader h1 {
  margin-bottom: 0;
  font-size: clamp(2.3rem, 8vw, 4.4rem);
}

.adminGrid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 52px rgba(30, 27, 20, 0.12);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #8a6700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 10vw, 4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

h3 {
  margin: 0;
  font-size: 0.98rem;
}

.description {
  margin-bottom: 22px;
  color: var(--muted);
  line-height: 1.5;
}

.options {
  display: grid;
  gap: 12px;
}

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 64px;
  padding: 14px 16px;
  border: 1px solid #cfc7b7;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.option:hover {
  transform: translateY(-1px);
  border-color: #111111;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.option:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.optionLabel {
  font-size: 1.15rem;
  font-weight: 800;
}

.swatch {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
}

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

.button {
  min-height: 48px;
  border: 1px solid #1c1c1c;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.button.compact {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.primary {
  background: var(--orange);
  color: #1f1a12;
}

.secondary {
  background: #fffdf4;
  color: var(--ink);
}

.textLink {
  color: var(--ink);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.siteFooter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 18px 24px 24px;
  color: var(--muted);
  font-size: 0.88rem;
}

.siteFooter a {
  color: var(--muted);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.adminFooter {
  padding-top: 0;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.field span {
  color: var(--ink);
}

.optionEditor {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.optionEditorHeader,
.listHeader,
.pollItemTop,
.linkRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.optionRows,
.pollList {
  display: grid;
  gap: 12px;
}

.optionRow {
  display: grid;
  grid-template-columns: 1fr 48px 38px;
  gap: 8px;
  align-items: center;
}

.optionColorInput {
  min-height: 44px;
  padding: 4px;
}

.iconButton {
  width: 38px;
  height: 38px;
  border: 1px solid #cfc7b7;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

.formMessage {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.pollItem {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.pollItem p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.statusBadge {
  padding: 5px 9px;
  border-radius: 999px;
  background: #ece6d8;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.statusBadge[data-status="active"] {
  background: #dff7e8;
  color: #0f6b2f;
}

.statusBadge[data-status="closed"] {
  background: #eeeeee;
  color: #555555;
}

.pollStats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
}

.pollStats div {
  min-width: 0;
}

.pollStats dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.pollStats dd {
  margin: 2px 0 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linkRow input {
  min-width: 0;
}

.campaignSnippet {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.campaignSnippet summary {
  cursor: pointer;
  font-weight: 900;
}

.campaignSnippet .field {
  margin-top: 12px;
  margin-bottom: 0;
}

.results {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

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

#totalCompleted {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.bars {
  display: grid;
  gap: 14px;
}

.barRow {
  display: grid;
  gap: 6px;
}

.barMeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

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

.barFill {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  transition: width 220ms ease;
}

@media (max-width: 520px) {
  .shell {
    align-items: stretch;
    padding: 14px;
  }

  .poll {
    padding: 22px;
  }

  .homeShell {
    padding: 14px;
  }

  .heroCopy h1 {
    font-size: clamp(3rem, 18vw, 4.9rem);
  }

  .heroActions {
    display: grid;
  }

  .heroButton {
    width: 100%;
  }

  .recentPollsSection {
    padding-bottom: 30px;
  }

  .siteFooter {
    flex-direction: column;
    gap: 8px;
  }

  .legalShell {
    padding: 14px;
  }

  .legalDocument {
    padding: 22px;
  }

  .actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .homeHero {
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: auto;
  }

  .recentPolls {
    grid-template-columns: 1fr;
  }

  .heroStage {
    min-height: 330px;
  }

  .voteBurst {
    min-width: 102px;
    min-height: 102px;
    font-size: 1.15rem;
    box-shadow: 7px 8px 0 #151515;
  }

  .burstOne {
    top: 16px;
    left: 4px;
  }

  .burstTwo {
    top: 38px;
    right: 6px;
  }

  .burstThree {
    right: 68px;
    bottom: 46px;
  }

  .burstFour {
    left: 26px;
    bottom: 18px;
  }

  .pulseRing {
    inset: 88px 70px;
    border-width: 16px;
  }

  .adminShell {
    padding: 16px;
  }

  .adminHeader,
  .pollItemTop,
  .linkRow {
    align-items: stretch;
    flex-direction: column;
  }

  .adminGrid {
    grid-template-columns: 1fr;
  }

  .pollStats {
    grid-template-columns: 1fr;
  }
}
