:root {
  --bg: #F4F7FC;
  --card: #fff;
  --ink: #1C2434;
  --muted: #5B6578;
  --line: #E3E9F4;
  --pri: #5B7FD6;
  --pri-d: #4566B8;
  --soft: #E8EEF9;
  --ok: #2F9E6B;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
  background: #0f1420;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.phone {
  max-width: 420px; margin: 0 auto; min-height: 100%;
  background: var(--bg);
  position: relative;
  display: flex; flex-direction: column;
}
.page {
  display: none; flex: 1; flex-direction: column;
  padding: 20px 20px calc(24px + var(--safe-b));
  min-height: 100dvh;
}
.page.active { display: flex; }

.hero { position: relative; padding: 48px 4px 28px; }
.blob {
  position: absolute; inset: 10px auto auto 50%; transform: translateX(-50%);
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #A8C0F5, #5B7FD6 60%, transparent 70%);
  opacity: .35; pointer-events: none;
}
.eyebrow { position: relative; margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.hero h1 { position: relative; margin: 0 0 12px; font-size: 36px; letter-spacing: .02em; }
.lead { position: relative; margin: 0; font-size: 16px; line-height: 1.55; color: var(--muted); }

.stack { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.foot { text-align: center; margin: 18px 0 0; font-size: 12px; color: #8A94A8; }

.btn {
  appearance: none; border: none; cursor: pointer;
  border-radius: 14px; padding: 16px 18px; font-size: 16px; font-weight: 600;
  transition: transform .08s ease, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--pri); color: #fff; }
.btn.primary:not(:disabled):active { background: var(--pri-d); }
.btn.ghost { background: var(--soft); color: var(--ink); }

.top {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 17px; margin: 4px 0 18px;
}
.back {
  width: 36px; height: 36px; border-radius: 12px; border: none;
  background: var(--soft); font-size: 18px; cursor: pointer; color: var(--ink);
}

.calm { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.breath {
  width: 140px; height: 140px; margin: 24px 0 18px; border-radius: 50%;
  background: linear-gradient(145deg, #9BB4EB, #5B7FD6);
  animation: breathe 6s ease-in-out infinite;
  box-shadow: 0 12px 40px rgba(91,127,214,.35);
}
@keyframes breathe {
  0%, 100% { transform: scale(.82); opacity: .85; }
  50% { transform: scale(1); opacity: 1; }
}
.calm-tip { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.hint { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

.feel { width: 100%; margin-top: 28px; text-align: left; }
.label { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 1.5px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 10px 14px; font-size: 14px; cursor: pointer; color: var(--ink);
}
.chips button.on {
  border-color: var(--pri); background: #EEF3FC; color: var(--pri-d); font-weight: 600;
}

.bar-bottom { margin-top: auto; padding-top: 16px; }
.bar-bottom.col { display: flex; flex-direction: column; gap: 10px; }

.form { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.form label { margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--muted); }
textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 12px 14px; font-size: 16px; font-family: inherit; resize: none;
  background: var(--card); color: var(--ink); line-height: 1.45;
}
textarea:focus { outline: none; border-color: var(--pri); }

.preview { flex: 1; }
.msg {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 16px; font-size: 15px; line-height: 1.65; white-space: pre-wrap;
  min-height: 160px; margin: 8px 0 10px;
  word-break: keep-all; overflow-wrap: anywhere;
}
.toast {
  position: fixed; left: 50%; bottom: calc(28px + var(--safe-b));
  transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 999px; font-size: 13px; z-index: 9;
  max-width: 90%;
}

@media (min-width: 480px) {
  body { display: flex; align-items: center; justify-content: center; padding: 24px; }
  .phone {
    min-height: 780px; max-height: 860px; height: 860px;
    border-radius: 28px; overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.45);
  }
  .page { min-height: 0; overflow: auto; }
}

.feel-hint { margin-top: 12px; color: var(--pri-d); font-weight: 500; }

.foot.disclaimer, .hint.disclaimer { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 8px; }
.foot.safety { color: #8A5A3B; font-size: 12px; line-height: 1.45; margin-top: 6px; }
.fire-wait { text-align: center; margin: 0 0 8px; }
