/* ============================================================
   睡了么 · design system
   ============================================================ */

:root {
  --ink: #070a18;
  --ink-2: #0b1022;
  --ink-3: #11162c;
  --surface: rgba(255, 255, 255, 0.052);
  --surface-2: rgba(255, 255, 255, 0.085);
  --surface-3: rgba(255, 255, 255, 0.125);
  --line: rgba(255, 255, 255, 0.095);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f7f2e7;
  --text-soft: #d8d4c8;
  --muted: #9699ad;
  --muted-2: #6f7389;
  --moon: #ffe4a3;
  --moon-strong: #ffd276;
  --peach: #ffb59a;
  --lilac: #b9a8ff;
  --aqua: #9de3d4;
  --rose: #ff8f9c;
  --danger: #ff828d;
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Segoe UI",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --shadow-card: 0 22px 50px -28px rgba(0, 0, 0, 0.85);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #040611;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

input,
textarea {
  border: 0;
  outline: 0;
  background: none;
}

textarea {
  resize: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(255, 226, 163, 0.28);
  color: #fff;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite symbol {
  overflow: visible;
}

.is-hidden {
  display: none !important;
}

/* ============================================================
   World / desktop atmosphere
   ============================================================ */

.world {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 72% 8%, rgba(75, 67, 151, 0.25), transparent 60%),
    radial-gradient(ellipse 60% 60% at 16% 90%, rgba(117, 66, 86, 0.16), transparent 65%),
    linear-gradient(160deg, #050711 0%, #070a17 45%, #04050d 100%);
}

.world::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.17) 0.6px, transparent 0.9px);
  background-size: 5px 5px;
  opacity: 0.12;
  mix-blend-mode: soft-light;
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: auroraDrift 18s ease-in-out infinite alternate;
}

.aurora-one {
  top: -16%;
  right: 4%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(143, 121, 255, 0.55), transparent 67%);
}

.aurora-two {
  left: -10%;
  bottom: -25%;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(255, 162, 118, 0.24), transparent 68%);
  animation-delay: -6s;
}

.world-stars {
  position: absolute;
  inset: 0;
}

.world-star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff8e8;
  opacity: 0;
  animation: starPulse var(--dur, 5s) ease-in-out var(--delay, 0s) infinite;
}

.desktop-story {
  position: fixed;
  top: 50%;
  left: max(4vw, calc(50vw - 610px));
  width: 390px;
  transform: translateY(-50%);
  z-index: 1;
}

.desktop-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 14px;
  letter-spacing: 0.16em;
  font-weight: 600;
}

.mini-moon {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(140deg, #fff5d6, var(--moon-strong));
  box-shadow: 0 0 26px rgba(255, 214, 132, 0.4);
}

.mini-moon::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -5px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #060916;
}

.desktop-kicker {
  margin-top: 54px;
  color: rgba(255, 228, 163, 0.62);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.34em;
}

.desktop-story h1 {
  margin-top: 20px;
  font-size: clamp(34px, 3.4vw, 52px);
  line-height: 1.33;
  font-weight: 500;
  letter-spacing: -1.8px;
  color: #fbf5e8;
}

.desktop-sub {
  margin-top: 22px;
  color: rgba(223, 220, 212, 0.52);
  font-size: 14px;
  line-height: 1.9;
}

.desktop-features {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 38px;
  color: rgba(247, 242, 231, 0.62);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.desktop-features i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 228, 163, 0.42);
}

.desktop-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 54px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.desktop-note span {
  width: 26px;
  height: 1px;
  background: rgba(255, 255, 255, 0.22);
}

.phone-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 560px;
  height: 760px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(129, 110, 220, 0.18), transparent 68%);
  filter: blur(30px);
  pointer-events: none;
}

/* ============================================================
   Phone shell
   ============================================================ */

.phone-shell {
  position: relative;
  z-index: 5;
  width: 430px;
  height: min(900px, calc(100dvh - 32px));
  margin: 0 auto;
  filter: drop-shadow(0 42px 70px rgba(0, 0, 0, 0.62));
}

.frame-glow {
  position: absolute;
  inset: -1px;
  border-radius: 47px;
  background: linear-gradient(160deg, rgba(255, 232, 185, 0.22), rgba(255, 255, 255, 0.02) 35%, rgba(164, 147, 255, 0.14));
  pointer-events: none;
}

.app-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 46px;
  background:
    radial-gradient(ellipse 80% 50% at 70% -4%, rgba(112, 93, 193, 0.22), transparent 62%),
    radial-gradient(ellipse 70% 40% at 0% 100%, rgba(255, 160, 120, 0.06), transparent 65%),
    #080b18;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 60px rgba(0, 0, 0, 0.25);
  isolation: isolate;
}

.app-grain {
  position: absolute;
  inset: 0;
  z-index: 80;
  opacity: 0.03;
  pointer-events: none;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.app-stars {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.app-star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff5dc;
  opacity: 0;
  animation: starPulse var(--dur, 6s) ease-in-out var(--delay, 0s) infinite;
}

.boot-screen {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: #080b18;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.boot-screen.is-done {
  opacity: 0;
  visibility: hidden;
}

.boot-moon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(140deg, #fff5d6, var(--moon-strong));
  box-shadow: 0 0 50px rgba(255, 214, 132, 0.35);
  animation: moonFloat 3s ease-in-out infinite;
}

.boot-screen p {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
}

/* ============================================================
   Shared components
   ============================================================ */

.avatar {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.3), transparent 45%),
    linear-gradient(145deg, hsl(var(--hue, 40) 72% 70% / 0.42), hsl(calc(var(--hue, 40) + 45) 56% 52% / 0.2));
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

.avatar-xs {
  width: 30px;
  height: 30px;
  font-size: 14px;
}

.avatar-sm {
  width: 38px;
  height: 38px;
  font-size: 18px;
}

.avatar-md {
  width: 48px;
  height: 48px;
  font-size: 22px;
}

.avatar-lg {
  width: 58px;
  height: 58px;
  font-size: 27px;
}

.avatar-xl {
  width: 82px;
  height: 82px;
  font-size: 38px;
  border-width: 1.5px;
}

.avatar-wrap {
  position: relative;
  display: inline-flex;
  flex: none;
}

.status-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 11px;
  height: 11px;
  border: 2px solid #0b0e1e;
  border-radius: 50%;
  background: var(--muted-2);
}

.status-dot.is-online {
  background: var(--aqua);
  box-shadow: 0 0 9px rgba(157, 227, 212, 0.7);
}

.avatar-btn {
  display: inline-flex;
  padding: 0;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.avatar-btn:active {
  transform: scale(0.94);
}

.icon-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-soft);
  transition: background 0.2s ease, transform 0.2s ease;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn:active {
  transform: scale(0.93);
}

.icon-btn.has-dot {
  position: relative;
}

.icon-btn.has-dot::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--peach);
  box-shadow: 0 0 8px rgba(255, 181, 154, 0.8);
}

.eyebrow {
  color: rgba(255, 228, 163, 0.65);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.section {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.section-title svg {
  width: 17px;
  height: 17px;
  color: var(--moon);
}

.section-sub {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11px;
}

.text-link {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  transition: color 0.2s ease;
}

.text-link svg {
  width: 13px;
  height: 13px;
}

.text-link:active {
  color: var(--text);
}

.pill-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff0c7, var(--moon-strong) 55%, #ffbd77);
  color: #2b2111;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 14px 28px -12px rgba(255, 198, 106, 0.55);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.pill-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.pill-button:active {
  transform: scale(0.96);
  box-shadow: 0 8px 18px -10px rgba(255, 198, 106, 0.5);
}

.pill-button.is-done {
  background: rgba(255, 228, 163, 0.12);
  border: 1px solid rgba(255, 228, 163, 0.22);
  color: var(--moon);
  box-shadow: none;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.15s ease;
}

.ghost-button svg {
  width: 15px;
  height: 15px;
}

.ghost-button:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.09);
}

