:root {
  color-scheme: dark;
  --ink: #f5f1e8;
  --muted: #aeb8ad;
  --soft: rgba(245, 241, 232, 0.68);
  --line: rgba(245, 241, 232, 0.14);
  --bg: #101513;
  --panel: rgba(255, 255, 255, 0.065);
  --panel-strong: rgba(255, 255, 255, 0.11);
  --gold: #d5aa55;
  --jade: #65b69c;
  --clay: #d07852;
  --blue: #7aa7d9;
  --violet: #a98adf;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  font-family:
    "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at 50% 25%, rgba(230, 216, 178, 0.24) 0 7%, rgba(99, 131, 112, 0.14) 18%, rgba(16, 21, 19, 0.02) 38%),
    linear-gradient(145deg, #080b0a 0%, #111715 48%, #070a09 100%);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 50% 23%, rgba(238, 224, 184, 0.2) 0 9%, rgba(87, 120, 101, 0.12) 24%, rgba(9, 13, 12, 0) 47%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(9, 13, 12, 0.44));
  box-shadow:
    0 0 0 1px rgba(245, 241, 232, 0.06),
    0 24px 80px rgba(0, 0, 0, 0.34),
    inset 0 0 90px rgba(245, 241, 232, 0.025);
  overflow-x: hidden;
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(245, 241, 232, 0.055), transparent 10%, transparent 90%, rgba(245, 241, 232, 0.055)),
    linear-gradient(180deg, rgba(245, 241, 232, 0.04), transparent 10%, transparent 92%, rgba(245, 241, 232, 0.035));
  opacity: 0.72;
  z-index: 0;
}

.page {
  display: none;
  min-height: 100vh;
  padding: 22px 18px 18px;
  position: relative;
  width: 100%;
  overflow-x: hidden;
  scrollbar-width: none;
  z-index: 1;
}

.page::-webkit-scrollbar,
.app-shell::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

.page-active {
  display: flex;
  flex-direction: column;
}

.topbar,
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.chat-page .chat-header {
  min-height: 76px;
  margin: -8px 0 0;
  padding: 8px 0 16px;
  cursor: pointer;
  touch-action: none;
}

.chat-page .chat-header::before {
  content: "";
  position: absolute;
  inset: -12px -18px -10px;
  border-radius: 0 0 24px 24px;
}

.topbar {
  align-items: flex-start;
  padding-top: 28px;
}

