:root {
  --bg: #0d111b;
  --bg2: #111724;
  --panel: #171d29;
  --panel2: #202735;
  --text: #f3efe5;
  --muted: #9ba4b5;
  --line: #323b4b;
  --gold: #d0bd8e;
  --blue: #78a7d4;
  --orange: #c98b55;
  --purple: #a88bd5;
  --danger: #8c6c42;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: linear-gradient(180deg, #0b0f17, var(--bg2));
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
}
button,
input {
  font: inherit;
}
.app {
  max-width: 820px;
  margin: 0 auto;
  padding: 12px max(14px, env(safe-area-inset-right))
    calc(90px + env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
}
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 17, 27, 0.94);
  backdrop-filter: blur(12px);
  padding: 13px 2px 10px;
  border-bottom: 1px solid #1e2635;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand b {
  letter-spacing: 0.17em;
  font-size: 12px;
  color: var(--gold);
}
.brand span {
  font-size: 12px;
  color: var(--muted);
}
.progress {
  height: 6px;
  background: #222a39;
  border-radius: 99px;
  margin-top: 10px;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  background: var(--gold);
  width: 0;
  transition: 0.22s;
}
.hero,
.section-head,
.card,
.results {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #151b27, #10151f);
  border-radius: 22px;
}
.hero {
  padding: 30px 22px;
  margin: 22px 0;
}
.eyebrow {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.17em;
  text-transform: uppercase;
}
.hero h1,
.section-head h2,
.qtext,
.results h2 {
  font-family: Georgia, serif;
}
.hero h1 {
  font-size: 38px;
  line-height: 1.05;
  margin: 10px 0 14px;
}
.hero p,
.section-head p,
.note {
  color: #c1c9d5;
  line-height: 1.58;
}
.help-demo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: #c5ccd7;
}
.section-head {
  padding: 18px;
  margin: 22px 0 14px;
}
.section-head h2 {
  font-size: 28px;
  margin: 6px 0 8px;
}
.card {
  padding: 20px 18px;
  margin: 12px 0;
  background: var(--panel);
}
.qhead {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.qnum {
  color: #778296;
  font-size: 12px;
  letter-spacing: 0.12em;
  min-width: 42px;
  padding-top: 4px;
}
.qtext {
  font-size: 23px;
  line-height: 1.3;
  flex: 1;
}
.qhelp {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid #53657b;
  border-radius: 10px;
  color: var(--blue);
  background: #151c28;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
}
.qhelp:hover,
.qhelp:focus {
  background: #223149;
  outline: 2px solid rgba(120, 167, 212, 0.25);
}
.opts {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid #343d4d;
  border-radius: 14px;
  background: #1b2230;
  cursor: pointer;
  touch-action: manipulation;
}
.choice:hover {
  border-color: #586981;
}
.choice.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(208, 189, 142, 0.35) inset;
}
.choice input {
  margin-top: 3px;
  accent-color: #d0bd8e;
}
.letter {
  font-weight: 900;
  color: #8db7dc;
  min-width: 19px;
}
.confidence {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid #2c3442;
}
.confidence-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 9px;
}
.confrow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.confrow .choice {
  justify-content: center;
  padding: 11px;
  font-size: 13px;
}
.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-top: 16px;
}
.scale .choice {
  display: block;
  text-align: center;
  padding: 12px 7px;
}
.scale strong {
  display: block;
  font-size: 18px;
  margin-bottom: 4px;
}
.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin: 20px 0;
}
.btn {
  min-height: 48px;
  border: 1px solid #4b5668;
  background: #202837;
  color: #fff;
  padding: 12px 17px;
  border-radius: 13px;
  font-weight: 750;
  cursor: pointer;
  touch-action: manipulation;
}
.btn.primary {
  background: var(--gold);
  color: #1d2129;
  border-color: var(--gold);
}
.btn.ghost {
  background: transparent;
}
.btn:active {
  transform: translateY(1px);
}
.nav {
  position: sticky;
  bottom: 0;
  z-index: 15;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  background: linear-gradient(
    180deg,
    rgba(13, 17, 27, 0),
    rgba(13, 17, 27, 0.98) 24%
  );
  padding: 24px 0 calc(10px + env(safe-area-inset-bottom));
  margin-top: 4px;
}
.nav .btn {
  flex: 1;
}
.save-note {
  text-align: center;
  color: #747f91;
  font-size: 11px;
  margin: 6px 0 0;
}
.help-sheet {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  width: min(650px, calc(100% - 24px));
  max-height: 65dvh;
  overflow: auto;
  background: #f4f0e6;
  color: #1c2230;
  border-radius: 18px;
  padding: 20px 20px 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: 0.18s;
}
.help-sheet.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.help-close {
  position: sticky;
  float: right;
  top: 0;
  border: 0;
  background: #ded7c7;
  color: #202530;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.help-title {
  font-family: Georgia, serif;
  font-size: 22px;
  margin: 2px 44px 10px 0;
}
.help-sheet p {
  line-height: 1.55;
  margin: 8px 0;
}
.shade {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: 0.18s;
}
.shade.open {
  opacity: 1;
  pointer-events: auto;
}
.results {
  padding: 22px;
  margin: 22px 0;
  background: #141a25;
}
.results h2 {
  font-size: 32px;
}
.matrix-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.matrix {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  min-width: 560px;
}
.matrix th,
.matrix td {
  border-bottom: 1px solid #323a49;
  padding: 11px 8px;
  text-align: right;
}
.matrix th:first-child,
.matrix td:first-child {
  text-align: left;
}
.mental {
  color: var(--blue);
}
.physical {
  color: var(--orange);
}
.spiritual {
  color: var(--purple);
}
.callout {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #1a2130;
  padding: 14px 15px;
  margin: 12px 0;
  line-height: 1.5;
}
.callout.warn {
  border-color: #7a6840;
}
.result-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
.result-card {
  border-left: 4px solid var(--line);
  background: #1a2130;
  border-radius: 12px;
  padding: 14px 15px;
}
.result-card.mental {
  border-left-color: var(--blue);
  color: var(--text);
}
.result-card.physical {
  border-left-color: var(--orange);
  color: var(--text);
}
.result-card.spiritual {
  border-left-color: var(--purple);
  color: var(--text);
}
.result-card b {
  display: block;
  margin-bottom: 5px;
}
.result-card p {
  margin: 0;
  color: #b8c1cf;
  line-height: 1.5;
  font-size: 13px;
}
.partlabel {
  margin-top: 26px;
  color: var(--gold);
  letter-spacing: 0.18em;
  font-size: 12px;
}
.toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #eef0f4;
  color: #171b24;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