.ghost-button.accent {
  border-color: rgba(255, 228, 163, 0.22);
  background: rgba(255, 228, 163, 0.08);
  color: var(--moon);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state .empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--moon);
  font-size: 26px;
}

.empty-state strong {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
}

.empty-state p {
  max-width: 230px;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.7;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(43, 33, 17, 0.2);
  border-top-color: #2b2111;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ============================================================
   Auth
   ============================================================ */

.auth-view {
  position: absolute;
  inset: 0;
  z-index: 20;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 22px 24px calc(28px + var(--safe-bottom));
  background:
    radial-gradient(ellipse 80% 45% at 100% 0%, rgba(111, 92, 181, 0.22), transparent 64%),
    linear-gradient(180deg, #0a0d1d 0%, #080b18 55%, #070915 100%);
  scrollbar-width: none;
}

.auth-view::-webkit-scrollbar {
  display: none;
}

.auth-view.is-leaving {
  animation: authOut 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.auth-orbit {
  position: absolute;
  top: -90px;
  right: -140px;
  width: 400px;
  height: 400px;
  pointer-events: none;
  opacity: 0.7;
}

.orbit-ring {
  position: absolute;
  border: 1px solid rgba(255, 228, 163, 0.1);
  border-radius: 50%;
}

.ring-a {
  inset: 30px;
  transform: rotate(-22deg);
}

.ring-b {
  inset: 90px;
  border-color: rgba(185, 168, 255, 0.13);
  transform: rotate(18deg);
}

.orbit-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--moon);
  box-shadow: 0 0 10px rgba(255, 228, 163, 0.8);
}

.dot-a {
  top: 62px;
  left: 110px;
}

.dot-b {
  right: 94px;
  bottom: 84px;
  background: var(--lilac);
}

.auth-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 228, 163, 0.2);
  border-radius: 50%;
  background: rgba(255, 228, 163, 0.08);
}

.brand-moon {
  position: relative;
  width: 13px;
  height: 13px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--moon);
}

.brand-moon::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0a0d1d;
}

.brand-word {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.brand-tag {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.24);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.auth-hero {
  position: relative;
  z-index: 2;
  margin-top: 48px;
}

.auth-kicker {
  color: rgba(255, 228, 163, 0.68);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.auth-hero h1 {
  margin-top: 15px;
  font-size: 41px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -1.8px;
  color: #fbf6e9;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.auth-sub {
  margin-top: 12px;
  color: rgba(216, 212, 200, 0.58);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}

.auth-moon-scene {
  position: absolute;
  top: 70px;
  right: 6px;
  width: 122px;
  height: 150px;
  pointer-events: none;
}

.auth-moon {
  position: absolute;
  top: 8px;
  right: 2px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 33% 28%, #fff9e2 0 14%, transparent 45%),
    radial-gradient(circle at 38% 34%, #fff3c9, #ffe2a0 55%, #ffc66d 100%);
  box-shadow:
    0 0 38px rgba(255, 214, 132, 0.35),
    0 0 100px rgba(255, 198, 106, 0.18);
  animation: moonFloat 7s ease-in-out infinite;
}

.auth-moon::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 16px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(208, 154, 76, 0.12);
  box-shadow: 26px 22px 0 -3px rgba(208, 154, 76, 0.1), 10px 46px 0 -4px rgba(208, 154, 76, 0.09);
}

.auth-moon-shadow {
  position: absolute;
  top: -2px;
  right: -18px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #0a0d1d;
  filter: blur(1px);
  opacity: 0.88;
}

.auth-star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff6dc;
  opacity: 0.7;
  animation: starPulse 4s ease-in-out infinite;
}

.auth-star.s1 {
  top: 112px;
  left: 8px;
}

.auth-star.s2 {
  top: 132px;
  right: 4px;
  width: 2px;
  height: 2px;
  animation-delay: -1.8s;
}

.auth-star.s3 {
  top: 44px;
  right: 105px;
  width: 2px;
  height: 2px;
  animation-delay: -3s;
}

.auth-panel {
  position: relative;
  z-index: 3;
  margin-top: 30px;
  padding: 7px 16px 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  box-shadow:
    0 30px 60px -30px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.auth-tabs {
  position: relative;
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.2);
}

.auth-tab {
  position: relative;
  z-index: 2;
  flex: 1;
  height: 38px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  transition: color 0.25s ease;
}

.auth-tab.is-active {
  color: var(--text);
  font-weight: 600;
}

.auth-tab-light {
  position: absolute;
  z-index: 1;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 6px 18px -10px #000;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-tabs.is-register .auth-tab-light {
  transform: translateX(calc(100% - 2px));
}

.auth-form {
  margin-top: 10px;
}

.field {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.field:focus-within .field-icon {
  color: var(--moon);
}

.field-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  color: var(--muted-2);
  transition: color 0.25s ease;
}

.field-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.6;
}

.field-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 7px 0;
}

.field-label {
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

.field input {
  width: 100%;
  height: 24px;
  color: var(--text);
  font-size: 14px;
  caret-color: var(--moon);
}

.field input::placeholder {
  color: rgba(150, 153, 173, 0.48);
}

.auth-error {
  min-height: 17px;
  margin: 7px 2px 1px;
  color: #ff9ba2;
  font-size: 10.5px;
  line-height: 1.5;
}

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  margin-top: 2px;
  border-radius: 15px;
  background: linear-gradient(135deg, #fff1ca, var(--moon-strong) 60%, #ffc879);
  color: #2b2111;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 16px 30px -15px rgba(255, 196, 98, 0.62);
  transition: transform 0.16s ease, opacity 0.2s ease;
}

.auth-submit svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.auth-submit:active {
  transform: scale(0.985);
}

.auth-submit:disabled {
  opacity: 0.7;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 13px 0 10px;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.065);
}

.demo-button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(255, 228, 163, 0.12);
  border-radius: 15px;
  background: rgba(255, 228, 163, 0.045);
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.demo-button:active {
  background: rgba(255, 228, 163, 0.09);
  border-color: rgba(255, 228, 163, 0.22);
}

.demo-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(255, 228, 163, 0.1);
  font-size: 17px;
}

.demo-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.demo-copy strong {
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.demo-copy small {
  color: var(--muted-2);
  font-size: 9.5px;
}

.demo-button > svg {
  width: 14px;
  height: 14px;
  color: var(--muted-2);
}

.auth-foot {
  margin-top: 11px;
  color: rgba(150, 153, 173, 0.42);
  font-size: 9px;
  text-align: center;
  letter-spacing: 0.04em;
}

.auth-quote {
  position: relative;
  z-index: 2;
  margin-top: 22px;
  color: rgba(216, 212, 200, 0.27);
  font-family: var(--display);
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.03em;
  text-align: center;
}

/* ============================================================
   App shell / tabbar
   ============================================================ */

.app-view {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.page-scroller {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: calc(96px + var(--safe-bottom));
  scrollbar-width: none;
  overscroll-behavior-y: contain;
}

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

.page {
  display: none;
  padding: 24px 22px 0;
}

.page.is-active {
  display: block;
  animation: pageIn 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.tabbar {
  position: absolute;
  right: 13px;
  bottom: calc(12px + var(--safe-bottom));
  left: 13px;
  z-index: 35;
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 23px;
  background: linear-gradient(180deg, rgba(20, 24, 45, 0.88), rgba(11, 14, 29, 0.92));
  box-shadow:
    0 20px 40px -18px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
}

.tab {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 56px;
  border-radius: 18px;
  color: var(--muted-2);
  transition: color 0.22s ease;
}

.tab-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 27px;
  border-radius: 10px;
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.tab-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.6;
}

.tab-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.tab.is-active {
  color: var(--moon);
}

.tab.is-active .tab-icon {
  background: rgba(255, 228, 163, 0.1);
  transform: translateY(-1px);
}

.tab.is-active .tab-label {
  font-weight: 600;
}

.tab-badge {
  position: absolute;
  top: -3px;
  right: -5px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border: 2px solid #0f1327;
  border-radius: 999px;
  background: var(--peach);
  color: #2b1711;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

/* ============================================================
   Home
   ============================================================ */

.home-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 2px;
}

.home-date {
  color: rgba(255, 228, 163, 0.55);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.home-greeting {
  margin-top: 7px;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.7px;
  line-height: 1.28;
}

.home-greeting em {
  color: var(--moon);
  font-style: normal;
}

.home-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
}

.home-head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.home-avatar {
  cursor: pointer;
}

.sleep-hero {
  position: relative;
  min-height: 254px;
  margin-top: 22px;
  overflow: hidden;
  padding: 19px 19px 16px;
  border: 1px solid rgba(255, 232, 190, 0.16);
  border-radius: 30px;
  background:
    radial-gradient(ellipse 70% 75% at 92% 6%, rgba(255, 220, 150, 0.28), transparent 55%),
    radial-gradient(ellipse 80% 80% at 8% 100%, rgba(155, 135, 255, 0.16), transparent 58%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025));
  box-shadow:
    0 26px 50px -28px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sleep-hero::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -80px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(255, 228, 163, 0.07);
  border-radius: 50%;
  box-shadow:
    0 0 0 32px rgba(255, 228, 163, 0.025),
    0 0 0 64px rgba(255, 228, 163, 0.018);
  pointer-events: none;
}

.sleep-hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent);
  pointer-events: none;
}