.settings-drawer-tab {
  position: fixed;
  left: max(8px, calc(50% - 252px));
  top: 82px;
  z-index: 9;
  width: 10px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(245, 241, 232, 0.12);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background:
    linear-gradient(180deg, rgba(79, 160, 255, 0.36), rgba(245, 241, 232, 0.12)),
    rgba(20, 26, 24, 0.82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: none;
}

.topbar > div,
.chat-title,
.detail-panel,
.guide-block,
.site-footer {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.brand-title {
  margin: 0;
  font-size: 64px;
  line-height: 0.92;
  letter-spacing: 0;
  color: var(--ink);
}

.brand-subtitle {
  margin: 12px 0 0;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.45;
}

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.06;
  letter-spacing: 0;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(245, 241, 232, 0.86);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  cursor: pointer;
  flex: 0 0 auto;
}

.language-toggle {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 78px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.contact-control {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  width: min(104px, 32vw);
  min-height: 44px;
  margin-top: 54px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.035);
}

.contact-control.is-search {
  width: min(var(--search-grow, 150px), 52vw);
  grid-template-columns: minmax(74px, 1fr) minmax(74px, 1fr);
}

.contact-mode-button,
.contact-cycle-button {
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.contact-mode-button {
  min-width: 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.contact-control.is-search .contact-mode-button {
  justify-content: flex-start;
  padding: 0 10px 0 14px;
  text-align: left;
}

.contact-mode-button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-search-input {
  display: none;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.contact-control.is-search #contactModeText {
  display: none;
}

.contact-control.is-search .contact-search-input {
  display: block;
}

.contact-cycle-button {
  display: none;
  place-items: center;
  border-left: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(208, 83, 83, 0.84), rgba(156, 45, 55, 0.74));
  color: #fff4ef;
  min-width: 74px;
}

.contact-control.is-search .contact-cycle-button {
  display: grid;
}

.search-icon {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
  opacity: 0.9;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: -6px;
  bottom: -3px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.icon-grid {
  width: 18px;
  height: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.icon-grid::before,
.icon-grid::after,
.icon-grid span {
  content: "";
}

.icon-grid,
.icon-grid::before,
.icon-grid::after {
  background:
    radial-gradient(circle at 2px 2px, currentColor 0 2px, transparent 2.5px),
    radial-gradient(circle at 16px 2px, currentColor 0 2px, transparent 2.5px),
    radial-gradient(circle at 2px 16px, currentColor 0 2px, transparent 2.5px),
    radial-gradient(circle at 16px 16px, currentColor 0 2px, transparent 2.5px);
}

.orbit-section {
  margin: 28px 0 0;
  position: relative;
  width: 100%;
}

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

.spirit-rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 38px calc((100% - 112px) / 2) 46px;
  scrollbar-width: none;
  cursor: grab;
  width: 100%;
}

.spirit-rail::-webkit-scrollbar {
  display: none;
}

.spirit-button {
  width: 112px;
  min-width: 112px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  scroll-snap-align: center;
  cursor: pointer;
  transform: scale(var(--scale, 0.74));
  opacity: var(--opacity, 0.56);
  transition: transform 160ms ease, opacity 160ms ease, filter 160ms ease;
  filter: blur(var(--blur, 0.8px));
}

.spirit-button.is-active {
  filter: blur(0);
}

.portrait {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.34), transparent 22%),
    linear-gradient(145deg, var(--tone-a), var(--tone-b));
  border: 0;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.22),
    inset 0 0 36px rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.avatar-art {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  display: block;
}

.portrait-taiji .avatar-art {
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 25%, #101513 0 8px, transparent 9px),
    radial-gradient(circle at 50% 75%, #f5f1e8 0 8px, transparent 9px),
    radial-gradient(circle at 50% 25%, #f5f1e8 0 36px, transparent 37px),
    radial-gradient(circle at 50% 75%, #101513 0 36px, transparent 37px),
    linear-gradient(90deg, #f5f1e8 0 50%, #101513 50% 100%);
  border: 2px solid rgba(245, 241, 232, 0.9);
}

.portrait-self .avatar-art,
.portrait-male .avatar-art,
.portrait-female .avatar-art {
  width: 62px;
  height: 76px;
  opacity: 0.62;
  filter: blur(2px);
  background:
    radial-gradient(circle at 50% 22%, rgba(245, 241, 232, 0.9) 0 15px, transparent 16px),
    linear-gradient(180deg, transparent 34%, rgba(245, 241, 232, 0.72) 35% 100%);
  clip-path: polygon(50% 0, 72% 18%, 76% 38%, 94% 100%, 6% 100%, 24% 38%, 28% 18%);
}

.spirit-button.is-active .portrait-self .avatar-art {
  opacity: 0.9;
  filter: blur(0.8px);
}

.portrait-female .avatar-art {
  border-radius: 42% 42% 34% 34%;
  background:
    radial-gradient(circle at 50% 22%, rgba(245, 241, 232, 0.92) 0 14px, transparent 15px),
    radial-gradient(ellipse at 50% 32%, rgba(30, 20, 30, 0.42) 0 28px, transparent 29px),
    linear-gradient(180deg, transparent 37%, rgba(245, 241, 232, 0.7) 38% 100%);
}

.portrait-buddha .avatar-art {
  border-radius: 50% 50% 42% 42%;
  background:
    radial-gradient(circle at 50% 17%, rgba(245, 241, 232, 0.72) 0 4px, transparent 5px),
    radial-gradient(circle at 50% 31%, rgba(245, 241, 232, 0.92) 0 22px, transparent 23px),
    radial-gradient(ellipse at 50% 73%, rgba(245, 241, 232, 0.72) 0 31px, transparent 32px);
}

.portrait-sage .avatar-art,
.portrait-socrates .avatar-art {
  background:
    radial-gradient(circle at 50% 28%, rgba(245, 241, 232, 0.92) 0 18px, transparent 19px),
    radial-gradient(ellipse at 50% 70%, rgba(245, 241, 232, 0.72) 0 32px, transparent 33px);
}

.portrait-socrates .avatar-art::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 36px;
  width: 30px;
  height: 18px;
  border-radius: 0 0 16px 16px;
  background: rgba(245, 241, 232, 0.34);
}

.portrait::after {
  content: "";
  width: 46px;
  height: 28px;
  position: absolute;
  bottom: 22px;
  border-radius: 50% 50% 44% 44%;
  background: rgba(255, 255, 255, 0.18);
}

.portrait-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.portrait-image .avatar-art,
.portrait-image::after {
  display: none;
}

.portrait-private {
  filter: blur(10px) saturate(62%) brightness(0.86);
}

.portrait-private::before {
  content: "";
  position: absolute;
  inset: -12px;
  background:
    radial-gradient(circle at 45% 35%, rgba(245, 241, 232, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(101, 182, 156, 0.5), rgba(64, 91, 129, 0.48));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.status-ring {
  box-shadow:
    0 0 18px 5px var(--status-ring),
    0 0 44px 17px var(--status-ring-fade),
    0 18px 42px rgba(0, 0, 0, 0.28),
    inset 0 0 36px rgba(255, 255, 255, 0.1);
}

.status-ring-blind {
  --status-ring: rgba(226, 90, 90, 0.42);
  --status-ring-fade: rgba(226, 90, 90, 0.12);
}

.status-ring-soul {
  --status-ring: rgba(88, 169, 255, 0.42);
  --status-ring-fade: rgba(88, 169, 255, 0.12);
}

.status-ring-human {
  --status-ring: rgba(224, 183, 78, 0.42);
  --status-ring-fade: rgba(224, 183, 78, 0.12);
}

.glyph {
  position: relative;
  z-index: 1;
  font-size: 42px;
  font-weight: 700;
}

.portrait .glyph {
  display: none;
}

.spirit-name {
  display: block;
  margin-top: 12px;
  font-size: 17px;
  white-space: nowrap;
}

.spirit-count {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.spirit-detail {
  margin-top: 4px;
  padding: 24px 0 0;
  flex: 1;
  position: relative;
  z-index: 1;
}

.detail-panel {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.soul-public-panel {
  display: grid;
  gap: 12px;
}

.soul-avatar-editor {
  width: 118px;
  height: 118px;
  border: 1px solid rgba(245, 241, 232, 0.24);
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 28%, rgba(245, 241, 232, 0.18), transparent 44%),
    rgba(255, 255, 255, 0.045);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.3),
    inset 0 0 28px rgba(245, 241, 232, 0.08);
  cursor: pointer;
}

.soul-avatar-editor .portrait {
  width: 112px;
  height: 112px;
}

.detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.detail-title {
  margin: 18px 0 10px;
  font-size: 32px;
  line-height: 1.1;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.detail-title-row .detail-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-follow-button {
  flex: 0 0 auto;
  margin-top: 8px;
}

.follow-name-button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 6px 12px;
  color: rgba(245, 241, 232, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.045)),
    color-mix(in srgb, var(--chat-tone-a, #d5aa55) 14%, transparent);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.follow-name-button.is-following {
  color: rgba(245, 241, 232, 0.74);
  background: rgba(255, 255, 255, 0.07);
}

.editable-title,
[data-edit],
[data-edit-public-name] {
  cursor: text;
}

.soul-page [data-edit],
.soul-page [data-edit-public-name] {
  border-radius: 10px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.soul-page [data-edit]:hover,
.soul-page [data-edit-public-name]:hover {
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.detail-copy {
  margin: 0 0 12px;
  color: var(--soft);
  font-size: 16px;
  line-height: 1.75;
}

.primary-action {
  width: 100%;
  height: 54px;
  margin-top: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    color-mix(in srgb, var(--chat-tone-a, #d5aa55) 6%, transparent);
  color: rgba(245, 241, 232, 0.88);
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-action:active {
  transform: scale(0.985);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06)),
    color-mix(in srgb, var(--chat-tone-a, #d5aa55) 9%, transparent);
}

.chat-page {
  height: 100vh;
  padding-bottom: 12px;
  overflow-y: auto;
  scrollbar-width: none;
  background:
    linear-gradient(180deg, rgba(8, 11, 10, 0.74), rgba(8, 11, 10, 0.96) 58%),
    radial-gradient(circle at 50% 21%, color-mix(in srgb, var(--chat-tone-a, #d5aa55) 30%, transparent) 0 9%, rgba(220, 209, 178, 0.14) 21%, transparent 46%),
    linear-gradient(145deg, #080b0a, #111715);
}

.chat-page::-webkit-scrollbar {
  display: none;
}

.chat-backdrop {
  position: absolute;
  inset: 20px 18px auto;
  height: 280px;
  pointer-events: auto;
  opacity: 0.48;
  filter: blur(0.2px);
}

.chat-backdrop::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 50% 44%, rgba(245, 241, 232, 0.36), rgba(206, 187, 132, 0.18) 31%, rgba(140, 157, 128, 0.12) 48%, rgba(16, 21, 19, 0) 72%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
  box-shadow:
    inset 0 0 82px rgba(245, 241, 232, 0.13),
    0 0 80px rgba(222, 199, 142, 0.1);
}

.chat-backdrop::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 52px;
  width: 132px;
  height: 132px;
  transform: translateX(-50%);
}

.chat-page.image-backdrop .chat-backdrop {
  opacity: 0.76;
}

.chat-page.image-backdrop .chat-backdrop::before {
  animation: spiritHaloFloat 7s ease-in-out infinite;
}

.chat-page.image-backdrop .chat-backdrop::after {
  top: 14px;
  width: 246px;
  height: 246px;
  border-radius: 50%;
  background-image: var(--spirit-image);
  background-size: cover;
  background-position: center;
  box-shadow:
    0 0 52px rgba(235, 205, 139, 0.16),
    inset 0 0 32px rgba(255, 255, 255, 0.12);
  animation: spiritImageFloat 6.8s ease-in-out infinite;
}

.chat-page.image-backdrop .soul-figure {
  opacity: 0;
}

.chat-bg-taiji .chat-backdrop::after {
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 25%, #101513 0 14px, transparent 15px),
    radial-gradient(circle at 50% 75%, #f5f1e8 0 14px, transparent 15px),
    radial-gradient(circle at 50% 25%, #f5f1e8 0 66px, transparent 67px),
    radial-gradient(circle at 50% 75%, #101513 0 66px, transparent 67px),
    linear-gradient(90deg, #f5f1e8 0 50%, #101513 50% 100%);
}

.chat-bg-self .chat-backdrop::after,
.chat-bg-male .chat-backdrop::after,
.chat-bg-female .chat-backdrop::after {
  width: 128px;
  height: 168px;
  top: 46px;
  opacity: 0.72;
  filter: blur(4px);
  background:
    radial-gradient(circle at 50% 19%, rgba(245, 241, 232, 0.86) 0 32px, transparent 33px),
    linear-gradient(180deg, transparent 31%, rgba(245, 241, 232, 0.64) 32% 100%);
  clip-path: polygon(50% 0, 72% 18%, 76% 38%, 94% 100%, 6% 100%, 24% 38%, 28% 18%);
}

.chat-bg-buddha .chat-backdrop::after {
  background:
    radial-gradient(circle at 50% 14%, rgba(245, 241, 232, 0.75) 0 9px, transparent 10px),
    radial-gradient(circle at 50% 33%, rgba(245, 241, 232, 0.92) 0 44px, transparent 45px),
    radial-gradient(ellipse at 50% 78%, rgba(245, 241, 232, 0.72) 0 62px, transparent 63px);
}

.chat-bg-sage .chat-backdrop::after,
.chat-bg-socrates .chat-backdrop::after {
  background:
    radial-gradient(circle at 50% 30%, rgba(245, 241, 232, 0.92) 0 38px, transparent 39px),
    radial-gradient(ellipse at 50% 77%, rgba(245, 241, 232, 0.7) 0 64px, transparent 65px);
}

.soul-figure {
  position: absolute;
  left: 50%;
  top: 104px;
  width: 252px;
  height: 360px;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0.58;
  filter: blur(2.5px);
  z-index: 0;
}

.soul-figure::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 98px;
  height: 108px;
  border-radius: 50%;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 43% 28%, rgba(255, 255, 255, 0.09), transparent 18%),
    linear-gradient(145deg, rgba(8, 10, 9, 0.94), rgba(20, 25, 22, 0.84));
  box-shadow: 0 0 54px rgba(236, 222, 185, 0.12);
}

.soul-figure span {
  position: absolute;
  left: 50%;
  top: 82px;
  width: 236px;
  height: 260px;
  transform: translateX(-50%);
  border-radius: 48% 48% 20% 20%;
  background:
    radial-gradient(circle at 48% 0%, rgba(255, 255, 255, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(6, 8, 7, 0.98), rgba(20, 24, 21, 0.78));
  clip-path: polygon(50% 0, 72% 9%, 82% 28%, 95% 54%, 100% 77%, 82% 90%, 64% 82%, 50% 93%, 36% 82%, 18% 90%, 0 77%, 5% 54%, 18% 28%, 28% 9%);
}

.soul-figure::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 218px;
  width: 250px;
  height: 80px;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 28% 50%, rgba(6, 8, 7, 0.96) 0 36%, transparent 37%),
    radial-gradient(ellipse at 72% 50%, rgba(6, 8, 7, 0.96) 0 36%, transparent 37%),
    radial-gradient(ellipse at 50% 58%, rgba(16, 19, 17, 0.88) 0 42%, transparent 43%);
}

.chat-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: right;
  margin-left: auto;
}

.chat-title {
  min-width: 0;
}

.chat-name-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.chat-title strong {
  display: block;
  font-size: 18px;
}

.chat-name-button,
.editable-soul-name {
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: inherit;
  font-weight: 800;
}

.chat-name-button {
  display: block;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-follow-button {
  flex: 0 0 auto;
  padding: 5px 10px;
}

.editable-soul-name {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.1;
  text-align: left;
}

.editable-title {
  cursor: pointer;
}

[data-edit] {
  cursor: pointer;
}

.chat-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.status-mini {
  display: inline-block;
  margin-top: 7px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  cursor: default;
}

.chat-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}

.chat-avatar .portrait {
  width: 48px;
  height: 48px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 0 18px rgba(255, 255, 255, 0.12);
}

.chat-avatar .avatar-art {
  transform: scale(0.43);
}

.chat-avatar .portrait::after {
  width: 20px;
  height: 12px;
  bottom: 9px;
}

.chat-messages {
  height: min(58vh, calc(100vh - 172px));
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 30px 18px 18px 0;
  position: relative;
  z-index: 1;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  touch-action: pan-y;
}

.chat-messages::-webkit-scrollbar {
  display: none;
}

.chat-messages:not(.text-visible) .message:not(.voice-message) {
  display: none;
}

.chat-messages:not(.text-visible)::after {
  content: attr(data-empty-text);
  align-self: center;
  margin-top: 42vh;
  color: rgba(245, 241, 232, 0.46);
  font-size: 13px;
}

.chat-messages.has-voice:not(.text-visible)::after {
  display: none;
}

.chat-history-slider {
  display: none;
  position: absolute;
  z-index: 3;
  right: 2px;
  top: 126px;
  width: 16px;
  height: min(54vh, calc(100vh - 210px));
  min-height: 260px;
  margin: 0;
  padding: 0;
  accent-color: rgba(208, 83, 83, 0.9);
  background: transparent;
  opacity: 0.74;
  writing-mode: vertical-lr;
  direction: rtl;
  cursor: ns-resize;
}

.chat-history-slider:disabled {
  opacity: 0.18;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-width: 86%;
}

.message.ai {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
  align-items: flex-end;
}

.bubble {
  max-width: 100%;
  padding: 14px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  line-height: 1.65;
  font-size: 15px;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
}

.bubble.ai {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(245, 241, 232, 0.9);
}

.bubble.user {
  background:
    linear-gradient(180deg, rgba(213, 170, 85, 0.18), rgba(213, 170, 85, 0.07)),
    rgba(255, 255, 255, 0.035);
  color: rgba(255, 244, 216, 0.92);
  border-color: rgba(246, 213, 144, 0.2);
}

.voice-bubble {
  min-width: 132px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(245, 241, 232, 0.9);
  background: rgba(255, 255, 255, 0.07);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  cursor: pointer;
}

.voice-bubble.user {
  color: rgba(255, 244, 216, 0.92);
  background:
    linear-gradient(180deg, rgba(213, 170, 85, 0.18), rgba(213, 170, 85, 0.07)),
    rgba(255, 255, 255, 0.035);
  border-color: rgba(246, 213, 144, 0.2);
}

.voice-bubble strong {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.72;
}

.voice-wave {
  width: 22px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.voice-wave i {
  width: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.72;
}

.voice-wave i:nth-child(1) {
  height: 7px;
}

.voice-wave i:nth-child(2) {
  height: 13px;
}

.voice-wave i:nth-child(3) {
  height: 18px;
}

.voice-bubble.is-playing .voice-wave i {
  animation: voiceBars 420ms ease-in-out infinite alternate;
}

.voice-bubble.is-playing .voice-wave i:nth-child(2) {
  animation-delay: 90ms;
}

.voice-bubble.is-playing .voice-wave i:nth-child(3) {
  animation-delay: 180ms;
}

.message-actions {
  display: flex;
  gap: 6px;
  opacity: 0.72;
}

.message-actions button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.message-actions button:hover {
  color: var(--ink);
  background: var(--panel-strong);
}

.like-icon,
.dislike-icon,
.share-icon {
  width: 14px;
  height: 14px;
  position: relative;
  display: block;
}

.like-icon::before,
.dislike-icon::before {
  content: "";
  position: absolute;
  inset: 2px 3px 1px 4px;
  border: 2px solid currentColor;
  border-left: 0;
  border-bottom-right-radius: 5px;
  transform: rotate(-10deg);
}

.like-icon::after,
.dislike-icon::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 6px;
  width: 4px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
}

.dislike-icon {
  transform: rotate(180deg);
}

.share-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 10px;
  height: 2px;
  background: currentColor;
  transform: rotate(-28deg);
}

.share-icon::after {
  content: "";
  position: absolute;
  right: 1px;
  top: 1px;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}


.composer {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 0 12px;
  border-top: 1px solid var(--line);
  background: rgba(16, 21, 19, 0.42);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  z-index: 2;
}

.composer::before {
  content: "";
  position: absolute;
  left: 34px;
  right: -18px;
  bottom: -8px;
  height: 112px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(72, 169, 255, 0.78), rgba(72, 204, 255, 0.28) 44%, rgba(80, 130, 255, 0.1) 62%, transparent 78%);
  filter: blur(20px);
  transform: scale(0.94);
  transition: opacity 160ms ease, transform 160ms ease;
}

.composer.is-recording::before {
  opacity: 1;
  animation: voiceGlow 980ms ease-in-out infinite alternate;
}

.mode-switch {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  flex: 0 0 auto;
}

.mode-button {
  width: 41px;
  height: 46px;
  border: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  line-height: 1;
  flex-direction: column;
  gap: 3px;
}

.mode-button.is-active {
  color: rgba(245, 241, 232, 0.92);
  background: rgba(255, 255, 255, 0.11);
}

.keyboard-icon,
.voice-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
}

.keyboard-icon::before {
  content: "";
  position: absolute;
  inset: 3px 1px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.keyboard-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 6px;
  height: 2px;
  background: currentColor;
  box-shadow: -4px -5px 0 -0.5px currentColor, 0 -5px 0 -0.5px currentColor, 4px -5px 0 -0.5px currentColor;
}

.voice-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 7px;
}

.voice-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 10px;
  height: 6px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  box-shadow: 4px 6px 0 -3px currentColor, -4px 6px 0 -3px currentColor;
}

.voice-button {
  min-width: 0;
  flex: 1;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  color: rgba(245, 241, 232, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.035);
  font-weight: 700;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  z-index: 1;
  overflow: hidden;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.voice-button.is-recording {
  color: rgba(245, 241, 232, 0.96);
  background:
    linear-gradient(90deg, rgba(46, 137, 255, 0.38), rgba(67, 218, 255, 0.26)),
    rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 1px rgba(171, 224, 255, 0.28), 0 0 42px rgba(63, 170, 255, 0.42);
}

.voice-button.is-recording::before,
.voice-button.is-recording::after {
  content: "";
  position: absolute;
  inset: 8px 22%;
  border-radius: 999px;
  border: 1px solid rgba(245, 241, 232, 0.58);
  animation: voiceRing 920ms ease-out infinite;
}

.voice-button.is-recording::after {
  animation-delay: 320ms;
}

.composer .text-input {
  min-width: 0;
  flex: 1;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  outline: none;
}

.composer[data-mode="keyboard"] .mode-switch {
  width: 42px;
  flex: 0 0 42px;
}

.mode-text {
  max-width: 34px;
  overflow: hidden;
  color: currentColor;
  text-overflow: clip;
  white-space: nowrap;
}

.composer[data-mode="keyboard"] .text-input {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
}

.composer .send-button {
  width: 72px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: rgba(245, 241, 232, 0.9);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  font-weight: 700;
  cursor: pointer;
}

.composer[data-mode="keyboard"] .send-button {
  width: 56px;
  flex: 0 0 56px;
}

.composer[data-mode="keyboard"] {
  gap: 6px;
}

.guide-section {
  display: grid;
  gap: 12px;
  padding: 22px 0 44px;
  position: relative;
  z-index: 1;
}

.guide-block {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.guide-block h3 {
  margin: 0 0 9px;
  font-size: 18px;
  letter-spacing: 0;
}

.guide-block p {
  margin: 0;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.75;
}

.intro-folds {
  display: grid;
  gap: 8px;
}

.fold-text {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.fold-text:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.fold-text summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.fold-text summary::-webkit-details-marker {
  display: none;
}

.fold-text summary span {
  overflow: hidden;
  color: var(--soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fold-text summary b {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #111715;
  background: var(--ink);
  font-size: 16px;
  line-height: 1;
}

.fold-text[open] summary b {
  transform: rotate(45deg);
}

.fold-text p {
  margin: 10px 0 0;
  color: var(--soft);
  line-height: 1.72;
}

.chat-guide {
  display: grid;
  padding-bottom: 96px;
  overscroll-behavior: contain;
}

.soul-drawer {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  left: 50%;
  padding: 0 18px 24px;
  overflow-y: auto;
  scrollbar-width: none;
  color: rgba(245, 241, 232, 0.92);
  background:
    radial-gradient(circle at 20% 18%, rgba(74, 142, 255, 0.2), transparent 36%),
    linear-gradient(180deg, rgba(13, 18, 17, 0.98), rgba(7, 10, 10, 0.99));
  box-shadow: 22px 0 48px rgba(0, 0, 0, 0.42);
  transform: translateX(calc(-50% - 110%));
  transition: transform 260ms ease;
  pointer-events: none;
}

.soul-drawer::-webkit-scrollbar {
  display: none;
}

.soul-drawer.drawer-open {
  transform: translateX(-50%);
  pointer-events: auto;
}

.soul-drawer .drawer-header {
  min-height: 108px;
  padding: 34px 0 8px;
  position: sticky;
  top: 0;
  z-index: 8;
  cursor: pointer;
  touch-action: pan-x;
  background: linear-gradient(180deg, rgba(12, 17, 16, 0.98), rgba(12, 17, 16, 0.72), transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.soul-drawer .drawer-header::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  width: 32px;
  height: 4px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: rgba(245, 241, 232, 0.22);
}

.soul-drawer #backFromSoul {
  margin-top: 28px;
}

.soul-drawer #soulStatusButton {
  position: fixed;
  right: max(18px, calc(50% - 242px));
  top: 34px;
  z-index: 28;
}

.status-button,
.status-pill,
.status-mini {
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(245, 241, 232, 0.9);
  font-weight: 800;
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
}

.status-button {
  min-width: 76px;
  height: 40px;
  border-radius: 999px;
  cursor: pointer;
}

.status-blind {
  background: rgba(226, 90, 90, 0.22);
}

.status-soul {
  background: rgba(88, 169, 255, 0.22);
}

.status-human {
  background: rgba(224, 183, 78, 0.24);
}

.soul-profile {
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.profile-hero {
  min-height: 256px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    radial-gradient(circle at 50% 18%, rgba(245, 241, 232, 0.22), transparent 38%),
    linear-gradient(145deg, rgba(245, 241, 232, 0.1), rgba(255, 255, 255, 0.02));
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  padding: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.profile-avatar .portrait {
  width: 96px;
  height: 96px;
}

.profile-hero h2 {
  margin: 18px 0 6px;
  font-size: 34px;
}

.profile-hero p {
  margin: 0 0 12px;
  color: var(--soft);
  line-height: 1.6;
}

.section-divider {
  margin: 14px 0 2px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.profile-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  display: grid;
  gap: 6px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

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

.profile-row strong {
  font-weight: 500;
  line-height: 1.55;
}

.profile-module {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.profile-module h3,
.module-head h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.profile-module p {
  margin: 0 0 8px;
  color: var(--soft);
  line-height: 1.65;
}

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

.person-guide-title h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-explain {
  color: var(--muted);
  font-size: 13px;
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.module-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.module-head button,
.module-actions button,
.dynamic-actions button,
.add-button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
  color: rgba(245, 241, 232, 0.86);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  cursor: pointer;
}

.dynamic-strip {
  display: grid;
  gap: 10px;
}

.dynamic-tile {
  min-height: 132px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
}

.dynamic-tile small {
  display: block;
  margin-top: 10px;
  color: rgba(245, 241, 232, 0.58);
  line-height: 1.5;
}

.dynamic-tile img,
.dynamic-tile video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.dynamic-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.followed-dynamic-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.followed-dynamic-card {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  cursor: pointer;
}

.followed-dynamic-card .dynamic-tile {
  min-height: 78px;
  grid-row: span 2;
}

.followed-dynamic-card strong {
  align-self: end;
  font-size: 15px;
}

.followed-dynamic-card p,
.empty-followed {
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.45;
}

.floating-heart {
  position: fixed;
  z-index: 200;
  color: #ff4f6d;
  font-size: 30px;
  line-height: 1;
  pointer-events: none;
  transform: translate(-50%, 0) scale(0.82);
  animation: heartPop 760ms ease-out forwards;
  text-shadow: 0 8px 24px rgba(255, 79, 109, 0.42);
}

@keyframes heartPop {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.68);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -8px) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -72px) scale(1.3);
  }
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.modal-layer.is-open {
  display: grid;
}

.modal-card {
  width: min(100%, 420px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 58px 20px 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045)),
    rgba(16, 21, 19, 0.46);
  box-shadow:
    0 24px 68px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  position: relative;
}

.modal-back {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(245, 241, 232, 0.86);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  cursor: pointer;
}

.modal-card h2 {
  margin: 0 0 8px;
  color: rgba(245, 241, 232, 0.88);
  font-weight: 750;
}

.modal-card p {
  color: rgba(245, 241, 232, 0.58);
  line-height: 1.65;
}

.edit-card {
  display: grid;
  gap: 14px;
}

.edit-textarea {
  width: 100%;
  min-height: 168px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 14px;
  color: rgba(245, 241, 232, 0.92);
  background: rgba(255, 255, 255, 0.07);
  outline: none;
  resize: vertical;
  line-height: 1.65;
  font: inherit;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.edit-textarea:focus {
  border-color: rgba(245, 241, 232, 0.32);
  box-shadow: 0 0 0 3px rgba(245, 241, 232, 0.08);
}

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

.modal-actions button {
  flex: 1;
  min-width: 80px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px;
  color: rgba(245, 241, 232, 0.9);
  background: rgba(255, 255, 255, 0.065);
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
}

.modal-actions .modal-blind {
  background: rgba(226, 90, 90, 0.16);
  border-color: rgba(255, 170, 170, 0.16);
}

.modal-actions .modal-soul {
  background: rgba(88, 169, 255, 0.16);
  border-color: rgba(170, 215, 255, 0.16);
}

.modal-actions .modal-human {
  background: rgba(224, 183, 78, 0.18);
  border-color: rgba(255, 226, 154, 0.18);
}

.modal-actions button:disabled {
  opacity: 0.48;
  cursor: default;
}

.site-footer {
  margin-top: auto;
  padding: 20px 0 4px;
  color: rgba(245, 241, 232, 0.48);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.site-footer p {
  margin: 0 0 6px;
}

.chat-footer {
  padding-bottom: 90px;
}

@keyframes voiceGlow {
  from {
    transform: scale(0.94);
    filter: blur(18px);
  }

  to {
    transform: scale(1.12);
    filter: blur(28px);
  }
}

@keyframes voiceRing {
  from {
    opacity: 0.72;
    transform: scaleX(0.68);
  }

  to {
    opacity: 0;
    transform: scaleX(1.28);
  }
}

@keyframes voiceBars {
  from {
    transform: scaleY(0.55);
    opacity: 0.48;
  }

  to {
    transform: scaleY(1.12);
    opacity: 1;
  }
}

@keyframes spiritImageFloat {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
  }

  50% {
    transform: translateX(-50%) translateY(-10px) scale(1.035);
  }
}

@keyframes spiritHaloFloat {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.9;
  }

  50% {
    transform: translateX(-50%) scale(1.05);
    opacity: 1;
  }
}

@media (min-width: 760px) {
  .app-shell {
    min-height: calc(100vh - 40px);
    margin-block: 20px;
    border: 1px solid rgba(245, 241, 232, 0.045);
    border-radius: 28px;
  }

  .page {
    min-height: calc(100vh - 40px);
  }
}
