:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --paper: #ffffff;
  --surface: #ffffff;
  --ink: #171717;
  --muted: #74706a;
  --line: #ddd8d0;
  --coach: #151515;
  --user: #eff7f1;
  --green: #1f8a57;
  --gold: #d59b2d;
  --blue: #1769c2;
  --shadow: 0 18px 60px rgba(20, 18, 14, 0.13);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 247, 244, 0.96)),
    var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

body.openingActive {
  overflow: hidden;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.opening {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0f0f0e;
  color: #fff;
  opacity: 1;
  transition:
    opacity 620ms ease,
    visibility 620ms ease;
}

.opening.done {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.openingArt {
  position: absolute;
  inset: -9%;
  background-image: url("./assets/opening-question.png");
  background-size: cover;
  background-position: center;
  filter: contrast(1.08) saturate(0) brightness(0.92);
  transform: scale(1.08);
  animation:
    questionDrift 2700ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards,
    backgroundBreath 7200ms 2700ms ease-in-out infinite alternate;
}

.openingArt::before,
.openingArt::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: inherit;
  background-size: inherit;
  background-position: inherit;
  pointer-events: none;
}

.openingArt::before {
  opacity: 0.22;
  mix-blend-mode: multiply;
  filter: contrast(2.4) saturate(0) brightness(0.64);
  transform: scale(1.012) translate3d(0, 0, 0);
  animation: inkSwim 4600ms ease-in-out infinite alternate;
}

.openingArt::after {
  opacity: 0.24;
  background:
    radial-gradient(circle at 50% 51%, rgba(255, 255, 255, 0.32), transparent 18%),
    radial-gradient(circle at 50% 51%, transparent 23%, rgba(255, 255, 255, 0.16) 24%, transparent 36%);
  mix-blend-mode: screen;
  animation: questionPulse 2400ms ease-in-out infinite;
}

.openingVeil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.18) 34%, rgba(0, 0, 0, 0.62) 76%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.54));
}

.openingMark {
  position: relative;
  width: 116px;
  height: 116px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 80px rgba(255, 255, 255, 0.22);
  font-size: 88px;
  font-weight: 800;
  line-height: 1;
  font-family: Arial, Helvetica, sans-serif;
  transform: scale(0.78);
  opacity: 0;
  animation:
    markArrive 1500ms 260ms cubic-bezier(0.16, 1, 0.3, 1) forwards,
    markBreathe 1900ms 1900ms ease-in-out infinite;
}

.openingMark::before,
.openingMark::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.38);
  pointer-events: none;
  animation: tapRing 1900ms ease-out infinite;
}

.openingMark::after {
  inset: -20px;
  opacity: 0.55;
  animation-delay: 520ms;
}

.openingMark:hover {
  background: rgba(255, 255, 255, 0.12);
}

.openingMark:active {
  transform: scale(0.96);
}

.openingText {
  position: absolute;
  right: 24px;
  bottom: max(36px, env(safe-area-inset-bottom));
  left: 24px;
  text-align: center;
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.68);
  opacity: 0;
  transform: translateY(10px);
  animation: openingTextIn 900ms 920ms ease forwards;
}

.openingText span {
  display: block;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0;
}

.openingText p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
}

.openingLogoWrap {
  width: 112px;
  margin: 12px auto 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.openingLogoWrap img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.82;
  filter: drop-shadow(0 1px 8px rgba(255, 255, 255, 0.24));
}

.consentLayer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: end center;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.consentLayer.open {
  opacity: 1;
  pointer-events: auto;
}

.consentPanel {
  width: min(420px, 100%);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 80px rgba(0, 0, 0, 0.22);
}

.consentPanel h2 {
  margin: 2px 0 7px;
  font-size: 18px;
}

.consentLead,
.consentPanel li,
.consentCheck {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.consentPanel details {
  margin-top: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.consentPanel summary {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.consentPanel ul {
  margin: 9px 0 0;
  padding-left: 18px;
}

.consentCheck {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 10px;
}

.consentCheck input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--ink);
}

.consentActions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
  margin-top: 12px;
}

.consentActions button {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 800;
}

.consentGhost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.consentPrimary {
  border: 0;
  color: #fff;
  background: var(--ink);
}

.consentPrimary:disabled {
  color: #8a8580;
  background: #e5e1da;
  cursor: not-allowed;
}