.hero-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-plan {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 228, 163, 0.76);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.hero-plan i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--moon);
  box-shadow: 0 0 7px var(--moon);
}

.hero-edit {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: rgba(216, 212, 200, 0.5);
  font-size: 10px;
}

.hero-edit svg {
  width: 12px;
  height: 12px;
}

.hero-edit:active {
  color: var(--text);
}

.hero-main {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 136px;
  margin-top: 4px;
}

.hero-label {
  color: rgba(216, 212, 200, 0.54);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.hero-time {
  margin: 5px 0 7px;
  color: #fff8e7;
  font-family: var(--display);
  font-size: 49px;
  font-weight: 500;
  letter-spacing: -0.5px;
  line-height: 1.05;
}

.hero-time span {
  margin-left: 3px;
  color: rgba(255, 228, 163, 0.55);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
}

.hero-countdown {
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: rgba(216, 212, 200, 0.58);
  font-size: 10.5px;
}

.hero-countdown strong {
  color: var(--moon);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
}

.hero-countdown.is-overdue {
  color: var(--peach);
}

.hero-countdown.is-done {
  color: rgba(255, 228, 163, 0.8);
}

.moon-orb {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 118px;
  height: 118px;
  margin-right: -2px;
}

.moon-orb::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 228, 163, 0.11);
  border-radius: 50%;
  box-shadow:
    0 0 0 13px rgba(255, 228, 163, 0.025),
    0 0 0 26px rgba(255, 228, 163, 0.014);
}

.orbit {
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  animation: orbitSpin 32s linear infinite;
}

.orbit::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 17px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--moon);
  box-shadow: 0 0 9px rgba(255, 228, 163, 0.8);
}

.moon-core {
  position: relative;
  width: 78px;
  height: 78px;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 30%, #fffbe9 0 8%, transparent 38%),
    radial-gradient(circle at 30% 35%, #fff5d2, #ffe3a4 50%, #ffc66d 100%);
  box-shadow:
    0 0 34px rgba(255, 211, 122, 0.34),
    0 0 80px rgba(255, 196, 98, 0.15);
  animation: moonFloat 6s ease-in-out infinite;
}

.moon-core::before {
  content: "";
  position: absolute;
  top: 21%;
  left: 19%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(199, 143, 63, 0.12);
  box-shadow: 24px 18px 0 -2px rgba(199, 143, 63, 0.1), 5px 39px 0 -3px rgba(199, 143, 63, 0.08);
}

.moon-core::after {
  content: "";
  position: absolute;
  top: -7px;
  right: -17px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #13162a;
  filter: blur(1px);
}

.moon-hint {
  position: absolute;
  right: 3px;
  bottom: -2px;
  color: rgba(216, 212, 200, 0.36);
  font-size: 8px;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
}

.hero-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.reminder-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(216, 212, 200, 0.5);
  font-size: 9.5px;
}

.reminder-pulse {
  position: relative;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 8px rgba(157, 227, 212, 0.7);
}

.reminder-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(157, 227, 212, 0.25);
  border-radius: 50%;
  animation: pulseRing 2.4s ease-out infinite;
}

.hero-bottom .pill-button {
  height: 39px;
  padding: 0 17px;
  font-size: 11.5px;
}

/* friend strip */

.friend-strip {
  display: flex;
  gap: 17px;
  overflow-x: auto;
  padding: 1px 1px 4px;
  scrollbar-width: none;
}

.friend-strip::-webkit-scrollbar {
  display: none;
}

.friend-bubble {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 58px;
  text-align: center;
}

.friend-bubble .avatar-wrap {
  transition: transform 0.2s ease;
}

.friend-bubble:active .avatar-wrap {
  transform: scale(0.94);
}

.friend-name {
  width: 100%;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-sub {
  width: 100%;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.add-bubble .add-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 3px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.add-bubble .add-avatar svg {
  width: 18px;
  height: 18px;
}

.add-bubble:active .add-avatar {
  border-color: rgba(255, 228, 163, 0.3);
  color: var(--moon);
}

/* weekly insight */

.insight-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(ellipse 80% 90% at 100% 0%, rgba(185, 168, 255, 0.1), transparent 55%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.062), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow-card);
}

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

.empty-insight,
.empty-sleep-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.empty-insight {
  padding: 17px;
}

.empty-sleep-summary {
  padding: 16px;
}

.empty-insight-orbit {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 47px;
  height: 47px;
  border: 1px solid rgba(255, 228, 163, 0.14);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 228, 163, 0.18), transparent 55%),
    rgba(255, 255, 255, 0.035);
  color: var(--moon);
}

.empty-insight-orbit svg {
  width: 21px;
  height: 21px;
}

.empty-insight-copy {
  flex: 1;
  min-width: 0;
}

.empty-insight-copy strong {
  display: block;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
}

.empty-insight-copy p {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 8.8px;
  line-height: 1.6;
}

.empty-insight .ghost-button,
.empty-sleep-summary .ghost-button {
  flex: none;
  height: 32px;
  padding: 0 11px;
  font-size: 9px;
}

.insight-title {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.insight-sub {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.quality-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid rgba(157, 227, 212, 0.16);
  border-radius: 999px;
  background: rgba(157, 227, 212, 0.07);
  color: var(--aqua);
  font-size: 8.5px;
  font-weight: 600;
}

.insight-main {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-top: 14px;
}

.sleep-ring {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 87px;
  height: 87px;
  border-radius: 50%;
  background: conic-gradient(var(--moon) calc(var(--p, 60) * 1%), rgba(255, 255, 255, 0.065) 0);
  box-shadow: 0 0 22px rgba(255, 214, 132, 0.08);
}

.sleep-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #121629;
}

.sleep-ring-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.sleep-ring-copy strong {
  color: #fff8e8;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.1;
}

.sleep-ring-copy span {
  color: var(--muted-2);
  font-size: 7.5px;
}

.week-bars {
  display: flex;
  flex: 1;
  align-items: flex-end;
  gap: 5px;
  height: 76px;
  min-width: 0;
}

.week-bar {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  height: 100%;
}

