.quiz-invite {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin: 4px 0 24px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(6, 74, 69, .18);
  border-radius: 20px;
  background: linear-gradient(135deg, #fff 0%, #f2f6f4 58%, #e4ece8 100%);
  box-shadow: 0 12px 32px rgba(6, 74, 69, .08);
}
.quiz-invite::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -54px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(200, 164, 92, .34);
  border-radius: 50%;
  pointer-events: none;
}
.quiz-invite__eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font: 600 13px/1.2 var(--accent);
  letter-spacing: 2.5px;
}
.quiz-invite h2 {
  margin: 0;
  color: var(--primary);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 1px;
}
.quiz-invite p:not(.quiz-invite__eyebrow) {
  max-width: 430px;
  margin: 8px 0 0;
  color: var(--sub);
  font-size: 13px;
  line-height: 1.75;
}
.quiz-invite__button {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 156px;
  min-height: 58px;
  place-items: center;
  gap: 1px;
  padding: 8px 22px;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(6, 74, 69, .18);
}
.quiz-invite__button span { font-size: 15px; font-weight: 600; letter-spacing: 1px; }
.quiz-invite__button small { color: var(--sand); font-size: 10px; letter-spacing: .5px; }
.quiz-invite__button:focus-visible,
.health-quiz button:focus-visible {
  outline: 3px solid rgba(200, 164, 92, .48);
  outline-offset: 3px;
}

body.quiz-open { overflow: hidden; }
.health-quiz[hidden] { display: none; }
.health-quiz {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 39, 36, .72);
  backdrop-filter: blur(7px);
}
.health-quiz__dialog {
  display: flex;
  width: min(760px, 100%);
  max-height: min(860px, calc(100dvh - 48px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(220, 217, 210, .7);
  border-radius: 26px;
  background: var(--page);
  box-shadow: 0 26px 80px rgba(4, 35, 31, .32);
}
.health-quiz__top {
  position: relative;
  flex: none;
  padding: 24px 68px 20px 28px;
  background: var(--primary);
  color: #fff;
}
.health-quiz__top::after {
  content: "";
  position: absolute;
  right: 72px;
  bottom: 0;
  width: 72px;
  height: 1px;
  background: var(--gold);
}
.health-quiz__eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--sand);
  font: 600 13px/1.2 var(--accent);
  letter-spacing: 3px;
}
.health-quiz__top h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 2px;
}
.health-quiz__close {
  position: absolute;
  top: 18px;
  right: 20px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(220, 217, 210, .5);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}