@keyframes questionDrift {
  0% {
    transform: scale(1.2) rotate(-1.5deg);
    filter: contrast(1.28) saturate(0) brightness(0.68) blur(2px);
  }
  48% {
    filter: contrast(1.12) saturate(0) brightness(0.88) blur(0);
  }
  100% {
    transform: scale(1.04) rotate(0deg);
    filter: contrast(1.08) saturate(0) brightness(0.96) blur(0);
  }
}

@keyframes backgroundBreath {
  from {
    transform: scale(1.04) rotate(0deg) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.08) rotate(0.45deg) translate3d(-1.2%, 0.8%, 0);
  }
}

@keyframes inkSwim {
  0% {
    transform: scale(1.01) translate3d(-0.35%, 0.2%, 0);
    opacity: 0.16;
  }
  45% {
    opacity: 0.29;
  }
  100% {
    transform: scale(1.035) translate3d(0.7%, -0.55%, 0);
    opacity: 0.2;
  }
}

@keyframes questionPulse {
  0%,
  100% {
    transform: scale(0.82);
    opacity: 0.1;
  }
  50% {
    transform: scale(1.18);
    opacity: 0.28;
  }
}

@keyframes markArrive {
  0% {
    opacity: 0;
    transform: scale(0.58) rotate(-8deg);
  }
  58% {
    opacity: 1;
    transform: scale(1.06) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes markBreathe {
  0%,
  100% {
    box-shadow:
      0 0 80px rgba(255, 255, 255, 0.22),
      0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    box-shadow:
      0 0 96px rgba(255, 255, 255, 0.34),
      0 0 28px rgba(255, 255, 255, 0.18);
  }
}

@keyframes tapRing {
  0% {
    transform: scale(0.86);
    opacity: 0;
  }
  28% {
    opacity: 0.78;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

@keyframes openingTextIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shell {
  width: min(100%, 520px);
  height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: max(16px, env(safe-area-inset-top)) 18px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: 0;
}

.topActions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.consultButton,
.profileButton,
.quota {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fafaf8;
}

.consultButton {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.profileButton {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.quota {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
}

.chat {
  overflow-y: auto;
  padding: 18px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.quickReplies {
  display: none;
  gap: 7px;
  padding: 6px 14px 10px;
  overflow-x: auto;
  border-top: 1px solid rgba(221, 216, 208, 0.5);
  background: rgba(255, 255, 255, 0.94);
}

.quickReplies.show {
  display: flex;
}

.quickReplies button {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--ink);
  background: #fbfbfa;
  font-size: 12px;
  font-weight: 750;
}

.turn {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 94%;
}

.turn.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.turn.coach {
  align-self: flex-start;
}

.turn.safety {
  align-self: stretch;
  max-width: none;
}

.avatar,
.miniAvatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: #191919;
  font-size: 14px;
  font-weight: 700;
  background-size: cover;
  background-position: center;
  user-select: none;
}

.miniAvatar {
  width: 30px;
  height: 30px;
  color: #142218;
  background: var(--user);
  border: 1px solid #d9eadf;
}

.userAvatar {
  color: #142218;
  background: var(--user);
  border: 1px solid #d9eadf;
}

.coachAvatar {
  background: #191919;
}

.bubble {
  min-width: 0;
  max-width: 100%;
  border-radius: 8px;
  padding: 12px 13px;
  line-height: 1.55;
  font-size: 16px;
  word-break: break-word;
}

.bubble p {
  margin: 4px 0 0;
}

.turn.coach .bubble {
  background: var(--coach);
  color: #fff;
}

.turn.user .bubble {
  background: var(--user);
  color: #142218;
  border: 1px solid #d9eadf;
}

.turn.safety .bubble {
  background: #fff3f0;
  color: #40110b;
  border: 1px solid #f0cbc3;
}

.turn.guide .bubble {
  background: #fbfaf7;
  color: var(--ink);
  border: 1px solid var(--line);
}

.speaker {
  display: block;
  color: inherit;
  opacity: 0.62;
  font-size: 12px;
  line-height: 1.2;
}

.sceneBubble p {
  margin-bottom: 12px;
  font-weight: 700;
}

.sceneChoices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.sceneChoices button {
  min-height: 66px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 650;
  text-align: left;
  display: grid;
  align-content: center;
  gap: 5px;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.sceneChoices button:hover {
  transform: translateY(-1px);
}

.sceneChoices button:active {
  transform: translateY(0);
}

.sceneChoices button span {
  font-size: 15px;
  line-height: 1.15;
}

.sceneChoices button small {
  color: inherit;
  opacity: 0.62;
  font-size: 11px;
  line-height: 1.25;
}

.turn.guide .sceneChoices button {
  color: var(--ink);
  border-color: #d6d0c5;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 249, 245, 0.98)),
    #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.turn.guide .sceneChoices button:hover {
  border-color: #b9ad9b;
  background: #fff;
}

.turn.guide .sceneChoices button.fixed {
  border-color: #d6bf7f;
  background: #fff8e6;
}

.turn.guide .sceneChoices button.fixed small {
  color: #7a5a18;
}

.typingDots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-width: 40px;
  height: 20px;
}

.typingDots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.45;
  animation: typingPulse 1s infinite ease-in-out;
}

.typingDots span:nth-child(2) {
  animation-delay: 0.14s;
}

.typingDots span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-4px);
    opacity: 0.9;
  }
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px 14px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

textarea,
input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: #fbfbfa;
}

textarea {
  max-height: 128px;
  resize: none;
  padding: 11px 12px;
  line-height: 1.4;
}

input[type="text"] {
  min-height: 44px;
  padding: 0 12px;
}

textarea:focus,
input[type="text"]:focus {
  border-color: #ada69c;
  background: #fff;
}

.send {
  width: 70px;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-weight: 650;
}

.send:disabled {
  cursor: default;
  background: #9b9b96;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
}

.sheet.open {
  display: block;
}

.scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
}