.week-bar-track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 58px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.week-bar-fill {
  width: 100%;
  height: var(--h, 50%);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255, 228, 163, 0.95), rgba(255, 169, 114, 0.55));
  box-shadow: 0 0 12px rgba(255, 196, 98, 0.15);
  transform-origin: bottom;
  animation: barGrow 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.week-bar.is-last .week-bar-fill {
  background: linear-gradient(180deg, #fff7dc, var(--moon));
  box-shadow: 0 0 16px rgba(255, 214, 132, 0.28);
}

.week-bar.is-empty .week-bar-fill {
  height: 8%;
  opacity: 0.22;
}

.week-bar-label {
  color: var(--muted-2);
  font-size: 7.5px;
  line-height: 1;
}

.week-bar.is-last .week-bar-label {
  color: var(--moon);
}

.insight-tip {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.insight-tip svg {
  flex: none;
  width: 13px;
  height: 13px;
  margin-top: 1px;
  color: var(--moon);
}

/* moment preview */

.preview-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.preview-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
  transition: background 0.2s ease;
}

.preview-card:active {
  background: rgba(255, 255, 255, 0.06);
}

.preview-thumb {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  font-size: 19px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.preview-copy {
  min-width: 0;
  flex: 1;
}

.preview-copy strong {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-copy span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-meta {
  flex: none;
  color: var(--muted-2);
  font-size: 8.5px;
  text-align: right;
}

/* ============================================================
   Generic page header
   ============================================================ */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-top: 4px;
}

.page-kicker {
  color: rgba(255, 228, 163, 0.52);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.page-title {
  margin-top: 5px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.9px;
  line-height: 1.2;
}

.page-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

/* ============================================================
   Friends
   ============================================================ */

.own-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 228, 163, 0.11);
  border-radius: 17px;
  background: linear-gradient(120deg, rgba(255, 228, 163, 0.07), rgba(255, 255, 255, 0.02));
}

.own-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 228, 163, 0.09);
  color: var(--moon);
}

.own-card-icon svg {
  width: 16px;
  height: 16px;
}

.own-card-copy {
  flex: 1;
  min-width: 0;
}

.own-card-copy span {
  display: block;
  color: var(--muted-2);
  font-size: 8.5px;
}

.own-card-copy strong {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9.5px;
}

.copy-btn svg {
  width: 12px;
  height: 12px;
}

.search-entry {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted-2);
  font-size: 11px;
  text-align: left;
}

.search-entry svg {
  width: 15px;
  height: 15px;
}

.request-card {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(185, 168, 255, 0.18);
  border-radius: 22px;
  background:
    radial-gradient(ellipse 90% 100% at 100% 0%, rgba(185, 168, 255, 0.13), transparent 60%),
    rgba(255, 255, 255, 0.04);
}

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

.request-head strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.request-head strong span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--lilac);
  color: #211a3c;
  font-size: 8px;
  font-weight: 800;
}

.request-head small {
  color: var(--muted-2);
  font-size: 8.5px;
}

.request-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.request-person {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.12);
}

.request-person-copy {
  flex: 1;
  min-width: 0;
}

.request-person-copy strong {
  display: block;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
}

.request-person-copy span {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-actions {
  display: flex;
  flex: none;
  gap: 6px;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.mini-btn.is-primary {
  border-color: transparent;
  background: var(--moon);
  color: #2b2111;
  font-weight: 700;
}

.mini-btn.is-quiet {
  width: 28px;
  padding: 0;
}

.mini-btn:disabled {
  opacity: 0.45;
}

.mini-btn svg {
  width: 12px;
  height: 12px;
}

.friend-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}

.friend-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.friend-row:last-child {
  border-bottom: 0;
}

.friend-row-main {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.friend-row-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.friend-row-name strong {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-row-name .tiny-tag {
  flex: none;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(185, 168, 255, 0.1);
  color: var(--lilac);
  font-size: 7px;
  font-weight: 600;
}

.friend-row-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}

.friend-row-meta i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--muted-2);
  opacity: 0.6;
}

.friend-row-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
}

.round-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.round-action svg {
  width: 14px;
  height: 14px;
}

.round-action:active {
  color: var(--moon);
}

.chat-action {
  height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(255, 228, 163, 0.16);
  border-radius: 999px;
  background: rgba(255, 228, 163, 0.07);
  color: var(--moon);
  font-size: 9.5px;
  font-weight: 500;
}

.suggest-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.13);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.022);
}

.suggest-orbs {
  display: flex;
  flex: none;
}

.suggest-orbs .avatar {
  margin-left: -9px;
}

.suggest-orbs .avatar:first-child {
  margin-left: 0;
}

.suggest-copy {
  flex: 1;
}

.suggest-copy strong {
  display: block;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
}

.suggest-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.suggest-card .ghost-button {
  height: 32px;
  padding: 0 12px;
  font-size: 9.5px;
}

/* ============================================================
   Messages
   ============================================================ */

.unread-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 17px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 181, 154, 0.14);
  border-radius: 15px;
  background: linear-gradient(120deg, rgba(255, 181, 154, 0.08), rgba(255, 255, 255, 0.02));
  color: var(--muted);
  font-size: 10px;
}

.unread-banner .banner-moon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: rgba(255, 181, 154, 0.1);
  font-size: 13px;
}

.unread-banner strong {
  color: var(--peach);
  font-weight: 600;
}

.convo-list {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.convo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  cursor: pointer;
}

.convo-row:last-child {
  border-bottom: 0;
}

.convo-main {
  flex: 1;
  min-width: 0;
}

.convo-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.convo-top strong {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.convo-online {
  flex: none;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 6px rgba(157, 227, 212, 0.7);
}

.convo-preview {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.convo-preview .you {
  color: rgba(255, 228, 163, 0.48);
}

.convo-side {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.convo-time {
  color: var(--muted-2);
  font-size: 8.5px;
  white-space: nowrap;
}

.unread-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--peach);
  color: #2b1711;
  font-size: 8px;
  font-weight: 800;
}

.night-prompt {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background:
    radial-gradient(ellipse 80% 120% at 100% 0%, rgba(255, 228, 163, 0.09), transparent 58%),
    rgba(255, 255, 255, 0.03);
}

.night-prompt-top {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--moon);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.night-prompt-top svg {
  width: 12px;
  height: 12px;
}

.night-prompt p {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.7;
}

.night-prompt small {
  display: block;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 9px;
}

/* ============================================================
   Moments / square
   ============================================================ */

.feed-tabs {
  display: flex;
  gap: 4px;
  margin-top: 18px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.14);
}

.feed-tab {
  flex: 1;
  height: 32px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 10.5px;
  transition: color 0.2s ease, background 0.2s ease;
}

.feed-tab.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 5px 14px -9px #000;
}

.composer-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 13px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.composer-trigger-copy {
  flex: 1;
  min-width: 0;
}

.composer-trigger-copy strong {
  display: block;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
}

.composer-trigger-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.composer-plus {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 228, 163, 0.1);
  color: var(--moon);
}

.composer-plus svg {
  width: 15px;
  height: 15px;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 16px;
}

.moment-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.022));
  box-shadow: 0 20px 40px -32px rgba(0, 0, 0, 0.9);
  animation: cardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.moment-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.moment-author {
  flex: 1;
  min-width: 0;
}

.moment-author strong {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moment-author strong span {
  flex: none;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 228, 163, 0.09);
  color: rgba(255, 228, 163, 0.7);
  font-size: 7px;
  font-weight: 500;
}

.moment-author small {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8px;
}

.moment-mood {
  flex: none;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 8.5px;
}

.moment-text {
  margin-top: 11px;
  color: rgba(247, 242, 231, 0.9);
  font-size: 12.5px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.moment-text .soft-newline {
  display: block;
  height: 3px;
}

.post-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 138px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 17px;
  background: linear-gradient(150deg, #1b2347, #30305a);
}

.post-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.65) 0.7px, transparent 0.9px);
  background-size: 34px 34px;
  opacity: 0.25;
}

.post-art .art-glow {
  position: absolute;
  top: -40px;
  right: -20px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  filter: blur(30px);
}

