body[data-page="chat"] #app, body[data-page="call"] #app { background:#0c1026; }
body[data-page="call"] .callroom {
  position:relative; min-height:260px; height:100vh; height:100dvh; color:#f7eee9;
  background:radial-gradient(ellipse at 93% 13%,#2826448a,transparent 48%),linear-gradient(168deg,#091431,#15132f 87%);
}
body[data-page="call"] .callhead {
  min-height:42px; height:42px; padding:4px 108px 4px 10px; color:#f5ecf2; border-color:#b7a8d126; background:#10152be8;
}
body[data-page="call"] .callhead .iconbtn { color:#d5c8e4; }
body[data-page="call"] .callhead .iconbtn:hover { background:#b9a7da22; }
body[data-page="call"] .night-status { flex:none; }
body[data-page="call"] .callhint { color:#b8afc7; }
body[data-page="call"] #callorb .orb { box-shadow:0 0 28px #ad91db27; }
body[data-page="call"] .statepill, body[data-page="call"] .statepill em,
body[data-page="call"] .callcontrols button { color:#d2c4de; }
body[data-page="call"] .statepill i { background:#d7aff1; }
body[data-page="call"] .subtitle { color:#fff0df; }
body[data-page="call"] #callorb .orb {
  width:100%; aspect-ratio:1; height:auto; border-radius:50%;
  background-image:url('media/chat-night.png'); background-size:179% auto; background-position:center 38%;
}
body[data-page="call"] #callorb .orb img { visibility:hidden; }
body[data-page="call"] .callcontrols i { background:#352e4a; color:#ecdaf4; border-color:#ba9fd157; }
body[data-page="call"] .callcontrols .hang i { background:#874a54; color:white; border-color:#bd859078; }
.night-note-label { display:block; font-size:14px; color:inherit; margin:13px 0 7px; }
.night-note-label span { margin-left:8px; font-size:12px; opacity:.72; }
.night-note-field {
  width:100%; min-height:65px; padding:10px; border:1px solid #9987a477; border-radius:12px;
  background:#a38bb318; color:inherit; font:inherit; font-size:16px; resize:vertical;
}

.night-chat-stage {
  --chat-height:100vh;
  --chat-height:100dvh;
  display:grid;
  place-items:center;
  min-height:var(--chat-height);
  background:linear-gradient(#061027,#0c122a 61%,#111025);
}
.night-chat-plate {
  --chat-dock-lift:5%;
  width:min(100%,calc(var(--chat-height) * .55859375));
  position:relative;
  margin:auto;
  line-height:0;
  isolation:isolate;
  container-type:inline-size;
  background:radial-gradient(ellipse 33% 19% at 51% 43%,#565274 4%,#42415d 45%,#232744 81%,#101733 100%);
}
.night-chat-reference {
  position:relative;
  display:block;
  width:100%;
  height:auto;
  pointer-events:none;
  user-select:none;
  -webkit-user-drag:none;
}
.night-chat-plate.sealing .night-chat-reference {clip-path:url(#chat-sky-cut)}
.chat-clip-defs {position:absolute;pointer-events:none}
.glowing-jelly-orb,.chat-orb-dust {
  position:absolute; left:19.58042%; top:25.390625%; width:61.53846%; height:32.8125%;
  pointer-events:none;
}
.glowing-jelly-orb {
  transform-origin:50% 82%;
  animation:pulseOrb 4s ease-in-out infinite;
  will-change:transform;
}
.jelly-skin,.jelly-light,.jelly-wake { position:absolute;inset:0; }
.jelly-skin {
  background:url('media/chat-night.png') 50.9091% 37.7907% / 162.5% 304.7619% no-repeat;
  clip-path:url(#jelly-cut);
}
.jelly-light {
  opacity:0; clip-path:url(#jelly-cut);
  background:radial-gradient(ellipse at 62% 61%,#ffd48eaa,transparent 56%),radial-gradient(ellipse at 44% 82%,#ffd29d8a,transparent 57%);
}
.jelly-wake {
  inset:3% 4%; opacity:0;
  border-radius:51% 49% 48% 52% / 55% 52% 48% 45%;
  box-shadow:0 0 0 1px #e2d8ff8a,0 0 7px 1px #bcafff6b;
}
.glowing-jelly-orb.talking { animation:jellyListen 1.25s ease-in-out infinite; }
.glowing-jelly-orb.talking .jelly-wake { animation:jellyRipple 1.25s ease-out infinite; }
.glowing-jelly-orb.speaking { animation:jellySpeak 2.7s ease-in-out infinite; }
.glowing-jelly-orb.speaking .jelly-light { animation:jellyAmber 2.7s ease-in-out infinite; }
@keyframes pulseOrb {
  0%,100% {transform:scale(1)}
  50% {transform:translateY(-.25%) scale(1.018,1.028)}
}
@keyframes jellyListen {
  0%,100% {transform:scale(1.01,1.015)}
  42% {transform:translateY(-.4%) scale(1.045,1.022) skewX(.65deg)}
  72% {transform:scale(1.024,1.043) skewX(-.4deg)}
}
@keyframes jellyRipple {
  from {opacity:0;transform:scale(.96);border-radius:50% 50% 46% 54% / 55% 54% 46% 45%}
  28% {opacity:.44}
  to {opacity:0;transform:scale(1.083);border-radius:54% 46% 53% 47% / 49% 51% 49% 51%}
}
@keyframes jellySpeak {
  0%,100% {transform:scale(1.008,1.01)}
  54% {transform:translateY(-.45%) scale(1.03,1.038)}
}
@keyframes jellyAmber { 0%,100%{opacity:.35} 55%{opacity:.76} }

.chat-starfall,.chat-orb-dust { pointer-events:none;opacity:0; }
.chat-starfall {
  position:absolute;top:22%;left:72%;width:2px;height:2px;background:#fff6e6;border-radius:50%;
  box-shadow:0 0 6px 1px #fbe1d6;
}
.chat-starfall::before {
  content:"";position:absolute;right:0;bottom:0;width:1px;height:38px;transform:rotate(32deg);
  transform-origin:bottom;background:linear-gradient(transparent,#efdfff95);
}
.chat-orb-dust {
  background:
    radial-gradient(circle at 23% 31%,#f3dbff 1px,transparent 2px),
    radial-gradient(circle at 58% 22%,#fff4d7 1px,transparent 2px),
    radial-gradient(circle at 69% 43%,#ffdeaf 1.2px,transparent 2.3px),
    radial-gradient(circle at 82% 62%,#dcd1ff 1px,transparent 2px),
    radial-gradient(circle at 37% 64%,#fff0dc 1.2px,transparent 2.2px),
    radial-gradient(circle at 48% 78%,#d7caff 1px,transparent 2px);
}
.night-chat-plate.sealing .glowing-jelly-orb { animation:jellyReset .76s ease-in-out both; }
.night-chat-plate.sealing .chat-starfall { animation:starDrift .7s ease-in .04s both; }
.night-chat-plate.sealing .chat-orb-dust { animation:jellyDust .75s ease-out both; }
.night-chat-plate.sealing .chat-current-line { opacity:0;transition:opacity .18s; }
@keyframes jellyReset {
  0%,100% {opacity:1;transform:scale(1);filter:blur(0)}
  43% {opacity:.06;transform:scale(.95);filter:blur(5px)}
  55% {opacity:.06;transform:scale(.96);filter:blur(5px)}
}
@keyframes jellyDust { 0%{opacity:0;transform:scale(.9)} 42%{opacity:.9} 100%{opacity:0;transform:scale(1.15)} }
@keyframes starDrift { from{opacity:0;transform:translate(0,0)} 28%{opacity:.8} to{opacity:0;transform:translate(-28px,45px)} }

.chat-hit,.chat-new-topic { position:absolute; display:grid; place-items:center; border:0; padding:0; background:transparent; border-radius:100px; }
.chat-hit:active,.chat-new-topic:active { transform:none; }
.night-chat-plate button:focus-visible { outline:2px solid #f5dabe; outline-offset:2px; }
.hit-back { left:0; top:6%; width:11%; height:6%; }
.hit-options { left:76%; top:6.15%; width:11.5%; height:5.55%; }
.hit-close { left:87.5%; top:6.15%; width:10%; height:5.55%; }
.chat-new-topic {
  top:6%; left:11%; height:5.7%; display:inline-flex; gap:.25em; align-items:center;
  font:500 clamp(11px,3.25cqw,15px)/1.15 var(--sans); color:#c1bbd0; white-space:nowrap;
}
.chat-new-topic svg { width:1.05em; height:1.05em; flex:none; }
.hit-key { left:6.5%; bottom:calc(2.3% + var(--chat-dock-lift)); width:14%; height:8.2%; }
.hit-hold { left:36.5%; bottom:calc(2.2% + var(--chat-dock-lift)); width:27%; height:9%; touch-action:none; user-select:none; -webkit-touch-callout:none; }
.hit-mic { right:6.5%; bottom:calc(2.3% + var(--chat-dock-lift)); width:14%; height:8.2%; }
.hit-mic span {
  display:grid; place-items:center; width:58%; height:66%; color:#aaa1c0;
  background:linear-gradient(170deg,#141132,#12102f 65%,#10102b);
  mask-image:radial-gradient(ellipse at center,#000 60%,transparent 95%);
}
.hit-mic svg { width:54%; height:auto; }
.chat-current-line {
  position:absolute; top:70%; left:8%; right:8%; max-height:calc(15% - var(--chat-dock-lift)); margin:0;
  overflow:auto; overscroll-behavior:contain;
  font:400 clamp(14px,3.8cqw,18px)/1.7 var(--sans); color:#ece2f3; text-align:center;
  text-wrap:pretty; overflow-wrap:anywhere; white-space:pre-line; scrollbar-width:thin;
}
.chat-current-line:empty { display:none; }
.night-chat-plate.has-dock {
  --chat-dock-lift:clamp(8px,calc(var(--chat-height) * .1 - 28px),5%);
}
.has-dock .chat-current-line {
  top:min(68%,calc(96.3% - var(--chat-dock-lift) - 59px - 1.7em));
  max-height:max(1.7em,calc(28.3% - var(--chat-dock-lift) - 59px));
}
.night-chat-plate:has(.chat-hold-status) .chat-current-line { visibility:hidden; }
.chat-dock-shade {
  position:absolute; inset:0; pointer-events:none;
}
/* The approved artwork includes its controls. Cover the original row and move
   the same illustrated strip by the same distance as its three hit targets. */
.chat-dock-shade::before {
  content:""; position:absolute; inset:85% 0 0;
  background:linear-gradient(95deg,#100f25 0% 42%,#12102d 73%,#151131);
  mask-image:linear-gradient(transparent,#000 15%);
}
.night-chat-plate:not(.has-dock) .chat-dock-shade::after {
  content:""; position:absolute; inset:auto 0 var(--chat-dock-lift); height:16%;
  background:url('media/chat-night.png') center bottom / 100% auto no-repeat;
  mask-image:linear-gradient(transparent,#000 17% 92%,transparent);
}
.chat-editor,.chat-record-dock {
  position:absolute; bottom:calc(3.7% + var(--chat-dock-lift)); left:50%; transform:translateX(-50%); width:clamp(min(92vw,290px),91%,450px);
  display:flex; align-items:center; gap:6px; min-height:50px; padding:3px 6px; border:1px solid #b2a6d341;
  background:linear-gradient(110deg,#22233b,#27223c); box-shadow:0 3px 20px #0a091e50; border-radius:28px;
  line-height:1.4; animation:chatDockIn .2s ease-out;
}
.chat-editor input {
  flex:1; min-width:0; height:44px; padding:0; margin:0; border:0; outline:0; background:transparent;
  font:400 16px/1.5 var(--sans); color:#f2efeb;
}
.chat-editor input::placeholder {color:#bdb2cc}
.chat-editor:focus-within {border-color:#b4a2ce90}
.chat-editor button,.chat-record-dock button {min-height:44px;border:0;box-shadow:none}
.chat-editor-close,.chat-send-text {
  flex:none; width:44px; display:grid;place-items:center;background:transparent;border-radius:50%;color:#cdc1da;
}
.chat-send-text {color:#fac592}
.chat-record-dock {justify-content:center; gap:4px; font-size:15px; color:#e8dbef}
.chat-record-dock button {padding:0 11px;border-radius:24px;line-height:1.3;}
.chat-listen-clip {display:inline-flex;align-items:center;justify-content:center;gap:4px;color:#f1e6f2;background:transparent}
.chat-cancel-media {color:#c4b8d3;background:transparent}
.chat-send-media {background:#f6ad6b;color:#2e2030}
@keyframes chatDockIn { from{opacity:.1;translate:0 6px} to{opacity:1;translate:0 0} }
.chat-hold-status {
  position:absolute; left:50%; bottom:calc(15% + var(--chat-dock-lift)); z-index:2; width:max-content; max-width:92%;
  transform:translateX(-50%); margin:0; padding:7px 12px; font:400 14px/1.55 var(--sans);
  text-align:center; border-radius:18px; color:#fff3df; background:#211f39ee; pointer-events:none;
}
.chat-hold-status.is-cancel { color:#ffd2cd; }
body[data-page="chat"] #overlay .sheet {background:linear-gradient(130deg,#292840ee,#242139ed);backdrop-filter:blur(18px)}
@media(prefers-reduced-motion:reduce) {
  .glowing-jelly-orb.talking .jelly-wake { opacity:.35; }
  .glowing-jelly-orb.speaking .jelly-light { opacity:.58; }
}
