:root {
  color-scheme: light;
  --orange: #f55a2a;
  --orange-dark: #d9471d;
  --charcoal: #302c2a;
  --ink: #211f1e;
  --muted: #746d69;
  --line: #eadfd9;
  --paper: #fffaf7;
  --white: #ffffff;
  --green: #16855b;
  --blue: #234f6f;
  --blue-soft: #eaf3f8;
  --saffron-soft: #fff0e2;
  --shadow: 0 18px 50px rgba(47, 39, 34, 0.12);
  --shadow-soft: 0 10px 28px rgba(47, 39, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #fff8f3 0%, #f7fbfc 46%, #fffaf7 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
.vote-option,
.poll-card {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(16px, 4vw, 48px);
  background: rgba(255, 253, 250, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand img {
  display: block;
  width: min(170px, 42vw);
  height: auto;
}

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

nav a,
.ghost {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--charcoal);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.82);
  font-weight: 750;
  box-shadow: var(--shadow-soft);
}

nav a.active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 48px) 56px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
  margin-top: 18px;
  padding: clamp(28px, 8vw, 62px);
  border: 1px solid rgba(234, 223, 217, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 240, 226, 0.95), rgba(234, 243, 248, 0.9)),
    var(--white);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(2.1rem, 6vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: clamp(1.45rem, 4vw, 2.2rem);
  letter-spacing: 0;
}

.hero-stat {
  min-width: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.hero-stat span {
  display: block;
  font-size: 3.2rem;
  line-height: 1;
  font-weight: 950;
  color: var(--orange);
}

.hero-stat small,
.section-head p,
.form-note,
.poll-meta,
.result-subtext {
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 18px;
}

.section-head p {
  margin-bottom: 0;
}

.poll-grid,
.results-list {
  display: grid;
  gap: 14px;
}

.poll-card,
.form-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.poll-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.poll-card:hover,
.poll-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(245, 90, 42, 0.62);
  box-shadow: var(--shadow);
  outline: none;
}

.poll-card h3,
.result-card h3 {
  margin-bottom: 6px;
  font-size: 1.18rem;
}

.poll-card p,
.result-card p {
  margin-bottom: 0;
}

.poll-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 750;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--saffron-soft);
  color: var(--orange-dark);
  font-weight: 850;
}

.vote-panel {
  max-width: 760px;
  margin: 0 auto;
  padding-top: 22px;
}

.vote-box {
  padding: clamp(18px, 5vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.96));
  box-shadow: var(--shadow);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.score-button,
.vote-option,
button {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: var(--orange);
  color: var(--white);
  font-weight: 900;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease;
}

.score-button:hover,
.vote-option:hover,
button:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
}

.score-button {
  min-height: 64px;
  font-size: 1.35rem;
}

.score-button.selected,
.vote-option.selected {
  background: var(--blue);
}

.vote-options {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.vote-option {
  padding: 16px;
  text-align: left;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(300px, 430px) 1fr;
  gap: 26px;
  align-items: start;
}

.admin-panel {
  position: sticky;
  top: 86px;
}

.form-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.form-status {
  display: none;
  min-height: 42px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 850;
}

.form-status.info,
.form-status.error,
.form-status.success {
  display: flex;
}

.form-status.error {
  background: #ffe8df;
  color: #9b2f13;
}

.form-status.success {
  background: #e7f6ee;
  color: var(--green);
}

label {
  display: grid;
  gap: 7px;
  color: var(--charcoal);
  font-weight: 850;
}

input,
textarea,
select {
  width: 100%;
  min-height: 50px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(35, 79, 111, 0.6);
  box-shadow: 0 0 0 4px rgba(35, 79, 111, 0.12);
  outline: none;
}

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

.split-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hidden {
  display: none !important;
}

.result-card {
  padding: 18px;
}

.result-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.result-actions button,
.result-actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 8px;
  text-decoration: none;
  background: var(--charcoal);
  color: var(--white);
  font-size: 0.92rem;
  font-weight: 850;
}

.bars {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(40px, 115px) 1fr 40px;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 750;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f2;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--blue));
}

.success {
  padding: 28px;
  text-align: center;
}

.success strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 1.4rem;
}

.toast {
  margin-top: 12px;
  color: var(--orange-dark);
  font-weight: 800;
}

@media (max-width: 780px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hero,
  .admin-layout,
  .section-head,
  .result-top {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-stat {
    width: 100%;
  }

  .admin-panel {
    position: static;
  }

  .score-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 420px) {
  .score-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  h1 {
    font-size: 2.4rem;
  }
}