.post-art .art-emoji {
  position: relative;
  z-index: 2;
  font-size: 57px;
  filter: drop-shadow(0 15px 22px rgba(0, 0, 0, 0.3));
  transform: translateY(-2px);
}

.post-art .art-caption {
  position: absolute;
  bottom: 12px;
  left: 14px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.58);
  font-family: var(--display);
  font-size: 9px;
  font-style: italic;
  letter-spacing: 0.04em;
}

.art-1 {
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 240, 194, 0.22), transparent 24%),
    linear-gradient(150deg, #151b3d, #3b2f50 58%, #6b4552);
}

.art-2 {
  background:
    radial-gradient(ellipse at 24% 90%, rgba(255, 179, 124, 0.18), transparent 45%),
    linear-gradient(150deg, #2c2328, #47363a 55%, #64504a);
}

.art-3 {
  background:
    radial-gradient(circle at 20% 20%, rgba(171, 244, 235, 0.24), transparent 30%),
    linear-gradient(150deg, #122c3a, #1e4f56 55%, #2d6b64);
}

.art-4 {
  background:
    radial-gradient(circle at 80% 20%, rgba(185, 168, 255, 0.22), transparent 30%),
    linear-gradient(150deg, #101530, #202954 55%, #3a315f);
}

.art-5 {
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 227, 160, 0.24), transparent 30%),
    linear-gradient(150deg, #412734, #7c4a44 52%, #c27b57);
}

.post-image {
  width: 100%;
  max-height: 260px;
  margin-top: 11px;
  border-radius: 17px;
  object-fit: cover;
}

.moment-sleep {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(185, 168, 255, 0.07);
  color: rgba(185, 168, 255, 0.72);
  font-size: 8px;
}

.moment-sleep svg {
  width: 10px;
  height: 10px;
}

.moment-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.moment-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--muted-2);
  font-size: 9.5px;
  transition: color 0.2s ease, background 0.2s ease;
}

.moment-action svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.7;
}

.moment-action.is-liked {
  background: rgba(255, 143, 156, 0.08);
  color: var(--rose);
}

.moment-action.is-liked svg {
  fill: rgba(255, 143, 156, 0.9);
  stroke: var(--rose);
}

.moment-action.like-pop svg {
  animation: heartPop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.moment-spacer {
  flex: 1;
}

.comment-section {
  margin-top: 4px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.13);
}

.comment-row {
  display: flex;
  gap: 6px;
  padding: 3px 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.comment-row strong {
  flex: none;
  color: rgba(255, 228, 163, 0.7);
  font-size: 9.5px;
  font-weight: 500;
}

.comment-row span {
  word-break: break-word;
}

.comment-more {
  display: inline-block;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.comment-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.comment-form input {
  flex: 1;
  min-width: 0;
  color: var(--text-soft);
  font-size: 10px;
}

.comment-form input::placeholder {
  color: var(--muted-2);
}

.comment-send {
  flex: none;
  color: var(--moon);
  font-size: 9.5px;
  font-weight: 600;
}

.feed-end {
  margin: 22px 0 4px;
  color: rgba(255, 255, 255, 0.16);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-align: center;
}

/* ============================================================
   Profile
   ============================================================ */

.profile-card {
  position: relative;
  overflow: hidden;
  margin-top: 20px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  background:
    radial-gradient(ellipse 80% 90% at 100% 0%, rgba(255, 203, 151, 0.24), transparent 55%),
    radial-gradient(ellipse 80% 90% at 0% 100%, rgba(150, 131, 255, 0.2), transparent 55%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow-card);
}

.profile-card::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.profile-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.profile-info {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.profile-name {
  overflow: hidden;
  color: #fff9ea;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-handle {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--display);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.profile-bio {
  margin-top: 10px;
  color: rgba(247, 242, 231, 0.68);
  font-size: 10.5px;
  line-height: 1.65;
}

.profile-edit {
  position: relative;
  z-index: 2;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
  color: rgba(255, 255, 255, 0.6);
}

.profile-edit svg {
  width: 13px;
  height: 13px;
}

.profile-streak {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 15px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 228, 163, 0.16);
  border-radius: 999px;
  background: rgba(255, 228, 163, 0.075);
  color: var(--moon);
  font-size: 8.5px;
  font-weight: 500;
}

.profile-streak svg {
  width: 11px;
  height: 11px;
}

.profile-stats {
  position: relative;
  z-index: 1;
  display: flex;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.profile-stat {
  flex: 1;
  text-align: center;
}

.profile-stat + .profile-stat {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-stat strong {
  display: block;
  color: #fff8e8;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.2;
}

.profile-stat span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 8px;
}

.sleep-summary {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.sleep-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sleep-summary-label {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.sleep-summary-value {
  margin-top: 3px;
  color: var(--text);
  font-family: var(--display);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.1;
}

.sleep-summary-value small {
  margin-left: 4px;
  color: var(--muted-2);
  font-family: var(--font);
  font-size: 8px;
}

.sleep-summary-quality {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid rgba(157, 227, 212, 0.14);
  border-radius: 999px;
  background: rgba(157, 227, 212, 0.06);
  color: var(--aqua);
  font-size: 8px;
}

.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 35px;
  margin-top: 13px;
}

.mini-bar {
  flex: 1;
  height: var(--h, 40%);
  min-height: 4px;
  border-radius: 4px;
  background: rgba(255, 228, 163, 0.32);
}

.mini-bar.is-last {
  background: var(--moon);
  box-shadow: 0 0 9px rgba(255, 214, 132, 0.25);
}

.mini-bars-labels {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.mini-bars-labels span {
  flex: 1;
  color: var(--muted-2);
  font-size: 6.5px;
  text-align: center;
}

.sleep-summary-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 9.5px;
  cursor: pointer;
}

.sleep-summary-link svg {
  width: 13px;
  height: 13px;
}

.settings-group {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.032);
}

.settings-label {
  padding: 13px 15px 5px;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
}

.settings-label + .setting-row {
  border-top: 0;
}

.setting-row:active {
  background: rgba(255, 255, 255, 0.03);
}

.setting-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-soft);
}

.setting-icon svg {
  width: 15px;
  height: 15px;
}

.setting-icon.moon {
  background: rgba(255, 228, 163, 0.09);
  color: var(--moon);
}

.setting-icon.lilac {
  background: rgba(185, 168, 255, 0.1);
  color: var(--lilac);
}

.setting-icon.aqua {
  background: rgba(157, 227, 212, 0.08);
  color: var(--aqua);
}

.setting-icon.rose {
  background: rgba(255, 143, 156, 0.08);
  color: var(--rose);
}

.setting-copy {
  flex: 1;
  min-width: 0;
}

.setting-copy strong {
  display: block;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
}

.setting-copy span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.setting-value {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 9.5px;
}

.setting-value svg {
  width: 12px;
  height: 12px;
  color: var(--muted-2);
}

.setting-value .accent-text {
  color: var(--moon);
}

.logout-row {
  color: var(--rose);
}

.logout-row .setting-copy strong {
  color: rgba(255, 143, 156, 0.82);
}

.profile-footer {
  margin: 22px 0 8px;
  color: rgba(255, 255, 255, 0.16);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-align: center;
}

/* ============================================================
   Subpage / chat
   ============================================================ */

.layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.layer.is-open {
  pointer-events: auto;
}

.layer-subpage {
  z-index: 50;
}

.subpage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 70% 45% at 80% 0%, rgba(96, 81, 170, 0.18), transparent 65%),
    #080b18;
  animation: subpageIn 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.subpage.is-closing {
  animation: subpageOut 0.28s ease forwards;
}