.health-quiz__body {
  overflow: auto;
  padding: 24px 28px 30px;
  overscroll-behavior: contain;
}
.health-quiz__progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7e4;
}
.health-quiz__progress-track i {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #45827b);
  transition: width .28s ease;
}
.health-quiz__count {
  margin: 10px 0 18px;
  color: var(--sub);
  font-size: 12px;
  letter-spacing: 1px;
  text-align: center;
}
.health-quiz__question {
  margin: 0 0 18px;
  color: var(--primary);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: .5px;
}
.health-quiz__question:focus,
.health-quiz__result-head h3:focus,
.health-quiz__detail-head h3:focus { outline: none; }
.health-quiz__hint {
  margin: -10px 0 18px;
  color: var(--sub);
  font-size: 12px;
}
.health-quiz__options { display: grid; gap: 10px; }
.health-quiz__option {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 13px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 10px 16px;
  border: 1px solid #d7dfdc;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s;
}
.health-quiz__option:hover { border-color: var(--primary); background: #f4f8f6; transform: translateY(-1px); }
.health-quiz__option.is-picked { border-color: var(--primary); background: #edf5f2; box-shadow: inset 0 0 0 1px var(--primary); }
.health-quiz__key {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #edf4f1;
  color: var(--primary);
  font: 700 13px/1 var(--accent);
}
.health-quiz__option.is-picked .health-quiz__key { background: var(--primary); color: #fff; }
.health-quiz__option-copy { font-size: 15px; font-weight: 600; line-height: 1.5; }
.health-quiz__nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}
.health-quiz__back,
.health-quiz__restart {
  min-height: 42px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.health-quiz__back:disabled { color: #aab5b2; cursor: default; }

.health-quiz__result-head { margin-bottom: 18px; text-align: center; }
.health-quiz__result-head span {
  display: block;
  color: var(--gold);
  font: 600 13px/1.2 var(--accent);
  letter-spacing: 2px;
}
.health-quiz__result-head h3 {
  margin: 7px 0 6px;
  color: var(--primary);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 1px;
}
.health-quiz__result-head p { margin: 0; color: var(--sub); font-size: 13px; }
.health-quiz__compare-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #d8e3df;
  border-radius: 14px;
  background: #eef4f2;
}
.health-quiz__compare-panel b {
  display: block;
  color: var(--primary);
  font-size: 13px;
  line-height: 1.45;
}
.health-quiz__compare-panel span {
  display: block;
  margin-top: 2px;
  color: var(--sub);
  font-size: 10px;
}
.health-quiz__compare-panel button {
  flex: none;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  cursor: pointer;
}
.health-quiz__compare-panel button:disabled {
  border-color: #b8c4c1;
  background: #b8c4c1;
  cursor: default;
}
.health-quiz__results { display: grid; gap: 13px; }
.health-quiz__result {
  position: relative;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.health-quiz__result:first-child { border-color: var(--gold); box-shadow: 0 10px 24px rgba(6, 74, 69, .09); }
.health-quiz__compare.cmp-chk {
  top: 20px;
  right: 20px;
}
.health-quiz__compare.cmp-chk.on { color: var(--primary); }
.health-quiz__rank {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  letter-spacing: 1px;
}
.health-quiz__result:first-child .health-quiz__rank { background: var(--gold); color: #263b37; }
.health-quiz__result h4 {
  margin: 10px 0 1px;
  color: var(--primary);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.45;
}
.health-quiz__theme { color: var(--sub); font-size: 12px; }
.health-quiz__price {
  margin-top: 7px;
  color: var(--primary);
  font: 600 25px/1.2 var(--accent);
}
.health-quiz__budget {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef4f2;
  color: #4f6963;
  font: 500 10px/1.5 var(--serif);
  vertical-align: middle;
}
.health-quiz__budget.is-over { background: #f7eee9; color: #9a503d; }
.health-quiz__desc { margin: 10px 0 0; color: #4d615c; font-size: 13px; line-height: 1.7; }
.health-quiz__reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.health-quiz__reason {
  padding: 3px 8px;
  border: 1px solid #d8e3df;
  border-radius: 999px;
  color: #42655d;
  font-size: 10px;
  line-height: 1.5;
}
.health-quiz__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
.health-quiz__detail,
.health-quiz__select {
  min-height: 44px;
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
}
.health-quiz__detail { border: 1px solid var(--primary); background: #fff; color: var(--primary); }
.health-quiz__select { border: 1px solid var(--gold); background: var(--primary); color: #fff; }
.health-quiz__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.health-quiz__footer p { max-width: 500px; margin: 0; color: var(--sub); font-size: 11px; line-height: 1.7; }

.health-quiz__return {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.health-quiz__detail-head {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid rgba(6, 74, 69, .18);
  border-radius: 18px;
  background: linear-gradient(135deg, #fff 0%, #eef4f1 100%);
}
.health-quiz__detail-head > span {
  color: var(--gold);
  font: 600 12px/1.2 var(--accent);
  letter-spacing: 2px;
}
.health-quiz__detail-head h3 {
  margin: 7px 0 2px;
  color: var(--primary);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.45;
}
.health-quiz__detail-head p { margin: 0; color: var(--sub); font-size: 12px; }
.health-quiz__detail-head > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}
.health-quiz__detail-head strong { color: var(--primary); font: 600 27px/1.2 var(--accent); }
.health-quiz__detail-head strong small { font-size: 14px; }
.health-quiz__detail-head > div > b { color: var(--sub); font-size: 12px; font-weight: 500; }
.health-quiz__detail-groups { display: grid; gap: 12px; }
.health-quiz__detail-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.health-quiz__detail-group h4 {
  margin: 0;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: #edf4f1;
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}
.health-quiz__detail-group ul { margin: 0; padding: 0 15px; list-style: none; }
.health-quiz__detail-group li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid #e5eae8;
}
.health-quiz__detail-group li:last-child { border-bottom: 0; }
.health-quiz__detail-group li > div { min-width: 0; flex: 1; }
.health-quiz__detail-group li b { display: block; color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.55; }
.health-quiz__detail-group li span { display: block; margin-top: 2px; color: var(--sub); font-size: 11px; line-height: 1.55; }
.health-quiz__detail-group li em {
  flex: none;
  padding: 2px 7px;
  border-radius: 999px;
  background: #edf4f1;
  color: var(--primary);
  font-size: 10px;
  font-style: normal;
  line-height: 1.5;
}
.health-quiz__detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.health-quiz__detail-back {
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
}

@media (max-width: 768px) {
  .health-quiz { padding: 0; place-items: stretch; }
  .health-quiz__dialog { width: 100%; max-height: 100dvh; min-height: 100dvh; border: 0; border-radius: 0; }
  .health-quiz__body { padding: 22px 20px calc(28px + env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .quiz-invite { grid-template-columns: 1fr; gap: 18px; padding: 21px 20px; }
  .quiz-invite__button { width: 100%; }
  .health-quiz__question { font-size: 20px; }
  .health-quiz__actions,
  .health-quiz__detail-actions { grid-template-columns: 1fr; }
}
@media (max-width: 575px) {
  .health-quiz__top { padding: 18px 60px 16px 20px; }
  .health-quiz__top h2 { font-size: 20px; }
  .health-quiz__close { top: 12px; right: 12px; }
  .health-quiz__option { min-height: 58px; padding: 9px 12px; }
  .health-quiz__result { padding: 17px 15px; }
  .health-quiz__compare-panel { align-items: flex-start; gap: 10px; padding: 11px 12px; }
  .health-quiz__compare-panel button { padding: 0 13px; }
  .health-quiz__compare.cmp-chk { top: 17px; right: 15px; }
  .health-quiz__detail-head { padding: 17px 15px; }
  .health-quiz__detail-head h3 { font-size: 21px; }
  .health-quiz__detail-head > div { align-items: flex-start; flex-direction: column; gap: 4px; }
  .health-quiz__footer { display: block; }
  .health-quiz__restart { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .health-quiz__progress-track i,
  .health-quiz__option { transition: none; }
}
