:root {
  --green: #005b31;
  --green-700: #003d21;
  --green-50: #f3faf6;
  --green-100: #d7efe2;
  --red: #c8102e;
  --red-700: #9b0c24;
  --red-50: #fff5f6;
  --ink: #14241c;
  --muted: #5c6b64;
  --line: #e4ebe7;
  --card: #ffffff;
  --paper: #f7f8f7;
  --shadow: 0 18px 48px rgba(12, 48, 32, 0.08);
  --radius: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  background: var(--paper);
}

button, input { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 91, 49, 0.06);
}

.header-inner {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: block;
  height: 52px;
  width: auto;
}

.header-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-rail {
  display: flex;
  height: 5px;
}

.brand-rail span:first-child { flex: 1.7; background: var(--green); }
.brand-rail span:last-child { flex: 1; background: var(--red); }

.hero-wrap {
  width: min(720px, calc(100% - 32px));
  margin: 24px auto 0;
}

.page-results .hero-wrap {
  width: min(960px, calc(100% - 32px));
}

.hero-wrap img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

body.is-question .hero-wrap img {
  height: 148px;
  object-fit: cover;
  object-position: left center;
}

.wrap {
  width: min(720px, calc(100% - 32px));
  margin: 18px auto 56px;
}

.page-results .wrap {
  width: min(960px, calc(100% - 32px));
}

.card {
  background: var(--card);
  border: 1px solid rgba(0, 91, 49, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 32px 28px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 18px;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 650;
}

.prose p { margin: 0 0 14px; }

.model,
.note,
.quiet {
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 14px;
}

.model {
  background: var(--green-50);
  border: 1px solid var(--green-100);
}

.note {
  background: var(--red-50);
  border-left: 3px solid var(--red);
}

.quiet {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  background: #f7f8f7;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 11px;
  padding: 12px 20px;
  font-weight: 680;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.btn:focus-visible,
.option:focus-within,
.link-row input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--green);
  color: #fff;
}

.btn-primary:hover { background: var(--green-700); }

.btn-primary:disabled {
  opacity: 0.55;
  cursor: progress;
}

.btn-ghost {
  background: transparent;
  color: var(--green);
  border: 1.5px solid #c5d7cc;
}

.btn-ghost:hover { border-color: var(--green); background: var(--green-50); }

.btn-red {
  background: #fff;
  color: var(--red);
  border: 1.5px solid #f0c2ca;
}

.btn-red:hover { background: var(--red-50); }

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.track,
.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #eef2f0;
  overflow: hidden;
}

.chart-layout {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin-top: 18px;
}

.chart-caption {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.donut-wrap { text-align: center; }

.donut { width: 168px; height: 168px; display: block; margin: 0 auto; }

.donut-total {
  fill: var(--ink);
  font-size: 22px;
  font-weight: 750;
  font-family: "Segoe UI", sans-serif;
}

.donut-caption {
  fill: var(--muted);
  font-size: 11px;
  font-family: "Segoe UI", sans-serif;
}

.swatch {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  flex: 0 0 auto;
  font-style: normal;
}

.bar-top span {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--green);
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 0.55s ease;
}

.q-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 22px;
}

.q-index {
  flex: 0 0 auto;
  min-width: 32px;
  height: 32px;
  margin-top: 2px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 750;
}

.q-title {
  margin: 0;
  padding: 0;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 680;
}

.hint {
  margin: 8px 0 0 44px;
  color: var(--muted);
  font-size: 14px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.option:hover { border-color: #9ecfb4; }

.option.is-selected {
  border-color: var(--green);
  background: var(--green-50);
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mark {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 2px solid #c9d5ce;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mark-radio { border-radius: 50%; }
.mark-check { border-radius: 6px; }

.option.is-selected .mark-radio {
  border-color: var(--green);
  background: radial-gradient(circle, var(--green) 0 5px, #fff 6px);
}

.option.is-selected .mark-check {
  border-color: var(--green);
  background: var(--green) center / 14px 14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.2 8.2 6.4 11.4 12.8 4.6'/%3E%3C/svg%3E");
}

.option-label { display: block; }

.other-field {
  margin-top: 10px;
}

.other-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 650;
}

.other-field input,
.link-row input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
}

.other-field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 91, 49, 0.12);
}

.error {
  min-height: 1.3em;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 14px;
  font-weight: 650;
}

.thanks-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 14px;
}

.signoff {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.signoff p { margin: 0; }
.sign-name { font-weight: 750; margin-top: 8px; }
.sign-org { color: var(--green); font-weight: 700; }

.loading, .status-line {
  color: var(--muted);
  font-size: 14px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.toolbar-actions .status-line {
  flex-basis: 100%;
  margin: 0;
  text-align: right;
}

.toolbar h1 { margin-bottom: 6px; }

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  display: inline-block;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0 18px;
}

.stat {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(0, 91, 49, 0.08);
  box-shadow: var(--shadow);
  padding: 16px 18px 14px;
  border-top: 4px solid var(--green);
}

.stat:last-child { border-top-color: var(--red); }

.stat b {
  display: block;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: 4px;
  font-weight: 700;
}

.stat small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.chart-card { margin-top: 14px; }

.chart-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.chart-kicker {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chart-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.bars { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }

.bar-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
  font-size: 15px;
}

.bar-top b {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.comments {
  margin: 16px 0 0;
  padding: 12px 14px;
  background: var(--red-50);
  border-radius: 12px;
}

.comments h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.comments ul { margin: 0; padding-left: 18px; }

.link-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.link-row input { font-size: 14px; }

.filter-group { margin-top: 14px; }

.filter-group p {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.3;
  text-align: left;
}

.chip.is-on {
  border-color: var(--green);
  background: var(--green-50);
  box-shadow: inset 0 -2px 0 var(--red);
}

.segment-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 720px) {
  .card { padding: 22px 16px 18px; }
  h1 { font-size: 26px; }
  .q-title { font-size: 19px; }
  .hint { margin-left: 0; }
  .stats { grid-template-columns: 1fr; }
  .chart-layout { grid-template-columns: 1fr; }
  .header-note { display: none; }
  .logo { height: 42px; }
  body.is-question .hero-wrap img { height: 112px; }
  .actions { flex-wrap: wrap; }
  .btn { width: 100%; }
  .link-row { flex-direction: column; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .bar-fill, .btn { transition: none; }
}

@media print {
  body { background: #fff; }
  .site-header { position: static; }
  .btn, .link-row, .live { display: none; }
  .card { box-shadow: none; }
}