.subpage-head {
  position: relative;
  z-index: 3;
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  height: 64px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  background: rgba(8, 11, 24, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.subpage-head .back-btn {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
}

.subpage-head .back-btn svg {
  width: 17px;
  height: 17px;
}

.subpage-title {
  flex: 1;
  min-width: 0;
}

.subpage-title strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subpage-title span {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subpage-body {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px 20px calc(28px + var(--safe-bottom));
  scrollbar-width: none;
}

.subpage-body::-webkit-scrollbar {
  display: none;
}

.subpage-head .head-action {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  color: var(--muted);
}

.subpage-head .head-action svg {
  width: 19px;
  height: 19px;
}

.chat-page {
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(90, 76, 158, 0.13), transparent 65%),
    #080b18;
}

.chat-head {
  gap: 9px;
  padding: 0 12px;
}

.chat-person {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.chat-person-copy {
  min-width: 0;
}

.chat-person-copy strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-person-copy span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.chat-person-copy span.is-online {
  color: var(--aqua);
}

.chat-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 14px calc(10px + var(--safe-bottom));
  scrollbar-width: none;
  overscroll-behavior-y: contain;
}

.chat-thread > * {
  flex-shrink: 0;
}

.chat-thread-spacer {
  flex: 1 1 0;
  min-height: 0;
}

.chat-thread > .empty-state {
  margin: auto 0;
}

.chat-intro {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px 12px;
  text-align: center;
}

.chat-intro-orb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 228, 163, 0.13);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 228, 163, 0.18), transparent 58%),
    rgba(255, 255, 255, 0.03);
  font-size: 24px;
  box-shadow: 0 0 26px rgba(255, 214, 132, 0.08);
}

.chat-intro strong {
  color: rgba(247, 242, 231, 0.72);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.chat-intro p {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 8.5px;
}

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

.chat-date {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 18px;
  color: rgba(255, 255, 255, 0.2);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.chat-date::before,
.chat-date::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.055);
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin-bottom: 12px;
  animation: msgIn 0.3s ease both;
}

.msg-row.is-mine {
  flex-direction: row-reverse;
}

.msg-row .avatar {
  width: 27px;
  height: 27px;
  margin-bottom: 2px;
  font-size: 13px;
}

.msg-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 76%;
}

.msg-row.is-mine .msg-stack {
  align-items: flex-end;
}

.msg-bubble {
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px 16px 16px 5px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(247, 242, 231, 0.92);
  font-size: 12px;
  line-height: 1.65;
  word-break: break-word;
  box-shadow: 0 9px 20px -18px #000;
}

.msg-row.is-mine .msg-bubble {
  border-color: rgba(255, 228, 163, 0.15);
  border-radius: 16px 16px 5px 16px;
  background: linear-gradient(145deg, rgba(255, 228, 163, 0.2), rgba(255, 199, 122, 0.13));
  color: #fff7e7;
}

.msg-time {
  padding: 0 3px;
  color: rgba(255, 255, 255, 0.18);
  font-size: 7.5px;
}

.msg-system {
  display: flex;
  justify-content: center;
  margin: 14px 0;
}

.msg-system span {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
}

.typing-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin-bottom: 12px;
}

.typing-row .avatar {
  width: 27px;
  height: 27px;
  font-size: 13px;
}

.typing-bubble {
  display: flex;
  gap: 3px;
  padding: 11px 13px;
  border-radius: 16px 16px 16px 5px;
  background: rgba(255, 255, 255, 0.07);
}

.typing-bubble i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-bubble i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-bubble i:nth-child(3) {
  animation-delay: 0.3s;
}

.chat-quick {
  display: flex;
  flex: none;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 14px;
  scrollbar-width: none;
}

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

.quick-chip {
  flex: none;
  height: 29px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 9px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.quick-chip:active {
  border-color: rgba(255, 228, 163, 0.2);
  color: var(--moon);
}

.chat-composer {
  display: flex;
  flex: none;
  align-items: flex-end;
  gap: 7px;
  padding: 8px 12px calc(10px + var(--safe-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(9, 12, 26, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.chat-composer-field {
  display: flex;
  flex: 1;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.045);
}

.chat-composer-field textarea {
  width: 100%;
  max-height: 86px;
  padding: 9px 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  caret-color: var(--moon);
}

.chat-composer-field textarea::placeholder {
  color: var(--muted-2);
}

.chat-send {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff0c7, var(--moon-strong));
  color: #2b2111;
  box-shadow: 0 8px 18px -10px rgba(255, 196, 98, 0.7);
  transition: transform 0.16s ease, opacity 0.2s ease;
}

.chat-send svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.chat-send:active {
  transform: scale(0.92);
}

.chat-send:disabled {
  opacity: 0.4;
}

.chat-day-label {
  margin: 12px 0 5px;
  color: var(--muted-2);
  font-size: 8px;
  text-align: center;
}

/* ============================================================
   Settings / report subpages
   ============================================================ */

.set-hero {
  position: relative;
  overflow: hidden;
  padding: 21px 18px 18px;
  border: 1px solid rgba(255, 228, 163, 0.14);
  border-radius: 26px;
  background:
    radial-gradient(ellipse 80% 90% at 100% 0%, rgba(255, 228, 163, 0.14), transparent 58%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.02));
  text-align: center;
}

.set-hero::before {
  content: "";
  position: absolute;
  top: -74px;
  right: -40px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255, 228, 163, 0.09);
  border-radius: 50%;
  box-shadow: 0 0 0 26px rgba(255, 228, 163, 0.025);
}

.set-hero-label {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.set-hero-time {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  color: #fff8e7;
  font-family: var(--display);
  font-size: 52px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.set-hero-sub {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.set-hero-moon {
  position: absolute;
  top: 12px;
  left: 14px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--moon);
  box-shadow: 0 0 16px rgba(255, 228, 163, 0.4);
}

.set-hero-moon::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #171a2e;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.switch-row:first-of-type {
  border-top: 0;
}

.switch-copy {
  flex: 1;
  min-width: 0;
}

.switch-copy strong {
  display: block;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
}

.switch-copy span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.switch {
  position: relative;
  flex: none;
  width: 39px;
  height: 23px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  transition: background 0.24s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #d9d8df;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}

.switch.is-on {
  background: linear-gradient(135deg, #ffe6a9, var(--moon-strong));
}

.switch.is-on::after {
  transform: translateX(16px);
  background: #2b2111;
}

.time-cards {
  display: flex;
  gap: 9px;
  margin-top: 15px;
}

.time-card {
  flex: 1;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.time-card label {
  display: block;
  color: var(--muted-2);
  font-size: 8.5px;
  letter-spacing: 0.06em;
}

.time-input-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 5px;
}

.time-input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color-scheme: dark;
}

.time-input::-webkit-calendar-picker-indicator {
  display: none;
}

.time-unit {
  color: var(--muted-2);
  font-size: 8px;
}

.day-row {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin-top: 15px;
}

.day-chip {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-2);
  font-size: 9.5px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.day-chip.is-on {
  border-color: rgba(255, 228, 163, 0.22);
  background: rgba(255, 228, 163, 0.1);
  color: var(--moon);
}

.lead-chips {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.lead-chip {
  flex: 1;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 9px;
}

.lead-chip.is-on {
  border-color: rgba(255, 228, 163, 0.22);
  background: rgba(255, 228, 163, 0.09);
  color: var(--moon);
}

.set-section {
  margin-top: 18px;
}

.set-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}

.set-section-title strong {
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 500;
}

.set-section-title span {
  color: var(--muted-2);
  font-size: 8.5px;
}

.set-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.03);
}

.set-tip {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 11px;
  padding: 0 3px;
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.65;
}

.set-tip svg {
  flex: none;
  width: 12px;
  height: 12px;
  margin-top: 1px;
  color: var(--muted);
}

.goal-line {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
}

.goal-line input[type="range"] {
  flex: 1;
  height: 3px;
  accent-color: var(--moon);
}

.goal-value {
  flex: none;
  color: var(--moon);
  font-family: var(--display);
  font-size: 17px;
}

.notify-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(185, 168, 255, 0.14);
  border-radius: 17px;
  background: rgba(185, 168, 255, 0.055);
}

.notify-card .setting-icon {
  background: rgba(185, 168, 255, 0.1);
  color: var(--lilac);
}

