/* Bubble Call — Still water (take Z, view Above, dock rings, stepping stones). */

@font-face {
  font-family: "Geist";
  src: url("third-party/geist-vercel/geist-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  font: 400 13.5px/1.3 "Geist", system-ui, sans-serif;
}
button, input, select { font: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.press { transition: transform .12s ease-out; }
.press:active { transform: scale(.94); }
.tm { font-variant-numeric: tabular-nums; }
.ic { display: block; flex: none; width: 22px; height: 22px; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

:root {
  --page: #03070D; --ink: #EEF3F6; --ink2: #B7C6D0; --dim: #A3B5C1; --focus: #A9DDF5; --on: #08202E; --leave: #EE9CA8;
  --c0: #BFDDEA; --c1: #BAD8D0; --c2: #C6CEEA; --c3: #D3E3EA; --c4: #EEF4F7; --matte: #0B1E2E; --disc: #14304A;
  --sky: linear-gradient(to bottom, #03070D 0%, #06111C 40%, #0C2438 70%, #17405E 92%, #2A6187 100%);
  --water: linear-gradient(to bottom, #25597D 0%, #143A57 6%, #0A2236 24%, #050F1A 56%, #03070D 100%);
  --glow: rgb(170 215 240 / .34); --glow2: rgb(110 175 215 / .1); --path: rgb(150 205 235 / .13); --ring: rgb(200 230 245 / .6); --vig: rgb(1 4 8 / .6);
  --ez: cubic-bezier(.3, 1.45, .5, 1); --cam: cubic-bezier(.45, 0, .2, 1);
  --talk: #B5E2F7; --talk-g: var(--talk);
  --gls: linear-gradient(to bottom, rgb(255 255 255 / .1), rgb(255 255 255 / .02) 34%, rgb(4 13 23 / .2)), rgb(5 16 27 / .1);
  --glf: blur(5px) saturate(1.2);
  --gle: linear-gradient(to bottom, rgb(255 255 255 / .3), rgb(255 255 255 / .11) 50%, rgb(255 255 255 / .06));
  color-scheme: dark;
}

#app { position: fixed; inset: 0; z-index: 1; }
.test-copy-badge {
  position: fixed; z-index: 10; pointer-events: none;
  top: env(safe-area-inset-top, 0px); left: 50%; transform: translateX(-50%);
  padding: 2px 8px; border-radius: 0 0 6px 6px;
  background: #4a3111; color: #fff4cc; font: 600 12px/1.3 system-ui, sans-serif;
}
.sc {
  position: absolute; inset: 0; overflow: hidden; overflow: clip;
  --hy: 47%; --cx: 50%; --gap: clamp(12px, 2.4vw, 34px);
}
#stage {
  --w0: min(176px, 15.5vh, 21vw);
  --w1: min(134px, 11.8vh, 16vw);
  --w2: min(102px, 9vh, 12.2vw);
  --up1: 3vh; --up2: 5.4vh; --drop: 21%;
}
.sky { position: absolute; left: 0; right: 0; top: 0; height: var(--hy); background: var(--sky); }
.water { position: absolute; left: 0; right: 0; top: var(--hy); bottom: 0; background: var(--water); }
.water::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: var(--cx); width: min(48vw, 540px); transform: translateX(-50%);
  background: linear-gradient(to bottom, var(--path), transparent 72%);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 40%, #000 60%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 40%, #000 60%, transparent);
}
.glow {
  position: absolute; left: calc(var(--cx) - 60vw); width: 120vw; top: calc(var(--hy) - 80px); height: 160px;
  background: radial-gradient(closest-side, var(--glow), var(--glow2) 50%, transparent);
}
.vig {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 78% 72% at var(--cx) var(--hy), transparent 50%, var(--vig) 100%);
}

.top {
  position: absolute; z-index: 5; left: 0; right: 0; top: 0; height: 68px; padding: 0 20px 0 24px;
  display: flex; align-items: center; justify-content: space-between; pointer-events: none;
}
.top > * { pointer-events: auto; }
.wm { font-weight: 650; font-size: 14.5px; letter-spacing: -.01em; }
.me {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 6px; border-radius: 22px; font-weight: 550;
}
.me .ic { width: 19px; height: 19px; color: var(--ink2); }
.me:hover { background: rgb(255 255 255 / .08); }
.av {
  --s: 30px; position: relative; flex: none; width: var(--s); height: var(--s); border-radius: 50%;
  display: grid; place-items: center; color: #F4F8FA; overflow: hidden; background: var(--tone, var(--c4));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .22), inset 0 1px 0 rgb(255 255 255 / .4);
}
.av b { position: relative; font-weight: 500; font-size: max(11px, calc(var(--s) * .4)); line-height: 1; }
.av .ini { display: none; }
html[data-face="a"] .av.face { background: var(--pd); }
html[data-face="a"] .av.face b { display: none; }
html[data-face="b"] .av.face {
  background: radial-gradient(86% 50% at 50% 104%, color-mix(in oklab, var(--pt) 62%, transparent), transparent 72%), rgb(10 30 48 / .7);
}

.head {
  position: absolute; z-index: 4; left: 0; right: 0; top: min(11vh, 96px); text-align: center; padding: 0 20px;
}
.head h1 { font-weight: 300; font-size: clamp(40px, 7.4vh, 66px); line-height: 1; letter-spacing: -.035em; }
.head h1:focus { outline: none; }   /* the title takes the keyboard when the view changes; it is not a control, so no ring */
.head p {
  margin-top: 14px; font-size: 14px; color: var(--ink2);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px;
}
.tmr { display: flex; align-items: center; gap: 6px; color: var(--ink2); }
.tmr .ic { width: 15px; height: 15px; }
#call-status.live::before, .rooms .live::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  margin-right: 8px; vertical-align: 1px; animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .35; } }
.linkish {
  display: inline-flex; align-items: center; gap: 8px; color: var(--ink2); font-size: 14px;
  line-height: 1.3; height: auto; padding: 2px 0; border-radius: 8px;
}
.linkish::before {
  content: ""; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7;
}
.linkish:hover { color: var(--ink); }
.room-actions:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
}
.room-actions button { min-height: 44px; }

/* People over the water, you in the middle and larger, each with a mirror picture. */
.shore {
  pointer-events: none; position: absolute; z-index: 2; left: 0; right: 0;
  bottom: calc(100% - var(--hy) - var(--drop));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; column-gap: var(--gap); padding: 0 6px;
}
.side, .mid { display: flex; align-items: flex-end; gap: var(--gap); min-width: 0; }
.side.l { justify-content: flex-end; }
.who {
  pointer-events: auto; position: relative; flex: none; width: var(--w); margin-bottom: calc(var(--up) + var(--hov));
  display: block; text-align: center; --hov: calc(var(--w) * .07); --h: var(--w); border-radius: 50%;
  --pt: var(--tone, var(--c3)); --pd: #12314A;
}
.who.d0 { --w: var(--w0); --up: 0px; }
.who.d1 { --w: var(--w1); --up: var(--up1); }
.who.d2 { --w: var(--w2); --up: var(--up2); }
.body {
  position: relative; z-index: 2; display: grid; place-items: center; width: var(--w); height: var(--h); overflow: hidden;
  color: var(--ink); border-radius: 50%;
  background: color-mix(in oklab, var(--tone, var(--c3)) 13%, var(--matte));
}
.body em {
  font-style: normal; font-weight: 550; font-size: clamp(11.5px, calc(var(--w) * .13), 14.5px);
  max-width: 86%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.body em.guest-label { display: grid; margin-inline: auto; line-height: 1.1; }
.guest-label .person-name { overflow: hidden; text-overflow: ellipsis; }
.guest-mark { font-size: max(9px, .74em); font-weight: 650; color: var(--ink); }
.body video, .body .livepic {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  visibility: hidden; z-index: 1;
}
video.mirror, .livepic.mirror { transform: scaleX(-1); }
.body.cam video { visibility: visible; }
.who.drawn .livepic { visibility: visible; }
.who.drawn video { visibility: hidden; }
.refl .shot {
  position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; display: none;
}
.who.livecam .refl .shot { display: block; }
.who:not(.chatb) .body:not(.refl) {
  box-shadow: 0 calc(var(--w) * .07) calc(var(--w) * .16) calc(var(--w) * -.06) rgb(0 0 0 / .66);
}
.who:not(.chatb) .body::after {
  content: ""; position: absolute; z-index: 2; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -12%, rgb(255 255 255 / .13), transparent 58%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .15), inset 0 1.5px 1px -.5px rgb(255 255 255 / .5), inset 0 calc(var(--w) * -.14) calc(var(--w) * .18) calc(var(--w) * -.09) rgb(0 6 12 / .6);
}
.who.talk .body:not(.refl) {
  box-shadow: 0 0 0 3px rgb(3 12 20 / .82), 0 0 0 5px var(--talk), 0 0 calc(var(--w) * .26) 5px color-mix(in oklab, var(--talk-g) 52%, transparent), 0 calc(var(--w) * .07) calc(var(--w) * .16) calc(var(--w) * -.06) rgb(0 0 0 / .66);
}
.who.talk .badge { display: none; }
.body.refl {
  position: absolute; z-index: 1; left: 0; top: 100%; transform: scaleY(-1); transform-origin: top;
  margin-top: calc(var(--h) + var(--hov) * 2); opacity: .62; pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 78%);
  mask-image: linear-gradient(to top, #000 0%, transparent 78%);
}
.body.refl em, .body.refl .ini { visibility: hidden; }
.who.talk .body.refl { opacity: .5; filter: url("#f-wave"); }
.body.cam + .body.refl { opacity: .34; }
.body.face.refl { opacity: .46; }
.who.wait { opacity: .62; }
.who.wait .body:not(.refl) { filter: saturate(.72); }

.rip { display: none; position: absolute; z-index: 1; left: 50%; top: calc(var(--h) + var(--hov)); width: 0; height: 0; pointer-events: none; }
.who.talk .rip { display: block; }
.rip::before {
  content: ""; position: absolute; left: calc(var(--w) * -.95); top: calc(var(--w) * -.16); width: calc(var(--w) * 1.9); height: calc(var(--w) * .32);
  border-radius: 50%; background: radial-gradient(closest-side, color-mix(in oklab, var(--talk-g) 26%, transparent), transparent);
}
.rip i {
  position: absolute; left: calc(var(--w) * -1.15); top: calc(var(--w) * -.19); width: calc(var(--w) * 2.3); height: calc(var(--w) * .38);
  border-radius: 50%; box-shadow: 0 0 0 1.25px var(--talk), 0 0 7px 0 color-mix(in oklab, var(--talk-g) 50%, transparent);
  opacity: .66; transform: scale(.42); animation: rip2 4.8s cubic-bezier(.2, .55, .35, 1) infinite;
}
.rip i:nth-child(2) { transform: scale(.68); opacity: .46; animation-delay: -1.2s; }
.rip i:nth-child(3) { transform: scale(.94); opacity: .3; animation-delay: -2.4s; }
.rip i:nth-child(4) { transform: scale(1.2); opacity: .16; animation-delay: -3.6s; }
@keyframes rip2 { 0% { transform: scale(.22); opacity: 0; } 10% { opacity: .88; } 100% { transform: scale(1.32); opacity: 0; } }

.badge {
  display: none; position: absolute; z-index: 3; --b: 24px; right: calc(var(--w) * .146 - var(--b) / 2); top: calc(var(--w) * .146 - var(--b) / 2);
  width: var(--b); height: var(--b); border-radius: 50%; place-items: center; color: #fff;
  background: linear-gradient(to bottom, rgb(150 195 225 / .14), rgb(4 13 23 / .3)), rgb(4 14 24 / .5);
  -webkit-backdrop-filter: blur(8px) saturate(1.5); backdrop-filter: blur(8px) saturate(1.5);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12), inset 0 1px 0 rgb(255 255 255 / .2), 0 2px 8px -3px rgb(0 0 0 / .42);
}
.who.muted .badge { display: grid; }
.badge .ic { width: 62%; height: 62%; }