.sheetPanel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 10px 16px max(18px, env(safe-area-inset-bottom));
  border-radius: 8px 8px 0 0;
  background: #fff;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.18);
}

.sheetHandle {
  width: 38px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: #d7d2ca;
}

.sheetHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.sheetHead h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.iconButton {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 22px;
  line-height: 1;
}

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.plan {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  color: var(--ink);
  background: #fbfbfa;
}

.plan.selected {
  border-color: var(--gold);
  background: #fffaf0;
}

.plan span {
  font-size: 14px;
}

.plan strong {
  font-size: 26px;
  line-height: 1;
}

.plan small {
  color: var(--muted);
  font-size: 12px;
}

.paymentButtons {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.pay {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
}

.pay.wechat {
  background: var(--green);
}

.pay.alipay {
  background: var(--blue);
}

.secondaryConsult {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 650;
}

.consultIntro {
  min-height: 72px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfaf7;
  font-size: 15px;
  line-height: 1.55;
}

.consultIntro.isTyping {
  display: flex;
  align-items: center;
  color: var(--muted);
}

.qrBox {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 16px auto 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: #fff;
  font-size: 14px;
}

.qrGrid {
  position: absolute;
  inset: 14px;
  opacity: 0.8;
  background:
    linear-gradient(90deg, #1b1b1b 10px, transparent 10px 20px) 0 0 / 40px 40px,
    linear-gradient(#1b1b1b 10px, transparent 10px 20px) 0 0 / 40px 40px,
    linear-gradient(90deg, transparent 24px, #1b1b1b 24px 34px, transparent 34px) 0 0 / 52px 52px;
}

.qrBox span {
  position: relative;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.wechatLine {
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fbfbfa;
}

.wechatLine span {
  color: var(--muted);
  font-size: 13px;
}

.wechatLine strong {
  font-size: 16px;
  word-break: break-all;
}

.copyButton {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 700;
}

.reportBody {
  display: grid;
  gap: 10px;
}

.reportHero,
.reportBlock {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfaf7;
  font-size: 15px;
  line-height: 1.6;
}

.reportHero {
  background: #181818;
  color: #fff;
}

.reportHero span,
.reportConflict span {
  display: block;
  margin-bottom: 5px;
  opacity: 0.68;
  font-size: 12px;
}

.reportHero strong {
  display: block;
  font-size: 18px;
  line-height: 1.35;
}

.reportHero p,
.reportConflict p {
  margin: 8px 0 0;
}

.reportBlock strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.reportKeywordCloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reportKeywordCloud span {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #302b20;
  background: #fff4d6;
  font-size: 13px;
  font-weight: 700;
}

.reportKeywordCloud small {
  margin-left: 5px;
  color: var(--muted);
}

.reportPattern {
  display: grid;
  gap: 8px;
}

.reportPattern div {
  position: relative;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.reportPattern div:not(:last-child)::after {
  content: "↓";
  position: absolute;
  right: 12px;
  bottom: -17px;
  color: var(--muted);
  font-size: 14px;
}

.reportPattern span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.reportPattern strong {
  font-size: 14px;
}

.reportConflict {
  padding: 13px;
  border: 1px solid #e3c174;
  border-radius: 8px;
  background: #fff8e6;
  line-height: 1.6;
}

.reportConflict strong {
  font-size: 16px;
}

.reportAnswerStyle,
.reportQuestions {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfa;
}

.reportAnswerStyle {
  display: grid;
  gap: 9px;
}

.reportAnswerStyle > strong {
  font-size: 14px;
}

.reportAnswerStyle div {
  padding: 9px 10px;
  border: 1px solid rgba(221, 216, 208, 0.78);
  border-radius: 8px;
  background: #fff;
}

.reportAnswerStyle span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reportAnswerStyle strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.reportAnswerStyle p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.reportQuestions strong {
  display: block;
  margin-bottom: 8px;
}

.reportQuestions ol {
  margin: 0;
  padding-left: 20px;
  line-height: 1.7;
}

.reportActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.reportConsult,
.reportPay {
  min-height: 46px;
  border-radius: 8px;
  font-weight: 700;
}

.reportConsult {
  border: 0;
  color: #fff;
  background: var(--green);
}

.reportPay {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.profileStats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.profileStats div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  align-content: center;
  gap: 6px;
  background: #fbfbfa;
}

.profileStats strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  word-break: break-word;
}

.profileStats span {
  color: var(--muted);
  font-size: 12px;
}

.profileReportPanel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfa;
}

.profileReportPanel span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.profileReportPanel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.profileReportPanel button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 850;
  background: var(--ink);
  cursor: pointer;
}

.memoryPanel {
  margin-bottom: 14px;
  padding: 12px 13px;
  border: 1px solid #e2cf9c;
  border-radius: 8px;
  background: #fff9e9;
}

.memoryPanel span {
  display: block;
  margin-bottom: 6px;
  color: #765210;
  font-size: 12px;
  font-weight: 700;
}

.memoryEmpty {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.memoryCards {
  display: grid;
  gap: 9px;
}

.memoryCard {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(118, 82, 16, 0.2);
  border-radius: 8px;
  background: #fffdf6;
}

.memoryCard span {
  display: inline-block;
  margin-bottom: 4px;
  color: #765210;
  font-size: 11px;
  font-weight: 800;
}

.memoryCard strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.memoryCard p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.memoryActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.memoryActions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  background: #fff;
  cursor: pointer;
}

.memoryActions button:first-child {
  border-color: var(--ink);
  color: #fff;
  background: var(--ink);
}

.memoryActions button:last-child {
  border-color: #cfc8bd;
  color: var(--ink);
  background: #f2f0eb;
}

.confirmLayer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.confirmLayer.open {
  opacity: 1;
  pointer-events: auto;
}

.confirmScrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.32);
}

.confirmPanel {
  position: relative;
  width: min(360px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.confirmPanel h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 18px;
}

.confirmPanel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.confirmActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.confirmActions button {
  min-height: 40px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.confirmCancel {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.confirmDelete {
  border: 0;
  color: #fff;
  background: #171717;
}

.invitePanel {
  margin-bottom: 14px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfa;
}

.invitePanel > span {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.inviteRedeem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inviteRedeem input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  letter-spacing: 0;
  background: var(--paper);
}

.inviteRedeem button {
  min-width: 72px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  color: var(--paper);
  font-weight: 800;
  background: var(--ink);
  cursor: pointer;
}

.invitePanel p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--ink);
  font-size: 14px;
}

.field > span {
  color: var(--muted);
  font-size: 13px;
}

.avatarChoices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.avatarChoices button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fbfbfa;
  font-weight: 700;
}

.avatarChoices button.selected {
  border-color: var(--gold);
  background: #fff7df;
}

.uploadButton,
.saveProfile {
  min-height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 650;
}

.uploadButton {
  border: 1px dashed #bbb4aa;
  color: var(--ink);
  background: #fbfbfa;
}

.uploadButton input {
  display: none;
}

.saveProfile {
  width: 100%;
  margin-top: 14px;
  border: 0;
  color: #fff;
  background: var(--ink);
}

.fineprint {
  min-height: 18px;
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (min-width: 720px) {
  body {
    display: grid;
    place-items: center;
    padding: 28px;
  }

  .shell {
    height: min(860px, calc(100dvh - 56px));
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .openingArt,
  .openingMark,
  .openingText {
    animation: none;
  }

  .openingMark,
  .openingText {
    opacity: 1;
    transform: none;
  }
}