.notify-card .ghost-button {
  height: 30px;
  padding: 0 11px;
  font-size: 9px;
}

.save-bar {
  display: flex;
  gap: 9px;
  margin-top: 22px;
}

.save-bar .pill-button {
  flex: 1;
  height: 46px;
  justify-content: center;
}

.save-bar .ghost-button {
  height: 46px;
  padding: 0 18px;
  border-radius: 15px;
}

.set-footer {
  display: flex;
  flex: none;
  gap: 9px;
  padding: 10px 20px calc(14px + var(--safe-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(8, 11, 24, 0.9);
  box-shadow: 0 -16px 30px -24px #000;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.set-footer .pill-button {
  flex: 1;
  height: 44px;
  justify-content: center;
}

.set-footer .ghost-button {
  height: 44px;
  padding: 0 15px;
}

/* report */

.report-hero {
  padding: 20px;
  border: 1px solid rgba(255, 228, 163, 0.13);
  border-radius: 26px;
  background:
    radial-gradient(ellipse 80% 80% at 100% 0%, rgba(255, 228, 163, 0.13), transparent 60%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
}

.report-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.report-ring {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 107px;
  height: 107px;
  border-radius: 50%;
  background: conic-gradient(var(--moon) calc(var(--p, 70) * 1%), rgba(255, 255, 255, 0.06) 0);
}

.report-ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #111527;
}

.report-ring-copy {
  position: relative;
  z-index: 1;
  text-align: center;
}

.report-ring-copy strong {
  display: block;
  color: #fff8e8;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
}

.report-ring-copy span {
  display: block;
  color: var(--muted-2);
  font-size: 7.5px;
}

.report-copy {
  flex: 1;
}

.report-copy h2 {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.report-copy p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.7;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 17px;
}

.report-stat {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.report-stat strong {
  display: block;
  color: var(--text);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
}

.report-stat span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 7.5px;
}

.chart-card {
  margin-top: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.chart-head strong {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
}

.chart-head span {
  color: var(--muted-2);
  font-size: 8px;
}

.report-chart {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 124px;
  margin-top: 16px;
}

.report-bar {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  height: 100%;
}

.report-bar .duration {
  color: var(--muted-2);
  font-size: 7px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.report-bar:hover .duration {
  opacity: 1;
}

.report-bar-track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 26px;
  height: 88px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.report-bar-fill {
  width: 100%;
  height: var(--h);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 228, 163, 0.88), rgba(255, 171, 116, 0.35));
}

.report-bar.is-last .report-bar-fill {
  background: linear-gradient(180deg, #fff6d8, var(--moon-strong));
  box-shadow: 0 0 14px rgba(255, 214, 132, 0.2);
}

.report-bar .day {
  color: var(--muted-2);
  font-size: 7.5px;
}

.report-bar.is-last .day {
  color: var(--moon);
}

.insight-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.insight-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
}

.insight-item-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 228, 163, 0.08);
  color: var(--moon);
  font-size: 14px;
}

.insight-item-copy {
  flex: 1;
}

.insight-item-copy strong {
  display: block;
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 500;
}

.insight-item-copy span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8.5px;
}

/* ============================================================
   Sheets
   ============================================================ */

.layer-sheet {
  z-index: 60;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 13, 0.64);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}

.sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  max-height: 89%;
  padding: 7px 17px calc(18px + var(--safe-bottom));
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(111, 94, 184, 0.13), transparent 65%),
    #101426;
  box-shadow: 0 -30px 60px -25px rgba(0, 0, 0, 0.9);
  animation: sheetUp 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.sheet.is-closing {
  animation: sheetDown 0.25s ease forwards;
}

.sheet-handle {
  flex: none;
  width: 34px;
  height: 4px;
  margin: 0 auto 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
}

.sheet-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 13px;
}

.sheet-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.sheet-sub {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.sheet-close {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.sheet-close svg {
  width: 15px;
  height: 15px;
}

.sheet-body {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1px 1px 3px;
  scrollbar-width: none;
}

.sheet-body::-webkit-scrollbar {
  display: none;
}

.sheet-footer {
  flex: none;
  padding-top: 13px;
}

.sheet-footer .pill-button {
  width: 100%;
  height: 46px;
  justify-content: center;
}

/* check-in sheet */

.checkin-mood {
  display: flex;
  gap: 7px;
  margin-top: 7px;
}

.mood-chip {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 8px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 8.5px;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.mood-chip .mood-emoji {
  font-size: 20px;
  filter: grayscale(0.2);
}

.mood-chip.is-on {
  border-color: rgba(255, 228, 163, 0.26);
  background: rgba(255, 228, 163, 0.1);
  color: var(--moon);
}

.checkin-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.checkin-time label {
  color: var(--muted);
  font-size: 10px;
}

.checkin-time input {
  color: var(--text);
  font-family: var(--display);
  font-size: 25px;
  color-scheme: dark;
}

.checkin-time input::-webkit-calendar-picker-indicator {
  display: none;
}

.sheet-textarea {
  width: 100%;
  min-height: 83px;
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.7;
}

.sheet-textarea::placeholder {
  color: var(--muted-2);
}

.sheet-textarea:focus {
  border-color: rgba(255, 228, 163, 0.2);
}

/* add-friend sheet */

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.search-box svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}

.search-box input {
  flex: 1;
  min-width: 0;
  height: 44px;
  color: var(--text);
  font-size: 11.5px;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.search-box .search-submit {
  flex: none;
  color: var(--moon);
  font-size: 10px;
  font-weight: 600;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}

.search-person {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
}

.search-person-copy {
  flex: 1;
  min-width: 0;
}

.search-person-copy strong {
  display: block;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
}

.search-person-copy span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.search-person .mini-btn {
  height: 30px;
}

.search-hint {
  margin: 12px 2px 0;
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.7;
}

.search-empty {
  padding: 24px 10px;
  color: var(--muted-2);
  font-size: 10px;
  text-align: center;
}

/* compose sheet */

.compose-moods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.compose-mood {
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 9.5px;
}

.compose-mood.is-on {
  border-color: rgba(185, 168, 255, 0.28);
  background: rgba(185, 168, 255, 0.1);
  color: var(--lilac);
}

.compose-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.compose-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 9px;
}

.compose-tool svg {
  width: 13px;
  height: 13px;
}

.compose-tool.is-on {
  border-color: rgba(255, 228, 163, 0.2);
  color: var(--moon);
}

.compose-photo-preview {
  position: relative;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 15px;
}

.compose-photo-preview img {
  width: 100%;
  max-height: 190px;
  object-fit: cover;
}

.compose-photo-remove {
  position: absolute;
  top: 7px;
  right: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  backdrop-filter: blur(6px);
}

.compose-photo-remove svg {
  width: 12px;
  height: 12px;
}

.compose-sleep {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 9.5px;
}

.compose-sleep input {
  width: 72px;
  color: var(--text-soft);
  font-family: var(--display);
  font-size: 15px;
  color-scheme: dark;
}

.compose-sleep input::-webkit-calendar-picker-indicator {
  display: none;
}

.compose-counter {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 8px;
}

/* inbox */

.inbox-section + .inbox-section {
  margin-top: 15px;
}

.inbox-heading {
  margin-bottom: 6px;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.inbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.inbox-copy {
  flex: 1;
  min-width: 0;
}

.inbox-copy strong {
  display: block;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
}

.inbox-copy span {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* profile edit sheet */

.edit-avatar-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 3px 0 12px;
}

.emoji-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.emoji-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 19px;
}

.emoji-choice.is-on {
  border-color: rgba(255, 228, 163, 0.3);
  background: rgba(255, 228, 163, 0.1);
}

.edit-field {
  margin-top: 12px;
}

.edit-field label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.edit-field input,
.edit-field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 11.5px;
}

/* ============================================================
   Toast + celebration
   ============================================================ */

.toast-stack {
  position: absolute;
  right: 16px;
  bottom: calc(92px + var(--safe-bottom));
  left: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background: rgba(26, 30, 51, 0.94);
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.8);
  color: var(--text-soft);
  font-size: 10.5px;
  line-height: 1.45;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: toastIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.is-leaving {
  animation: toastOut 0.25s ease forwards;
}

.toast .toast-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: 7px;
  background: rgba(255, 228, 163, 0.1);
  color: var(--moon);
  font-size: 11px;
}