.fa, .fc { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.ini {
  display: none; position: absolute; left: 0; right: 0; top: 41%; transform: translateY(-50%); z-index: 1;
  font-weight: 250; font-size: calc(var(--w) * .42); line-height: 1; letter-spacing: -.03em;
  color: color-mix(in oklab, var(--pt) 26%, #fff); pointer-events: none;
}
.body.face em {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: 30% 0 16%; color: #fff;
  background: linear-gradient(to top, rgb(3 14 24 / .88), rgb(3 14 24 / .5) 55%, transparent);
}
html[data-face] .body.face.cam em {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; top: auto; transform: none;
  padding: 30% 0 16%; font-weight: 550; letter-spacing: normal;
  font-size: clamp(11.5px, calc(var(--w) * .13), 14.5px); color: #fff; text-shadow: none;
  background: linear-gradient(to top, rgb(3 14 24 / .88), rgb(3 14 24 / .5) 55%, transparent);
}
.body.cam .fa, .body.cam .fc, .body.cam .ini { visibility: hidden; }
html[data-face="a"] .fa { display: block; }
html[data-face="a"] .body.face { background: var(--pd); }
html[data-face="a"] .body.face em { background: linear-gradient(to top, rgb(3 14 24 / .72), rgb(3 14 24 / .32) 55%, transparent); }
html[data-face="c"] .fc, html[data-face="c"] .body .ini { display: block; }
html[data-face="c"] .body.face, html[data-face="c"] .av.face {
  background: linear-gradient(158deg, color-mix(in oklab, var(--pd) 86%, var(--pt)) 0%, color-mix(in oklab, var(--pd) 55%, #06121E) 38%, #050F1B 84%);
}
html[data-face="c"] .body.face em {
  padding: 22% 0 13%; font-weight: 500; letter-spacing: .02em;
  font-size: clamp(11px, calc(var(--w) * .1), 13px); color: rgb(255 255 255 / .92);
  background: linear-gradient(to top, rgb(3 12 21 / .8), rgb(3 12 21 / .4) 55%, transparent);
}
html[data-face="b"] .body.face {
  background:
    radial-gradient(86% 50% at 50% 104%, color-mix(in oklab, var(--pt) 62%, transparent), transparent 72%),
    radial-gradient(circle at 50% 44%, rgb(3 12 22 / .66) 0, rgb(3 12 22 / .5) 46%, color-mix(in oklab, var(--pt) 30%, rgb(3 12 22 / .2)) 100%);
}
html[data-face="b"] .body.face:not(.refl) {
  -webkit-backdrop-filter: blur(calc(var(--w) * .08)) saturate(1.6);
  backdrop-filter: blur(calc(var(--w) * .08)) saturate(1.6);
}
html[data-face="b"] .body.face::before {
  content: ""; position: absolute; z-index: 1; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 calc(var(--w) * .035) calc(var(--w) * .035) calc(var(--w) * -.02) rgb(255 255 255 / .6), inset 0 calc(var(--w) * -.05) calc(var(--w) * .07) calc(var(--w) * -.03) color-mix(in oklab, var(--pt) 88%, #fff), inset 0 0 calc(var(--w) * .2) rgb(255 255 255 / .07);
}
html[data-face="b"] .body.face em {
  position: relative; padding: 0; background: none; font-weight: 500; letter-spacing: .015em;
  font-size: clamp(12px, calc(var(--w) * .125), 15px); color: #F4F8FA; text-shadow: 0 1px 6px rgb(0 8 16 / .7);
}
html[data-face="b"] .body.face.refl { opacity: .5; }
html[data-face] .body.face.cam em { background: linear-gradient(to top, rgb(3 14 24 / .88), rgb(3 14 24 / .5) 55%, transparent); }

@media (hover: hover) {
  .who:hover .body:not(.refl) { filter: brightness(1.32); }
  .rooms button:hover { background: rgb(255 255 255 / .08); color: var(--ink); }
}

/* Bottom row: rings on the water. Microphone, camera, Leave. */
.foot {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none;   /* the bar spans the window: only its buttons take presses, so a stone under it still works */
}
.foot button, .foot .rooms { pointer-events: auto; }
.foot .dock { order: 1; }
.foot .rooms { order: 2; }
.dock { display: flex; align-items: center; gap: 6px; }
.dock .ic { display: none; }
html[data-dock="d"] .dock :not(.off) > .gn.on,
html[data-dock="d"] .dock .off > .gn.of { display: block; }
html[data-dock="d"] .dock { gap: 16px; margin-bottom: 2px; }
html[data-dock="d"] :is(.dk, .lv) { position: relative; --rc: rgb(255 255 255 / .5); --rg: transparent; transition: transform .12s ease-out, filter .15s, color .15s; }
html[data-dock="d"] :is(.dk, .lv):active { filter: brightness(.82); }
html[data-dock="d"] .dk {
  width: 64px; height: 68px; border-radius: 18px; display: grid; place-items: start center; padding-top: 9px; color: #F1F5F8;
}
html[data-dock="d"] .dk .ic { position: relative; z-index: 1; width: 27px; height: 27px; transition: transform .18s ease-out; }
html[data-dock="d"] :is(.dk, .lv)::before,
html[data-dock="d"] :is(.dk, .lv)::after {
  content: ""; position: absolute; left: 50%; bottom: 6px; width: 66px; height: 14px; margin-left: -33px; border-radius: 50%;
  pointer-events: none; transition: transform .25s ease-out, opacity .25s;
}
html[data-dock="d"] :is(.dk, .lv)::before {
  transform: scale(.56); opacity: .62; box-shadow: 0 0 0 1.6px var(--rc), 0 0 8px 0 var(--rg);
  background: radial-gradient(closest-side, var(--rg), transparent);
}
html[data-dock="d"] :is(.dk, .lv)::after { transform: scale(.98); opacity: .3; box-shadow: 0 0 0 1.25px var(--rc); }
html[data-dock="d"] .dk[data-tog="mic"]:not(.off)::after { animation: dring 4.8s cubic-bezier(.2, .55, .35, 1) infinite; }
@keyframes dring { 0% { transform: scale(.56); opacity: 0; } 12% { opacity: .6; } 100% { transform: scale(1.22); opacity: 0; } }
html[data-dock="d"] .dk[data-tog]:not(.off) { --rc: var(--talk); --rg: color-mix(in oklab, var(--talk-g) 46%, transparent); }
html[data-dock="d"] .dk[data-tog]:not(.off)::before { opacity: .95; }
html[data-dock="d"] .dk[data-tog]:not(.off)::after { opacity: .55; transform: scale(1.06); }
html[data-dock="d"] .dk.off { color: #A3B4C0; }
html[data-dock="d"] .dk.off::before { display: none; }
html[data-dock="d"] .dk.off::after { opacity: .13; transform: scale(.7); }
html[data-dock="d"] .dk:hover { background: none; color: #fff; }
html[data-dock="d"] .dk:hover .ic { transform: translateY(-2px); }
html[data-dock="d"] :is(.dk, .lv):not(.off):hover::before { transform: scale(.72); opacity: .9; }
html[data-dock="d"] :is(.dk, .lv):not(.off):hover::after { transform: scale(1.16); opacity: .42; }
html[data-dock="d"] .dk.off:hover::after { opacity: .3; }
html[data-dock="d"] .lv {
  --rc: var(--leave); --rg: rgb(238 156 168 / .3); height: 68px; margin-left: 12px; padding: 9px 14px 0; border-radius: 18px;
  display: flex; align-items: flex-start; gap: 8px; line-height: 27px; color: var(--leave); font-weight: 600;
}
html[data-dock="d"] .lv .ic { width: 24px; height: 27px; }
html[data-dock="d"] .lv::before, html[data-dock="d"] .lv::after { width: 92px; margin-left: -46px; }
html[data-dock="d"] .lv:hover { background: none; }
button:disabled { cursor: default; opacity: .45; }

/* Narrow windows: a row of room names under the buttons. Wide windows hide it (the stones take over). */
.rooms {
  display: flex; justify-content: safe center; gap: 6px; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 0 14px;
}
.rooms::-webkit-scrollbar { display: none; }
.rooms .wrap { position: relative; flex: none; display: flex; }
.rooms button {
  position: relative; flex: none; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 22px; color: var(--dim);
  font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap;
}
.rooms small { font-size: inherit; font-variant-numeric: tabular-nums; }
.rooms .live::before { margin-right: 2px; color: var(--ink); }
.rooms .cur { color: var(--ink); font-weight: 600; }
.rooms .cur::after {
  content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor;
}
.rooms .ic { width: 17px; height: 17px; }
.rooms button:focus-visible { outline-offset: -3px; }
.rooms button.gone { text-decoration: line-through; text-decoration-thickness: 1px; }
.rooms button.err { color: var(--leave); }
.rooms button.wait { opacity: .72; }
.rooms button[aria-disabled="true"]:hover { background: none; }
@media (min-width: 1001px) { #stage .foot .rooms { display: none; } }

/* Stepping stones: flat rings on the near water, lower left, going away toward the horizon. */
.rm { position: absolute; z-index: 2; display: none; }
.rm-d { inset: 0; pointer-events: none; }
@media (min-width: 1001px) { html[data-rooms="d"] #stage .rm-d { display: block; } }
/* The mockup's curve: each stone stands --dx px left of the people row and --dy below the horizon, so the
   stones lead away toward the horizon. --lside is the width of the row's left side: one person, as in the
   mockup (also with nobody there), or two when the room is full, which moves the whole curve left with it. */
.rm-d { --lside: calc(var(--gap) + var(--w1)); }
#stage[data-left="2"] .rm-d { --lside: calc(var(--gap) * 2 + var(--w1) + var(--w2)); }
.stone {
  pointer-events: auto; position: absolute;
  --x: max(var(--rw) / 2 + 10px, calc(50vw - var(--w0) / 2 - var(--lside) - var(--dx) * min(1px, .0665vw)));
  left: var(--x); top: calc(var(--hy) + var(--dy)); transform: translateX(-50%);
}
.st {
  /* a long name ends in "..." before it can run off the left edge: the stone is centred on --x */
  position: relative; max-width: min(240px, calc(var(--x) * 2 - 16px)); min-width: min(100%, calc(var(--rw) + 14px)); height: max(40px, calc(27px + var(--rw) * .17));
  padding: 3px 12px 0; border-radius: 14px; display: flex; align-items: flex-start; justify-content: center;
  font-size: var(--fs); line-height: 20px; font-weight: 450; color: var(--ink); white-space: nowrap;
  --rc: rgb(255 255 255 / .62); --rg: transparent;
}
.st span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.st.press:active { transform: scale(.95); }
.st .ic { width: 19px; height: 19px; }
.st small { margin-left: 6px; font-size: inherit; font-weight: 400; color: var(--ink2); font-variant-numeric: tabular-nums; }
.st::before, .st::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; width: var(--rw); height: calc(var(--rw) * .17);
  margin-left: calc(var(--rw) / -2); border-radius: 50%; pointer-events: none;
}
.st::before {
  transform: scale(.52); opacity: .92; box-shadow: 0 0 0 1.5px var(--rc), 0 0 8px 0 var(--rg);
  background: radial-gradient(closest-side, var(--rg), transparent);
}
.st::after { opacity: .4; box-shadow: 0 0 0 1.25px var(--rc); }
.st.on { --rc: var(--talk); --rg: color-mix(in oklab, var(--talk-g) 46%, transparent); font-weight: 550; }
.st.on::before { opacity: .95; }
.st.on::after { opacity: .6; animation: dring 4.8s cubic-bezier(.2, .55, .35, 1) infinite; }
.st.empty { color: var(--ink2); }
.st.empty::before { display: none; }
.st.empty::after { opacity: .66; box-shadow: 0 0 0 1.5px var(--rc); }
.st.add { color: var(--ink2); }
.st.add::before { display: none; }
.st.add::after { opacity: .78; box-shadow: 0 0 0 1.5px var(--rc); }
.st.cur { font-weight: 600; }
.st.invite::after { box-shadow: 0 0 0 1.6px var(--focus); opacity: .95; }
.rooms button.invite { box-shadow: inset 0 0 0 1px var(--focus); }
.st.gone { color: var(--ink2); text-decoration: line-through; text-decoration-thickness: 1px; }
.st.gone::before { display: none; }
.st.gone::after { opacity: 1; box-shadow: none; background: none; border: 1.5px dashed rgb(234 242 246 / .7); }
.st.err { --rc: var(--leave); color: var(--leave); }
.st.err::after { opacity: .85; }
.st.wait { color: var(--ink2); }
.st.wait::before { display: none; }
.st.wait::after { opacity: .35; animation: blink 1.5s ease-in-out infinite; }
.st.more { color: var(--ink2); font-weight: 450; }
.st.more::before { display: none; }
.st.more::after { opacity: .4; box-shadow: 0 0 0 1.25px var(--rc); }
.st:focus-visible { outline-offset: 4px; }
.st[aria-disabled="true"], .rooms button[aria-disabled="true"] { cursor: default; }
.press[aria-disabled="true"]:active { transform: none; }
@media (hover: hover) { .st:hover { color: #fff; } .st.empty:hover, .st.add:hover, .st.gone:hover, .st.more:hover { color: var(--ink); } }

/* Skies. Aurora is the one you see first. */
html:is([data-sky="moon"], [data-sky="aurora"], [data-sky="dawn"]) .sky::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--deco);
  -webkit-mask-image: var(--dm); mask-image: var(--dm);
}
html:is([data-sky="moon"], [data-sky="aurora"], [data-sky="dawn"]) .water::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--deco);
  transform: scaleY(-1); opacity: var(--ro); filter: blur(var(--rb));
  -webkit-mask-image: linear-gradient(to top, #000, transparent var(--rf));
  mask-image: linear-gradient(to top, #000, transparent var(--rf));
}
html[data-sky="moon"] {
  --page: #020308;
  --sky: linear-gradient(to bottom, #020308 0%, #05070F 42%, #0A0F1D 72%, #121A2D 92%, #1D2942 100%);
  --water: linear-gradient(to bottom, #1A2540 0%, #0E1527 7%, #080C17 26%, #04060C 58%, #020308 100%);
  --glow: rgb(190 202 232 / .17); --glow2: rgb(140 158 205 / .05); --path: rgb(205 216 245 / .11); --ring: rgb(215 224 245 / .55); --vig: rgb(0 1 4 / .62);
  --deco: var(--stars) 50% 0 / 2000px 800px repeat-x;
  --dm: linear-gradient(to bottom, #000 50%, rgb(0 0 0 / .3) 100%);
  --ro: .5; --rb: .7px; --rf: 55%;
  --mx: calc(50% + min(27vw, 420px)); --ma: clamp(64px, 12vh, 130px);
  --talk: #E9EDF6; --gb: rgb(4 7 15 / .42);
}
html[data-sky="moon"] .sky::after {
  content: ""; position: absolute; z-index: 2; left: calc(var(--mx) - 23px); bottom: var(--ma); width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 40% 36%, #FCFDFF 0, #E6EAF3 45%, #C2CADB 100%);
  box-shadow: 0 0 34px 6px rgb(200 212 240 / .28), 0 0 150px 50px rgb(150 170 220 / .13);
}
html[data-sky="moon"] .water::after {
  left: var(--mx); width: min(26vw, 220px);
  background: radial-gradient(20px 74px at 50% calc(var(--ma) + 23px), rgb(232 237 248 / .34), rgb(200 212 240 / .1) 60%, transparent 100%), linear-gradient(to bottom, var(--path), transparent 78%);
}
html[data-sky="aurora"] {
  --page: #02050A;
  --sky: linear-gradient(to bottom, #02050A 0%, #030C14 40%, #06202A 74%, #0B3A3C 93%, #125148 100%);
  --water: linear-gradient(to bottom, #104A43 0%, #0A3033 6%, #061C22 24%, #030D13 56%, #02050A 100%);
  --glow: rgb(130 240 195 / .2); --glow2: rgb(80 190 170 / .07); --path: rgb(130 235 195 / .1); --ring: rgb(190 245 225 / .55); --vig: rgb(0 3 6 / .62);
  --deco: var(--aur) 50% 100% / 100% 100% no-repeat, var(--stars) 50% 0 / 2000px 800px repeat-x;
  --ro: .5; --rb: 5px; --rf: 72%;
  --talk: #8FF3C4;
}
html[data-sky="dawn"] {
  --page: #050409;
  --sky: linear-gradient(to bottom, #06060F 0%, #100D22 36%, #261A39 66%, #4A2842 84%, #8A4648 95%, #C67A5B 100%);
  --water: linear-gradient(to bottom, #A9644F 0%, #5E3345 3.5%, #2B1B33 13%, #130E1F 36%, #08070F 68%, #050409 100%);
  --glow: rgb(255 196 150 / .3); --glow2: rgb(235 125 110 / .09); --path: rgb(255 205 165 / .14); --ring: rgb(255 226 205 / .55); --vig: rgb(3 2 6 / .6);
  --deco: radial-gradient(ellipse 30% 26% at 50% 100%, rgb(255 212 170 / .5), rgb(255 150 112 / .15) 48%, transparent 100%),
    radial-gradient(ellipse 13% .8% at 57% 90%, rgb(255 205 165 / .55), transparent),
    radial-gradient(ellipse 20% 1.1% at 76% 81%, rgb(245 150 130 / .4), transparent),
    radial-gradient(ellipse 15% .9% at 9% 84%, rgb(240 145 130 / .3), transparent),
    radial-gradient(ellipse 24% 1.5% at 90% 67%, rgb(150 92 132 / .34), transparent),
    radial-gradient(ellipse 22% 1.4% at 16% 70%, rgb(140 88 130 / .26), transparent),
    radial-gradient(circle at 79% 33%, #fff 0, #fff 1.1px, rgb(255 240 225 / .3) 2.2px, transparent 7px);
  --ro: .55; --rb: 3px; --rf: 62%;
  --gls: linear-gradient(to bottom, rgb(255 255 255 / .09), rgb(255 255 255 / .02) 34%, rgb(14 8 16 / .26)), rgb(14 8 16 / .3);
  --talk: color-mix(in oklab, #F0B592 82%, #fff); --talk-g: #F0B592;
  --gb: rgb(14 8 16 / .5);
}
@media (max-width: 700px) { html[data-sky="moon"] { --mx: calc(100% - 36px); --ma: 150px; } }

/* Quiet glass for the few things the mockup does not draw: name, new room, settings, confirm. */
.overlay {
  position: absolute; z-index: 7; left: 50%; top: calc(min(11vh, 96px) + clamp(40px, 7.4vh, 66px) + 64px);
  transform: translateX(-50%); width: min(360px, calc(100vw - 32px)); text-align: left;
}
.glass {
  border-radius: 24px; padding: 16px 18px 14px;
  background: var(--gls); -webkit-backdrop-filter: var(--glf); backdrop-filter: var(--glf);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .05), inset 0 12px 16px -14px rgb(255 255 255 / .1), 0 14px 34px -18px rgb(0 0 0 / .42);
}
/* .glass used to set position:relative after .overlay, which put every dialog back in flow. */
.overlay.glass { position: absolute; }
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--gle); pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.glass h2, .glass h3 { font: 500 15px/1.3 "Geist", system-ui, sans-serif; margin: 0 0 4px; }
.glass h3 { font-size: 13px; color: var(--ink2); margin-top: 16px; }
.glass p, .glass label { color: var(--ink2); font-size: 13px; }
.glass label { display: block; margin: 12px 0 4px; }
.glass input, .glass select {
  width: 100%; height: 40px; color: #F4F8FA; background: transparent; outline: none; caret-color: var(--focus);
  box-shadow: inset 0 -1px 0 rgb(183 198 208 / .5);
}
.glass input:focus, .glass select:focus { box-shadow: inset 0 -2px 0 var(--focus); }
.glass select { color-scheme: dark; }
.glass .row { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: flex-end; margin-top: 14px; }
.glass .row button { height: 36px; padding: 0 2px; color: var(--ink2); border-radius: 8px; }
.glass .row button.pri { color: var(--ink); font-weight: 600; }
.err { min-height: 1.2em; margin-top: 8px; color: var(--leave); font-size: 13px; }
.choices { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.choices button { height: 32px; padding: 0 2px; color: var(--ink2); border-radius: 8px; display: inline-flex; align-items: center; }
.choices button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.sw {
  width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; flex: none;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .4);
}
.sw-moon { background: radial-gradient(circle at 65% 35%, #F4F6FB 0 2.2px, #0A0F1D 3px); }
.sw-aurora { background: linear-gradient(#030C14, #3FD49C); }
.sw-dawn { background: linear-gradient(#1A1230 30%, #D98A5E); }
#settings {
  left: auto; right: 16px; top: 64px; transform: none; width: min(320px, calc(100vw - 24px));
  max-height: calc(100% - 80px); overflow: auto;
}
.account-block {
  border-block: 1px solid rgb(183 198 208 / .28);
  margin: 12px 0;
  padding: 8px 0;
}
.glass .account-block h3 { margin-top: 0; }
.account-block p, .account-enroll p { margin: 4px 0; }
.account-block p:empty, .account-enroll p:empty { margin: 0; }
.account-block button, .account-enroll .row button {
  min-height: 44px; padding-inline: 4px; border-radius: 8px; color: var(--ink);
}
.account-block .row { margin-top: 0; justify-content: flex-start; }
.account-block h4 { margin: 12px 0 4px; font-size: 13px; }
.account-list { list-style: none; margin: 0; padding: 0; }
.account-list li { border-top: 1px solid rgb(183 198 208 / .28); padding: 4px 0; overflow-wrap: anywhere; }
.account-block input:focus-visible,
.account-enroll input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.account-enroll {
  top: 50%; transform: translate(-50%, -50%); max-height: calc(100% - 24px); overflow: auto;
}
.notes {
  position: absolute; z-index: 6; left: 50%; top: calc(min(11vh, 96px) + clamp(40px, 7.4vh, 66px) + 36px);
  transform: translateX(-50%); width: min(520px, calc(100% - 32px));
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; pointer-events: none;
}
.notes > * { pointer-events: auto; }
.note { color: var(--ink); font-size: 14px; line-height: 1.35; }
.update-note {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  max-width: min(420px, 100%); color: var(--ink); font-size: 14px; line-height: 1.35;
}
.update-note button {
  height: 36px; padding: 0 14px; border-radius: 18px; color: #F4F8FA; font-weight: 550;
  background: var(--gls); -webkit-backdrop-filter: var(--glf); backdrop-filter: var(--glf);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .22);
}
#settings .tick {
  display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 0;
  color: var(--ink); font-size: 14px;
}
#settings .tick input {
  width: 16px; height: 16px; flex: none; box-shadow: none; accent-color: var(--focus);
}
#settings .tick input:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sound {
  height: 36px; padding: 0 14px; border-radius: 18px; color: #F4F8FA; font-weight: 550;
  background: var(--gls); -webkit-backdrop-filter: var(--glf); backdrop-filter: var(--glf);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .22);
}
.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hint { margin-top: 8px; color: var(--ink2); font-size: 12px; }
.mine {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  padding: 8px 0; box-shadow: inset 0 -1px 0 rgb(183 198 208 / .28);
}
.mine .rn { font-weight: 550; color: var(--ink); text-align: left; border-radius: 6px; }
.mine .kind { color: var(--ink2); font-size: 12px; }
.mine .occ { flex: 1 0 100%; margin: 0; color: var(--ink2); font-size: 12px; line-height: 1.35; }
.mine .quiet { margin-left: auto; height: 28px; padding: 0 2px; color: var(--ink2); border-radius: 6px; }
.mine.cur .rn { font-weight: 600; }

@media (max-width: 700px) {
  .top { height: 60px; padding: 0 8px 0 16px; }
  .me .nm { display: none; }
  .rooms {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 30px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 30px), transparent);
  }
  .head { top: 66px; }
  .head h1 { font-size: 30px; }
  .head p { margin-top: 7px; font-size: 13px; }
  .dock { gap: 2px; }
  #stage {
    --hy: 46%;
    --w0: min(100px, 14vh, 23.6vw);
    --w1: max(44px, min(74px, 10.4vh, 17.4vw));
    --w2: max(44px, min(60px, 8.4vh, 14vw));
    --up1: 1.4vh; --up2: 2.4vh;
    --drop: calc(var(--w0) * 1.07 + 3vh);
    --gap: 8px;
  }
  html[data-dock="d"] .dock { gap: 4px; }
  html[data-dock="d"] .dk { width: 58px; }
  html[data-dock="d"] .dk::before, html[data-dock="d"] .dk::after { width: 50px; height: 12px; margin-left: -25px; }
  html[data-dock="d"] .lv { margin-left: 4px; padding: 9px 8px 0; }
  html[data-dock="d"] .lv::before, html[data-dock="d"] .lv::after { width: 78px; margin-left: -39px; }
  #settings { left: 12px; right: 12px; width: auto; top: 68px; max-height: calc(100% - 88px); }
  .notes, .overlay { top: 148px; }
}
@media (max-width: 380px) {
  html[data-dock="d"] .dk { width: 52px; }
  html[data-dock="d"] .lv { margin-left: 2px; padding: 9px 6px 0; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.still *, .still *::before, .still *::after { animation: none !important; transition: none !important; }

/* Room chat and a chat with one person. Bubble B (a hairline, bare lines) and Chat pic A (Light lines).
   The room bubble is a disc in the row; from 1181px wide and 600px tall it stands lower right.
   --k0..--k5 follow the sky. --pt stays the person's tone: the patch uses --chat-pt, not --pt. */
:root { --k0: #04101B; --k1: #123A56; --k2: #3F85AE; --k3: #16405E; --k4: #050F1A; --k5: #E8F5FC; }
html[data-sky="aurora"] { --k0: #020B12; --k1: #08303A; --k2: #2FB58F; --k3: #0C4A45; --k4: #031116; --k5: #D4FFEA; }
html[data-sky="dawn"] { --k0: #120E26; --k1: #4A2848; --k2: #E0906A; --k3: #7A4048; --k4: #120C1C; --k5: #FFE6C8; }
html[data-sky="moon"] { --k0: #04060D; --k1: #131C36; --k2: #5A6FA5; --k3: #1A2644; --k4: #04060C; --k5: #F3F6FC; }
#stage { --wb: max(48px, calc(var(--w2) * .64)); }

.cp { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; display: none; }
html[data-chatpic="a"] .cp-a { display: block; }
.who.chatb { --w: var(--wb); transition: translate .5s var(--cam), transform .12s ease-out; }
.dock .who.chatb { margin-bottom: 15px; }
.dock .who.chatb .ic { display: block; color: var(--k5); }
.bubble-caption {
  display: none;
  position: absolute; left: 0; right: 0; top: calc(100% + 2px);
  font-size: 12px; font-weight: 600; color: var(--ink2);
}
.dock .bubble-caption { display: block; }
.dock .who.chatb .refl { display: none; }
#stage .chatb .body { background: var(--k4); }
#stage .chatb .body.bub {
  position: relative; overflow: hidden;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: 0 calc(var(--w) * .07) calc(var(--w) * .16) calc(var(--w) * -.06) rgb(0 0 0 / .66);
}
#stage .chatb .body.bub::before, #stage .chatb .body.refl::before {
  content: ""; position: absolute; z-index: 2; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -12%, rgb(255 255 255 / .13), transparent 58%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .17), inset 0 1.5px 1px -.5px rgb(255 255 255 / .5), inset 0 calc(var(--w) * -.14) calc(var(--w) * .18) calc(var(--w) * -.09) rgb(0 6 12 / .6);
}
#stage .chatb .body.refl { opacity: .44; }
#stage .chatb .bub .x { position: relative; z-index: 3; color: #fff; display: none; }
#stage.open[data-cur="room"] .chatb .bub .x { display: block; }
#stage.open[data-cur="room"] .chatb .bub .cp { opacity: .28; }

.dot {
  position: absolute; z-index: 4; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: grid; place-items: center; background: var(--c4); color: var(--on);
  font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
#stage .who .dot.pd { right: auto; left: calc(var(--w) * .146 - 9px); top: calc(var(--w) * .146 - 9px); }
#stage .chatb .dot { right: calc(var(--w) * .146 - 9px); top: calc(var(--w) * .146 - 9px); }

#stage .who.cw .body:not(.refl) {
  box-shadow: 0 0 0 2px rgb(3 12 20 / .82), 0 0 0 3.5px rgb(238 244 247 / .92), 0 calc(var(--w) * .07) calc(var(--w) * .16) calc(var(--w) * -.06) rgb(0 0 0 / .66);
}
#stage .who.talk.cw .body:not(.refl) {
  box-shadow: 0 0 0 3px rgb(3 12 20 / .82), 0 0 0 5px var(--talk), 0 0 0 7px rgb(3 12 20 / .82), 0 0 0 8.5px rgb(238 244 247 / .92), 0 0 calc(var(--w) * .26) 8px color-mix(in oklab, var(--talk-g) 52%, transparent), 0 calc(var(--w) * .07) calc(var(--w) * .16) calc(var(--w) * -.06) rgb(0 0 0 / .66);
}
.cbx {
  position: absolute; z-index: 4; --b: 24px; left: calc(var(--w) * .146 - var(--b) / 2); top: calc(var(--w) * .146 - var(--b) / 2);
  width: var(--b); height: var(--b); border-radius: 50%; display: none; place-items: center; color: #fff;
  background: linear-gradient(to bottom, rgb(150 195 225 / .14), rgb(4 13 23 / .3)), rgb(4 14 24 / .5);
  -webkit-backdrop-filter: blur(8px) saturate(1.5); backdrop-filter: blur(8px) saturate(1.5);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12), inset 0 1px 0 rgb(255 255 255 / .2), 0 2px 8px -3px rgb(0 0 0 / .42);
}
.cbx .ic { width: 62%; height: 62%; }
#stage .who.cw .cbx { display: grid; }

.peek {
  position: absolute; z-index: 4; left: 50%; top: calc(100% + 9px); width: 230px; margin-left: -115px;
  text-align: center; font-size: 13px; line-height: 1.4; color: var(--ink);
}
#stage .chatb .peek { display: none; }
.peek b { display: block; font-size: 12px; font-weight: 600; color: var(--ink2); }
.peek .w { font-weight: 600; color: var(--c1); }
.peek .preview { display: block; overflow-wrap: anywhere; }
#stage .chatb.seen .peek { color: var(--ink2); }

@media (min-width: 1181px) and (min-height: 600px) {
  #stage {
    --chat-left: calc(50vw + var(--w0) / 2 + var(--gap) * 2 + var(--w1) + var(--w2) + 42px);
  }
  #stage .shore .who.chatb, #stage .who.invite-call {
    position: fixed; left: var(--chat-left); top: calc(var(--hy) + var(--drop) + 5vh);
    margin: 0; --hov: 27px;
  }
  #stage .who.invite-call { left: calc(var(--chat-left) - var(--wb) - 14px); }
  /* With Invite beside Chat, wrap the preview between their gap and the viewport edge. */
  #stage:has(.invite-call:not([hidden])) .peek {
    left: -7px; margin-left: 0; width: min(230px, 100vw - var(--chat-left)); text-align: left;
  }
  #stage:has(.invite-call:not([hidden])) .peek b {
    width: max-content; min-width: calc(var(--wb) + 14px); text-align: center;
  }
  .dock .invite-call .refl { display: grid; }
  .dock .bubble-caption { top: calc(100% + 9px); }
  #stage .chatb .peek { display: block; opacity: 1; visibility: visible; transition: opacity .2s; }
  #stage.open[data-cur="room"] .chatb .peek { opacity: 0; visibility: hidden; transition: none; }
}
/* The bubble is back in the row, so the stones step left of it as well as of the people. */
@media (max-width: 1180px), (max-height: 599px) {
  #stage:has(.shore .who.chatb) .rm-d { --lside: calc(var(--gap) + var(--wb)); }
  #stage:has(.shore .who.chatb)[data-left="1"] .rm-d { --lside: calc(var(--gap) * 2 + var(--w1) + var(--wb)); }
  #stage:has(.shore .who.chatb)[data-left="2"] .rm-d { --lside: calc(var(--gap) * 3 + var(--w1) + var(--w2) + var(--wb)); }
}

#stage .shade {
  position: absolute; z-index: 1; opacity: 0; pointer-events: none; transition: opacity .35s;
  --chat-pm: 190px; --chat-pf: 190px; --chat-pt: 70px; --chat-pft: 160px; --chat-pb: 110px; --chat-pfb: 172px; --chat-pa: .23;
  --chat-ex: linear-gradient(to right, transparent 0, rgb(0 0 0 / .061) calc(var(--chat-pf) * .15), rgb(0 0 0 / .216) calc(var(--chat-pf) * .3), rgb(0 0 0 / .425) calc(var(--chat-pf) * .45), rgb(0 0 0 / .648) calc(var(--chat-pf) * .6), rgb(0 0 0 / .844) calc(var(--chat-pf) * .75), rgb(0 0 0 / .972) calc(var(--chat-pf) * .9), #000 var(--chat-pf),
    #000 calc(100% - var(--chat-pf)), rgb(0 0 0 / .972) calc(100% - var(--chat-pf) * .9), rgb(0 0 0 / .844) calc(100% - var(--chat-pf) * .75), rgb(0 0 0 / .648) calc(100% - var(--chat-pf) * .6), rgb(0 0 0 / .425) calc(100% - var(--chat-pf) * .45), rgb(0 0 0 / .216) calc(100% - var(--chat-pf) * .3), rgb(0 0 0 / .061) calc(100% - var(--chat-pf) * .15), transparent 100%);
  --chat-ey: linear-gradient(to bottom, transparent 0, rgb(0 0 0 / .061) calc(var(--chat-pft) * .15), rgb(0 0 0 / .216) calc(var(--chat-pft) * .3), rgb(0 0 0 / .425) calc(var(--chat-pft) * .45), rgb(0 0 0 / .648) calc(var(--chat-pft) * .6), rgb(0 0 0 / .844) calc(var(--chat-pft) * .75), rgb(0 0 0 / .972) calc(var(--chat-pft) * .9), #000 var(--chat-pft),
    #000 calc(100% - var(--chat-pfb)), rgb(0 0 0 / .972) calc(100% - var(--chat-pfb) * .9), rgb(0 0 0 / .844) calc(100% - var(--chat-pfb) * .75), rgb(0 0 0 / .648) calc(100% - var(--chat-pfb) * .6), rgb(0 0 0 / .425) calc(100% - var(--chat-pfb) * .45), rgb(0 0 0 / .216) calc(100% - var(--chat-pfb) * .3), rgb(0 0 0 / .061) calc(100% - var(--chat-pfb) * .15), transparent 100%);
  inset: auto; left: calc(var(--tx) - var(--chat-pm)); width: calc(var(--tw) + var(--chat-pm) * 2);
  top: calc(var(--ty) - var(--chat-pt)); bottom: calc(100% - var(--by) - var(--chat-pb));
  background: rgb(3 7 13 / var(--chat-pa));
  -webkit-mask-image: var(--chat-ex), var(--chat-ey); mask-image: var(--chat-ex), var(--chat-ey);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
#stage.open .shade { opacity: 1; }
html[data-bubble="b"] #stage.open .shade {
  -webkit-backdrop-filter: blur(14px) brightness(.5); backdrop-filter: blur(14px) brightness(.5);
}
html[data-bubble="b"] #stage .shape :is(.gl, .sh) { display: none; }
html[data-bubble="b"] #stage .shape .ln path {
  stroke-width: 1.5; filter: drop-shadow(0 0 5px color-mix(in oklab, var(--talk-g) 55%, transparent));
}
html[data-bubble="b"] .xs0 { stop-color: #fff; stop-opacity: 0; }
html[data-bubble="b"] .xs1 { stop-color: #EEF4F7; stop-opacity: .62; }
html[data-bubble="b"] .xs2 { stop-color: #EEF4F7; stop-opacity: .92; }

#stage .shape { position: absolute; z-index: 3; inset: 0; pointer-events: none; visibility: hidden; transition: visibility 0s .2s; }
#stage.open .shape { visibility: visible; transition: none; }
#stage .shape > * { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
#stage .shape svg { overflow: visible; }
#stage .shape .ln path { fill: none; stroke: url("#xg"); stroke-width: 1.25; }
#stage.bloop .shape { animation: shapein .46s var(--ez) both; transform-origin: var(--ax) var(--ay); }
@keyframes shapein { from { transform: scale(.78); } }

#stage .text {
  position: absolute; z-index: 4; left: var(--tx); width: var(--tw); top: var(--ty); bottom: calc(100% - var(--by));
  display: flex; flex-direction: column; pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity .18s, visibility 0s .18s;
}
#stage.open .text { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .25s .12s; }
#stage .log {
  flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none;
  display: flex; flex-direction: column; gap: 14px; padding: 40px 0 12px;
  --lm: linear-gradient(to bottom, transparent 0, rgb(0 0 0 / .061) 6px, rgb(0 0 0 / .216) 12px, rgb(0 0 0 / .425) 18px, rgb(0 0 0 / .648) 24px, rgb(0 0 0 / .844) 30px, rgb(0 0 0 / .972) 36px, #000 40px, #000 calc(100% - 14px), transparent);
  -webkit-mask-image: var(--lm); mask-image: var(--lm);
}
#stage .log::-webkit-scrollbar { display: none; }
#stage .log:focus-visible { outline: none; }
#stage .text:has(.log:focus-visible) { outline: 2px solid var(--focus); outline-offset: 8px; border-radius: 6px; }
#stage .log > .older:not([hidden]),
#stage .log > .older[hidden] + .m,
#stage .log > .m:first-child { margin-top: auto; }
#stage .m { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-size: 14px; line-height: 1.42; }
#stage .m > p { max-width: 94%; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
#stage .m.me { align-items: flex-end; text-align: right; }
#stage .m .by { font-size: 12px; color: var(--ink2); }
#stage .m .by b { font-weight: 600; color: var(--c1); margin-right: 8px; }
#stage .m .tm2 { font-variant-numeric: tabular-nums; }
#stage .m .state { font-size: 12px; color: var(--ink2); }
#stage .m .fail { font-size: 12px; color: var(--leave); }
#stage .m .retry { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; border-radius: 6px; }
#stage .older { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
#stage .older-btn { height: auto; padding: 2px 0; color: var(--ink2); font-size: 12px; border-radius: 6px; }
#stage .older-note { font-size: 12px; color: var(--ink2); }
#stage .older-note:empty { display: none; }

#stage .comp {
  position: relative; flex: none; display: flex; align-items: center; height: 48px; margin: 0;
  border: 0; border-radius: 24px; background: var(--gls);
  -webkit-backdrop-filter: var(--glf); backdrop-filter: var(--glf);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .05), inset 0 12px 16px -14px rgb(255 255 255 / .1), 0 14px 34px -18px rgb(0 0 0 / .42);
}
#stage .comp::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--gle); pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}
#stage .comp:focus-within {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .05), inset 0 12px 16px -14px rgb(255 255 255 / .1), 0 14px 34px -18px rgb(0 0 0 / .42), 0 0 18px -2px rgb(169 221 245 / .3);
}
#stage .comp:focus-within::before { inset: -1px; padding: 2px; border-radius: 25px; background: var(--focus); }
#stage .comp input {
  flex: 1; min-width: 0; height: 44px; padding: 0 16px; font-size: 14px; color: #F4F8FA;
  outline: none; caret-color: var(--focus); background: transparent; box-shadow: none;
}
#stage .comp input::placeholder { color: #E9F0F4; opacity: 1; }
#stage .comp input:disabled { opacity: .72; }
#stage .send-err { flex: none; margin: 6px 2px 0; font-size: 12px; line-height: 1.35; color: var(--leave); }

@media (max-height: 964px) {
  #stage.open .head {
    opacity: 0; transform: translateY(-12px); visibility: hidden;
    transition: opacity .25s, transform .4s, visibility 0s .25s;
  }
}
