:root {
  color-scheme: dark;
  --shell: 480px;
  --ink: #f9f1ed;
  --muted: #bdb8cf;
  --line: #ffffff26;
  --surface: #20213e;
  --paper: #101328;
  --blue: #d0b8fa;
  --dark: #f7a158;
  --iris: #bca1fa;
  --iris-deep: #e0cef9;
  --iris-soft: #37314e;
  --night-orange: #ffa756;
  --night-lilac: #d4b8ff;
  --night-glass: linear-gradient(120deg, #ffffff15, #b59cea16 65%, #b486d81d);
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
}
html { background: #080b1c; }
body, body[data-page=chat], body[data-page=call] {
  margin: 0; color: var(--ink); font-family: var(--sans);
  background: radial-gradient(ellipse 65% 92% at 46% 18%, #151b38 0%, #0c1028 53%, #080a1b 100%);
}
body #app, body[data-page=chat] #app, body[data-page=call] #app {
  max-width: var(--shell); background: #0e1028; box-shadow: 0 0 88px #06071955;
}
.night-interior {
  position: relative; isolation:isolate; min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(ellipse at 6% 12%, #142246ad, transparent 55%),
    radial-gradient(ellipse at 93% 77%, #30204480, transparent 65%),
    linear-gradient(160deg, #0c1025, #18152e);
}
.night-interior::before {
  content:""; position:absolute; inset:0; z-index:-1; pointer-events:none;
  background-image: radial-gradient(circle at 12px 22px,#eee6ff90 .65px,transparent 1.25px),
    radial-gradient(circle at 71px 47px,#f6ccae55 .55px,transparent 1.15px),
    radial-gradient(circle at 42px 71px,#ede6ff88 .7px,transparent 1.4px);
  background-size: 173px 137px, 133px 191px, 209px 257px; opacity:.52;
  mask-image:linear-gradient(to bottom, black, #0002 67%,#0008);
}
.night-status { position: relative; height:36px; display:flex; align-items:center; justify-content:space-between; padding:3px 22px 0; color:#f7f2f1; font:600 15px/1 var(--sans); font-variant-numeric: tabular-nums; }
.night-system-icons { display:flex; align-items:center; gap:6px; }
.night-capsule { position:absolute; top:42px; right:17px; z-index:2; display:grid; place-items:center; height:29px; width:82px; border-radius:30px; background:#15152a42; border:1px solid #efe6ff42; color:#e8e2f1c4; pointer-events:none; }
.night-interior .vpage { background:transparent; min-height:calc(100vh - 36px); min-height:calc(100dvh - 36px); }
.night-interior .nav {
  position:fixed; width:min(calc(100% - 36px), calc(var(--shell) - 36px)); bottom:max(12px, env(safe-area-inset-bottom));
  left:50%; transform:translateX(-50%); display:flex; justify-content:space-around; align-items:center;
  z-index:6; padding:5px 10px; min-height:55px; background:linear-gradient(115deg,#323349f2,#302841f5);
  backdrop-filter:blur(16px); border:1px solid #e6dafa3d; border-radius:32px; box-shadow:0 8px 24px #06071544;
}
.night-interior .nav button,.night-interior .nav button.active {
  flex:1; display:flex; justify-content:center; flex-direction:column; align-items:center; gap:2px; padding:4px 12px;
  background:transparent; font-size:13px; line-height:1.25; color:#c1b4cf;
}
.night-interior .nav button.active { color:#f2dcff; }
.night-interior .nav button.active svg { fill:#cbb2e936; }
#overlay .scrim { align-items:flex-end; justify-content:center; background:#070815a6; padding:0; backdrop-filter:blur(4px); }
#overlay .sheet {
  color:var(--ink); background:linear-gradient(140deg,#292b46,#242038);
  width:min(100%,var(--shell)); max-height:90vh; max-height:90dvh; overflow:auto; overscroll-behavior:contain;
  border:1px solid #ebddff38; border-bottom:0; border-radius:25px 25px 0 0; padding:12px 22px max(26px,env(safe-area-inset-bottom));
  box-shadow:0 -10px 70px #06071545;
}
#overlay .grab { width:36px; height:4px; margin:0 auto 12px; border-radius:5px; background:#b4abc25c; }
#overlay .sheethead h2 { font-size:22px; color:var(--ink); letter-spacing:0; }
#overlay .sheethead .iconbtn { color:var(--muted); background:transparent; }
#overlay .sheet p, #overlay .sheet small { color:#d0c9da; }
#overlay .sheet .optin { background:#ffffff09; border-color:var(--line); color:var(--ink); }
#overlay .sheet .optin input { accent-color:#bd9cea; }
#overlay .sheetactions .primary { background:linear-gradient(110deg,#ffba78,#f3974b); color:#332117; border:0; border-radius:22px; }
#overlay .sheetactions .secondary { background:#ffffff0b; border:1px solid var(--line); color:var(--ink); border-radius:20px; }
#overlay .sheetactions .quietbtn, #overlay .sheet .textbtn { color:#e1c6ff; }
#overlay .sheetactions .danger { border-radius:22px; background:#623d51; color:#ffe4e6; }
#overlay .sheet textarea { font:inherit; color:var(--ink); }
#toast { max-width:min(85vw,425px); background:#30304b; color:#fff6ec; border:1px solid #bfb2d057; border-radius:14px; z-index:40; text-align:center; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
}