.toast .toast-message {
  flex: 1;
  min-width: 0;
}

.night-celebration {
  position: absolute;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  pointer-events: none;
}

.celebration-moon {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
  transform: translate(-50%, -50%) scale(0.4);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 233, 180, 0.28), transparent 68%);
  opacity: 0;
  animation: celebrateMoon 1.7s ease forwards;
}

.celebration-moon span {
  font-size: 68px;
  filter: drop-shadow(0 0 24px rgba(255, 218, 138, 0.55));
}

.confetti-star {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--moon);
  box-shadow: 0 0 8px rgba(255, 228, 163, 0.8);
  animation: confetti 1.5s ease-out forwards;
}

/* ============================================================
   Animations
   ============================================================ */

@keyframes auroraDrift {
  from {
    transform: translate3d(-3%, -2%, 0) scale(0.95);
  }
  to {
    transform: translate3d(4%, 3%, 0) scale(1.08);
  }
}

@keyframes starPulse {
  0%,
  100% {
    opacity: 0.08;
    transform: scale(0.8);
  }
  50% {
    opacity: 0.75;
    transform: scale(1.15);
  }
}

@keyframes moonFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

@keyframes orbitSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseRing {
  0% {
    transform: scale(0.7);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes barGrow {
  from {
    transform: scaleY(0.2);
    opacity: 0.4;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes authOut {
  to {
    opacity: 0;
    transform: translateY(-12px) scale(0.985);
    visibility: hidden;
  }
}

@keyframes subpageIn {
  from {
    opacity: 0;
    transform: translateX(34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes subpageOut {
  to {
    opacity: 0;
    transform: translateX(34px);
  }
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes sheetUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes sheetDown {
  to {
    transform: translateY(100%);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes heartPop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes celebrateMoon {
  0% {
    opacity: 0;
    transform: translate(-50%, -45%) scale(0.3);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -52%) scale(1.04);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58%) scale(1.1);
  }
}

@keyframes confetti {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.4);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(1);
  }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1180px) {
  .desktop-story {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    background: #080b18;
  }

  .world {
    display: none;
  }

  .phone-shell {
    width: 100vw;
    height: 100dvh;
    filter: none;
  }

  .frame-glow,
  .app-grain {
    display: none;
  }

  .app-frame {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-view {
    padding-top: calc(18px + env(safe-area-inset-top, 0px));
  }

  .friend-strip {
    gap: 12px;
  }

  .friend-bubble {
    width: 54px;
  }

  .add-bubble .add-avatar {
    width: 48px;
    height: 48px;
    margin-bottom: 0;
  }
}

@media (max-height: 770px) and (min-width: 761px) {
  .desktop-story {
    transform: translateY(-50%) scale(0.9);
    transform-origin: left center;
  }

  .auth-view {
    padding-top: 16px;
  }

  .auth-hero {
    margin-top: 28px;
  }

  .auth-hero h1 {
    font-size: 35px;
  }

  .auth-moon-scene {
    top: 58px;
    transform: scale(0.86);
    transform-origin: top right;
  }

  .auth-panel {
    margin-top: 20px;
  }

  .auth-quote {
    margin-top: 14px;
  }
}

@media (max-height: 720px) {
  .auth-hero {
    margin-top: 26px;
  }

  .auth-hero h1 {
    font-size: 33px;
  }

  .auth-moon-scene {
    opacity: 0.7;
    transform: scale(0.8);
    transform-origin: top right;
  }

  .auth-panel {
    margin-top: 18px;
  }

  .auth-quote {
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 午夜电棍：熬夜提醒特效 */
body.is-shock-shaking {
  animation: shockShake 0.62s cubic-bezier(.36, .07, .19, .97) both;
}

.shock-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 196, 92, 0.2), transparent 35%),
    radial-gradient(circle at 18% 72%, rgba(89, 205, 255, 0.16), transparent 34%),
    rgba(3, 5, 13, 0.94);
  animation: shockFadeIn 0.18s ease-out both;
}

.shock-overlay.is-closing {
  opacity: 0;
  transition: opacity 0.24s ease;
}

.shock-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: #fff8dc;
  opacity: 0;
  animation: shockFlash 0.7s ease-out 0.04s both;
}

.shock-arc {
  position: absolute;
  width: 2px;
  border-radius: 99px;
  background: linear-gradient(180deg, transparent, #a9edff 18%, #fff 46%, #ffd36a 70%, transparent);
  box-shadow: 0 0 8px #78e6ff, 0 0 20px rgba(255, 211, 106, 0.8);
  filter: drop-shadow(0 0 4px #fff);
  opacity: 0;
  animation: shockArc 0.46s steps(2, end) infinite;
}

.shock-card {
  position: relative;
  z-index: 2;
  width: min(86vw, 360px);
  padding: 28px 22px 20px;
  text-align: center;
  border: 1.5px solid rgba(255, 211, 106, 0.8);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(24, 28, 50, 0.98), rgba(8, 11, 24, 0.99));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 42px rgba(255, 191, 75, 0.24),
    0 28px 70px rgba(0, 0, 0, 0.5);
  animation: shockCardIn 0.32s cubic-bezier(.18, .9, .3, 1.2) both;
}

.shock-emoji {
  font-size: 56px;
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(255, 211, 106, 0.85));
  animation: shockBuzz 0.12s linear infinite;
}

.shock-kicker {
  margin: 12px 0 8px;
  color: #ffd36a;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.4px;
}

.shock-card h2 {
  margin: 0;
  color: #fff8e7;
  font-size: 26px;
  letter-spacing: -0.8px;
}

.shock-copy {
  margin: 10px auto 18px;
  max-width: 270px;
  color: rgba(255, 248, 231, 0.7);
  font-size: 12px;
  line-height: 1.75;
}

.shock-meter {
  height: 5px;
  margin: 0 auto 20px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.shock-meter span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #78e6ff, #ffd36a, #ff7b6b);
  box-shadow: 0 0 12px rgba(255, 211, 106, 0.7);
  animation: shockMeter 1.1s ease-in-out infinite alternate;
}

.shock-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.shock-actions .pill-button,
.shock-actions .ghost-button {
  width: 100%;
  height: 44px;
}

.shock-foot {
  margin: 14px 0 0;
  color: rgba(255, 248, 231, 0.34);
  font-size: 9px;
}

@keyframes shockFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shockCardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shockFlash {
  0% { opacity: 0; }
  8% { opacity: 0.75; }
  16% { opacity: 0.05; }
  28% { opacity: 0.4; }
  100% { opacity: 0; }
}

@keyframes shockArc {
  0%, 100% { opacity: 0; transform: scaleY(0.4); }
  20% { opacity: 0.95; transform: scaleY(1); }
  45% { opacity: 0.15; }
  60% { opacity: 0.9; transform: scaleY(0.75); }
}

@keyframes shockShake {
  10%, 90% { transform: translate3d(-1px, 1px, 0) rotate(-0.2deg); }
  20%, 80% { transform: translate3d(3px, -2px, 0) rotate(0.35deg); }
  30%, 50%, 70% { transform: translate3d(-5px, 2px, 0) rotate(-0.5deg); }
  40%, 60% { transform: translate3d(5px, -1px, 0) rotate(0.5deg); }
}

@keyframes shockBuzz {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  50% { transform: translate(1px, -1px) rotate(3deg); }
}

@keyframes shockMeter {
  from { width: 28%; }
  to { width: 88%; }
}
