:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #637083;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --danger: #b42318;
  --border: #d9e0ea;
  --soft: #eef5f4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.narrow {
  width: min(780px, 100%);
  margin: 0 auto;
}

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

h1, h2, h3, p { overflow-wrap: anywhere; }

h1 {
  margin: 0;
  font-size: 2.2rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.35rem;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.muted,
.empty-state {
  color: var(--muted);
}

.panel,
.poll-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(23, 32, 51, 0.06);
}

.panel {
  padding: 22px;
}

.section {
  margin-top: 28px;
}

.form-stack {
  display: grid;
  gap: 14px;
}

label,
legend {
  font-weight: 700;
}

input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 12px;
}

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

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
  text-decoration: none;
}

.secondary {
  background: #fff;
  color: var(--accent);
}

.secondary:hover {
  background: var(--soft);
  color: var(--accent-strong);
}

.danger {
  border-color: var(--danger);
  background: #fff;
  color: var(--danger);
}

.danger:hover {
  background: #fff1f0;
  color: var(--danger);
}

.small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

.actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.centered {
  justify-content: center;
}

.notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.notice.success {
  background: #ecfdf3;
  color: #05603a;
  border-color: #abefc6;
}

.notice.error {
  background: #fff1f0;
  color: var(--danger);
  border-color: #fecdca;
}

.checkline,
.choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 500;
}

.checkline input,
.choice input {
  margin-top: 4px;
}

.question-builder {
  display: grid;
  gap: 14px;
}

.question-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfe;
}

.question-head,
.status-line,
.bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

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

.poll-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
}

.poll-card h3 {
  margin-top: 8px;
}

.url-line {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  word-break: break-all;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.82rem;
  font-weight: 800;
}

.status.open {
  color: #05603a;
  background: #dcfae6;
}

.status.closed {
  color: #7a2e0e;
  background: #fef0c7;
}

fieldset {
  margin: 0;
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid var(--border);
}

fieldset:last-of-type {
  border-bottom: 0;
}

legend {
  margin-bottom: 12px;
  font-size: 1.08rem;
}

.required {
  margin-left: 4px;
  color: var(--danger);
}

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

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

.bar-row {
  display: grid;
  gap: 7px;
}

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

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--accent);
}

.text-answers {
  display: grid;
  gap: 10px;
}

blockquote {
  margin: 0;
  padding: 14px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fbfcfe;
  line-height: 1.5;
}

.qr-page {
  width: min(680px, 100%);
  margin: 0 auto;
  text-align: center;
}

.qr-card {
  display: inline-flex;
  margin: 24px auto 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.qr-card svg {
  width: min(360px, 78vw);
  height: auto;
}

@media (max-width: 760px) {
  .page {
    padding: 22px 14px 42px;
  }

  .topbar,
  .poll-card {
    grid-template-columns: 1fr;
    display: grid;
  }

  .card-actions {
    align-items: stretch;
  }

  .card-actions > *,
  .card-actions form,
  .card-actions button,
  .card-actions .button {
    width: 100%;
  }

  h1 {
    font-size: 1.75rem;
  }
}