.toast.show {
  opacity: 1;
}
.divider {
  height: 1px;
  background: #2d3544;
  margin: 18px 0;
}
.intro-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: #c1c9d5;
  line-height: 1.58;
}
.mini {
  font-size: 12px;
  color: #8f99a9;
  line-height: 1.5;
}
.resume {
  margin-top: 16px;
  padding: 12px 13px;
  border: 1px dashed #4b5668;
  border-radius: 13px;
  color: #b9c2cf;
  font-size: 13px;
}
@media (max-width: 620px) {
  .app {
    padding-top: 8px;
  }
  .hero {
    padding: 24px 18px;
  }
  .hero h1 {
    font-size: 34px;
  }
  .section-head h2 {
    font-size: 25px;
  }
  .card {
    padding: 18px 15px;
  }
  .qtext {
    font-size: 21px;
  }
  .scale {
    grid-template-columns: 1fr;
  }
  .scale .choice {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 12px;
  }
  .scale strong {
    margin: 0;
    min-width: 22px;
  }
  .confrow {
    grid-template-columns: 1fr;
  }
  .matrix {
    font-size: 12px;
  }
  .sticky {
    position: sticky;
  }
  .help-sheet {
    bottom: calc(10px + env(safe-area-inset-bottom));
    max-height: 74dvh;
  }
  .qnum {
    min-width: 36px;
  }
  .results {
    padding: 18px 15px;
  }
}

.cloud-panel{max-width:760px;margin:16px auto;padding:12px 20px;border:1px solid #394454;border-radius:16px;color:#cfd3dd;font-size:14px}.cloud-panel p{margin:6px 0}.cloud-panel .btn{margin-top:8px;font-size:14px}
