:root {
  --teal: #159D95;
  --teal-bright: #3FD0C6;
  --teal-deep: #0D3D41;
  --purple: #8A3F9C;
  --bg: #F3F7F7;
  --card: #FFFFFF;
  --line: #DCE6E6;
  --ink: #0D3D41;
  --muted: #4E6B6D;
  --teal-wash: #E6F6F5;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(13, 61, 65, 0.06), 0 8px 24px rgba(13, 61, 65, 0.07);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.5 "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

h1, h2, .brand, .pill, .submit, .num {
  font-family: "Plus Jakarta Sans", "Figtree", system-ui, sans-serif;
}

.top {
  background: var(--teal-deep);
  color: #fff;
  padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top));
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--teal-bright), var(--teal) 55%, var(--purple));
}

main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.intro { padding: 22px 20px 20px; }

.pill {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
}

.question {
  margin: 14px 0 6px;
  font-size: clamp(22px, 6vw, 28px);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hint { margin: 0; color: var(--muted); font-size: 15px; }

.options {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 14px 16px;
  min-height: 64px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  font: 600 17px/1.3 "Figtree", system-ui, sans-serif;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.option:active { transform: scale(0.985); }

.option:focus-visible { outline: 3px solid var(--teal-bright); outline-offset: 2px; }

.num {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--teal);
  color: var(--teal);
  font-weight: 800;
  font-size: 16px;
  transition: background-color 0.15s, color 0.15s;
}

.option-text { flex: 1; }

.tick {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  transition: background-color 0.15s, border-color 0.15s;
}

.option.single .tick { border-radius: 50%; }

.tick svg { width: 14px; height: 14px; opacity: 0; transition: opacity 0.15s; }

.option[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--teal-wash);
}

.option[aria-pressed="true"] .num { background: var(--teal); color: #fff; }

.option[aria-pressed="true"] .tick { background: var(--teal); border-color: var(--teal); }

.option[aria-pressed="true"] .tick svg { opacity: 1; }

.actions {
  position: sticky;
  bottom: 0;
  margin: 16px -16px 0;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, rgba(243, 247, 247, 0));
}

.submit, .secondary {
  width: 100%;
  min-height: 56px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
}

.submit {
  border: 0;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 6px 16px rgba(21, 157, 149, 0.3);
  transition: background-color 0.15s, opacity 0.15s;
}

.submit:hover:not(:disabled) { background: #12877F; }

.submit:disabled {
  background: #B9C9C9;
  box-shadow: none;
  cursor: not-allowed;
}

.secondary {
  margin-top: 18px;
  background: transparent;
  border: 2px solid var(--teal);
  color: var(--teal-deep);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 16px;
}

.error {
  margin: 10px 0 0;
  color: #A1242F;
  font-weight: 600;
  font-size: 15px;
  text-align: center;
}

.message {
  padding: 36px 24px;
  text-align: center;
}

.message .pill { margin-bottom: 14px; }

.message-title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 800;
}

.message-body { margin: 0; color: var(--muted); }

.message-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--teal-wash);
  display: grid;
  place-items: center;
}

.message-icon svg { width: 30px; height: 30px; }

.chosen {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg);
  text-align: left;
  font-size: 15px;
}

.chosen strong { display: block; margin-bottom: 4px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.chosen ul { margin: 0; padding-left: 20px; }

.spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--teal);
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.foot {
  padding: 18px 16px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.num.wide { width: auto; min-width: 44px; padding: 0 8px; border-radius: 999px; font-size: 15px; }

/* Personal commitment card (Live Poll 3) */
.commit { margin-top: 16px; padding: 22px 20px 20px; }
.commit h2 { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.commit-sub { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.commit-gap {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--teal-wash);
  font-weight: 700;
}
.commit-gap span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.commit-label {
  display: block;
  margin: 0 0 6px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  font-size: 16px;
}
.commit input[type="date"], .commit textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: 600 17px/1.4 "Figtree", system-ui, sans-serif;
}
.commit input[type="date"] { min-height: 52px; }
.commit textarea { resize: vertical; margin-bottom: 14px; }
.commit input:focus, .commit textarea:focus { outline: none; border-color: var(--teal); }
.chips { display: flex; gap: 8px; margin: 10px 0 18px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--teal);
  background: #fff;
  color: var(--teal-deep);
  font: 700 14px/1 "Figtree", system-ui, sans-serif;
  cursor: pointer;
}
.chip:active { background: var(--teal-wash); }
.commit-preview {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-left: 4px solid var(--teal);
  border-radius: 0 14px 14px 0;
  background: var(--bg);
  font-weight: 700;
  font-size: 17px;
}
.cal-choices { display: grid; gap: 8px; margin-top: 10px; }
.cal-choices[hidden] { display: none; }
.commit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.secondary.small { margin-top: 0; min-height: 48px; font-size: 15px; }
.commit-msg { margin: 10px 0 0; min-height: 1.2em; color: var(--teal); font-weight: 700; font-size: 15px; text-align: center; }
.link {
  display: block;
  margin: 6px auto 0;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 600 14px "Figtree", system-ui, sans-serif;
  text-decoration: underline;
  cursor: pointer;
}
