:root {
  --ink: #121722;
  --telegram-text: #121722;
  --muted: #738094;
  --line: rgba(167, 181, 203, .42);
  --paper: rgba(255,255,255,.88);
  --panel: rgba(248, 251, 255, .76);
  --user: #e8f1ff;
  --avatar: #fff2ea;
  --blue: #26a7e8;
  --stage: #2f3d4f;
  --tg-bg: #eef3f8;
  --app-height: 100vh;
  --app-top: 0px;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

html {
  background: #eef4fa;
}

body {
  margin: 0;
  display: grid;
  place-items: center;
  padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -12%, rgba(255,255,255,.96) 0 20%, transparent 44%),
    linear-gradient(160deg, var(--tg-bg) 0%, #f8fbff 48%, #e4edf7 100%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

.phone-shell {
  position: relative;
  width: min(460px, 100%);
  height: min(930px, 100vh);
  min-height: 680px;
  display: grid;
  grid-template-rows: auto minmax(380px, 1fr) minmax(126px, 24vh) auto;
  gap: 10px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(194, 205, 222, .55);
  border-radius: 30px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 22px 70px rgba(53, 66, 92, .16), inset 0 0 0 1px rgba(255,255,255,.82);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body[data-platform="telegram"] {
  padding: 0;
  background: var(--tg-bg);
}

body[data-platform="telegram"][data-layout="immersive"] {
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--app-height, 100dvh);
  min-height: var(--app-height, 100dvh);
  overflow: hidden;
  background: #eef4fa;
}

body[data-platform="telegram"] .phone-shell {
  width: 100%;
  height: 100vh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background:
    radial-gradient(circle at 50% -8%, rgba(255,255,255,.8) 0 22%, transparent 47%),
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(240,246,253,.92));
}

.topbar {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
}

.back {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 15px;
  color: #4e5a70;
  background: rgba(244, 247, 252, .92);
  font-size: 24px;
  line-height: 1;
}

h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1;
  letter-spacing: -.045em;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status {
  align-self: start;
  padding: 7px 12px;
  border-radius: 999px;
  color: #13703c;
  background: #d9ffe8;
  border: 1px solid #a5edbd;
  font-size: 14px;
  font-weight: 760;
}

.avatar-picker {
  margin-top: 8px;
  max-width: 172px;
  height: 30px;
  padding: 0 30px 0 11px;
  border: 1px solid rgba(154, 172, 201, .6);
  border-radius: 999px;
  color: #1f2b41;
  background: rgba(255,255,255,.86);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.avatar-picker:disabled {
  opacity: .62;
  color: #69758a;
}

.avatar-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  border: 1px solid rgba(181, 194, 213, .74);
  border-radius: 28px;
  background: var(--stage);
  contain: strict;
  box-shadow: inset 0 -32px 70px rgba(10, 18, 31, .22);
  transition:
    top 520ms cubic-bezier(.2,.8,.2,1),
    right 520ms cubic-bezier(.2,.8,.2,1),
    bottom 520ms cubic-bezier(.2,.8,.2,1),
    left 520ms cubic-bezier(.2,.8,.2,1),
    width 520ms cubic-bezier(.2,.8,.2,1),
    height 520ms cubic-bezier(.2,.8,.2,1),
    border-radius 520ms cubic-bezier(.2,.8,.2,1),
    box-shadow 520ms ease,
    background 320ms ease;
}

.stage-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 3%, rgba(255,255,255,.72) 0 7%, rgba(255,255,255,.26) 25%, transparent 45%),
    radial-gradient(circle at 18% 72%, rgba(106, 139, 180, .3), transparent 31%),
    linear-gradient(156deg, #253143 0%, #5f728c 100%);
}

.stage-bg::after {
  content: "";
  position: absolute;
  left: 13%;
  right: 13%;
  bottom: 2.8%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(10,16,26,.3), transparent 68%);
  filter: blur(7px);
}

.avatar-video,
.avatar-canvas {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 0;
  width: auto;
  height: 100%;
  transform: translateX(-50%);
  object-fit: contain;
}

.avatar-video { display: none; }

.avatar-canvas {
  opacity: 0;
  transition:
    opacity 340ms ease,
    height 520ms cubic-bezier(.2,.8,.2,1),
    bottom 520ms cubic-bezier(.2,.8,.2,1),
    filter 320ms ease;
}

.avatar-canvas.is-active { opacity: 1; }

.reels-tray {
  position: absolute;
  z-index: 31;
  top: max(12px, env(safe-area-inset-top));
  left: 66px;
  right: 12px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 2px 10px;
  pointer-events: auto;
  scrollbar-width: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 220ms ease, transform 260ms ease;
}

body[data-current-clip] .reels-tray {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

body[data-places-open="true"] .dialog-hint {
  opacity: 0;
  pointer-events: none;
}

.reels-tray::-webkit-scrollbar {
  display: none;
}

.reel-bubble {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  overflow: visible;
  border-radius: 50%;
  background: transparent;
  appearance: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.nearby-button {
  position: absolute;
  z-index: 33;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  min-width: 72px;
  height: 38px;
  border: 1px solid rgba(135, 157, 190, .42);
  border-radius: 999px;
  color: #203049;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 8px 24px rgba(46, 63, 94, .14);
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  backdrop-filter: blur(14px);
}

.places-panel {
  position: absolute;
  z-index: 35;
  left: 12px;
  right: 12px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
  max-height: min(48vh, 410px);
  padding: 10px;
  border: 1px solid rgba(159, 177, 205, .54);
  border-radius: 18px;
  background: rgba(249, 252, 255, .9);
  box-shadow: 0 18px 56px rgba(37, 51, 77, .18);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity 220ms ease, transform 260ms ease;
}

.places-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.places-head,
.places-actions,
.place-buttons {
  display: flex;
  align-items: center;
}

.places-head {
  justify-content: space-between;
  gap: 10px;
}

.places-head strong {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.places-actions {
  flex: 0 0 auto;
  gap: 6px;
}

.places-actions button,
.place-buttons button {
  min-height: 30px;
  border: 1px solid rgba(145, 163, 194, .5);
  border-radius: 999px;
  color: #25334c;
  background: rgba(255, 255, 255, .82);
  font: inherit;
  font-size: 12px;
  font-weight: 720;
}

.places-actions button {
  min-width: 34px;
  padding: 0 10px;
}

.places-status {
  color: #647189;
  font-size: 12px;
  line-height: 1.25;
}

.places-selected {
  min-height: 74px;
}

.places-empty {
  display: grid;
  min-height: 86px;
  place-items: center;
  border: 1px dashed rgba(149, 167, 196, .5);
  border-radius: 14px;
  color: #66738a;
  font-size: 13px;
  text-align: center;
}

.place-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(160, 178, 207, .48);
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
}

.place-media,
.place-media-fallback {
  width: 86px;
  height: 100%;
  min-height: 112px;
  object-fit: cover;
  background: linear-gradient(150deg, #d8edf5, #f6e4d6 52%, #dfe9da);
}

.place-media-fallback {
  display: grid;
  place-items: center;
  color: #536175;
  font-size: 12px;
  font-weight: 800;
}

.place-card-body {
  min-width: 0;
  padding: 10px 10px 10px 0;
}

.place-kicker {
  margin-bottom: 3px;
  color: #637088;
  font-size: 11px;
  font-weight: 760;
}

.place-card strong {
  display: block;
  overflow: hidden;
  color: #152033;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-card p {
  display: -webkit-box;
  margin: 5px 0 8px;
  overflow: hidden;
  color: #4c596e;
  font-size: 12px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.place-buttons {
  gap: 6px;
  flex-wrap: wrap;
}

.place-buttons button {
  padding: 0 10px;
}

.places-list {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.places-list::-webkit-scrollbar {
  display: none;
}

.place-row {
  flex: 0 0 168px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  padding: 8px 9px;
  border: 1px solid rgba(157, 176, 206, .44);
  border-radius: 13px;
  color: #1f2d44;
  background: rgba(255, 255, 255, .72);
  font: inherit;
  text-align: left;
}

.place-row.is-active {
  border-color: rgba(38, 167, 232, .74);
  background: rgba(232, 246, 255, .88);
}

.place-row span {
  min-width: 0;
}

.place-row strong,
.place-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-row strong {
  font-size: 12px;
}

.place-row small {
  margin-top: 3px;
  color: #66748b;
  font-size: 11px;
}

.reel-bubble-ring {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.reel-bubble-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(38, 167, 232, .42);
  pointer-events: none;
}

.reel-bubble-preview {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: block;
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,.96);
  border-radius: 50%;
  background: #1d2737 url("./reels/reels1-thumb.jpg") center 48% / 112% 112% no-repeat;
  box-shadow: none;
}

.reel-stage,
.place-stage {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  background: #070a10;
  transition: opacity 260ms ease;
}

.reel-stage {
  background: #070a10;
}

.place-stage {
  background: #101722;
}

.reel-stage::before {
  content: "";
  position: absolute;
  inset: -28px;
  background: url("./reels/reels1-thumb.jpg") center / cover no-repeat;
  filter: blur(26px) brightness(.48) saturate(1.08);
  transform: scale(1.08);
}

.place-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(247, 250, 253, .88), rgba(198, 211, 221, .78)),
    radial-gradient(circle at 28% 18%, rgba(38, 116, 232, .22), transparent 36%),
    linear-gradient(135deg, #eef3f6, #cbd8df 46%, #8799a7);
}

.reel-stage.is-open,
.place-stage.is-open {
  opacity: 1;
  pointer-events: auto;
}

.reel-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  place-items: center;
  background: rgba(7, 10, 16, .28);
  pointer-events: none;
}

.reel-stage.is-loading .reel-loader {
  display: grid;
}

.reel-loader span {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255,255,255,.34);
  border-top-color: rgba(255,255,255,.94);
  border-radius: 50%;
  animation: reel-loader-spin 850ms linear infinite;
}

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

.reel-video,
.world-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.world-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111927;
}

.world-image.is-visible {
  display: block;
}

.world-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  overflow: hidden;
  background: #dbe2dd;
}

.world-map.is-visible {
  display: grid;
}

.world-map-grid {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  grid-template-columns: repeat(3, 256px);
  grid-template-rows: repeat(5, 256px);
  transform: translate(-50%, -50%) scale(1.08);
  transform-origin: center;
  filter: saturate(.96) contrast(1.02);
}

.world-map-grid img {
  width: 256px;
  height: 256px;
  object-fit: cover;
}

.world-map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: #ed4245;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .34);
  transform: translate(-50%, -100%) rotate(-45deg);
}

.world-map-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.world-map-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #dbe2dd;
}

.world-map-notice {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  align-content: center;
  justify-content: center;
  gap: 14px;
  padding: 88px 28px 168px;
  color: #172033;
  text-align: center;
  text-decoration: none;
  background:
    linear-gradient(180deg, rgba(245, 248, 250, .86), rgba(215, 224, 229, .9)),
    repeating-linear-gradient(45deg, rgba(61, 76, 94, .08) 0 10px, rgba(255,255,255,.16) 10px 20px);
}

.world-map-notice strong {
  font-size: 28px;
  line-height: 1.05;
}

.world-map-notice span {
  max-width: 360px;
  color: rgba(23, 32, 51, .72);
  font-size: 17px;
  line-height: 1.28;
}

.world-map-notice em {
  justify-self: center;
  margin-top: 4px;
  padding: 9px 14px;
  border-radius: 999px;
  color: #fff;
  background: #2674e8;
  font-style: normal;
  font-size: 13px;
  font-weight: 780;
}

.world-map-notice button {
  justify-self: center;
  min-height: 54px;
  margin-top: 4px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #2674e8;
  box-shadow: 0 10px 24px rgba(38, 116, 232, .28);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
}

.reel-video:not(.is-visible),
.world-video:not(.is-visible) {
  opacity: 0;
}

.world-video:not(.is-visible) {
  display: none;
}

.reel-video.is-visible,
.world-video.is-visible {
  opacity: 1;
}

.world-photo-reel {
  position: absolute;
  z-index: 3;
  top: max(76px, calc(54px + env(safe-area-inset-top)));
  left: 14px;
  display: none;
  width: 92px;
  gap: 8px;
  pointer-events: none;
}

.world-photo-reel.is-visible {
  display: grid;
}

.world-photo-card {
  position: relative;
  height: 118px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.88);
  border-radius: 16px;
  background: #243044;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .24);
}

.world-photo-card:not(.is-primary) {
  height: 78px;
  opacity: .86;
}

.world-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.world-photo-card span {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 6px;
  overflow: hidden;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.12;
  text-shadow: 0 1px 7px rgba(0,0,0,.7);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reel-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 8, 13, .38), transparent 24%, transparent 66%, rgba(5, 8, 13, .64)),
    linear-gradient(90deg, rgba(5, 8, 13, .16), transparent 28%, transparent 72%, rgba(5, 8, 13, .16));
}

.place-stage .reel-scrim {
  background:
    linear-gradient(180deg, rgba(5, 8, 13, .28), transparent 30%, transparent 58%, rgba(5, 8, 13, .78)),
    linear-gradient(90deg, rgba(5, 8, 13, .3), transparent 42%, transparent 74%, rgba(5, 8, 13, .22));
}

.world-scene-card {
  position: absolute;
  z-index: 4;
  left: 16px;
  right: 132px;
  bottom: calc(156px + max(10px, env(safe-area-inset-bottom)));
  display: none;
  max-width: 320px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 18px;
  color: #fff;
  background: rgba(8, 12, 20, .54);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .28);
  backdrop-filter: blur(18px);
}

.world-scene-card.is-visible {
  display: block;
}

.world-scene-kicker {
  margin-bottom: 4px;
  color: rgba(255,255,255,.74);
  font-size: 12px;
  font-weight: 760;
}

.world-scene-card strong {
  display: block;
  overflow: visible;
  font-size: 20px;
  line-height: 1.05;
  text-overflow: clip;
  white-space: normal;
}

.world-scene-card p {
  margin: 8px 0 12px;
  color: rgba(255,255,255,.82);
  font-size: 13px;
  line-height: 1.35;
  max-height: 92px;
  overflow: hidden;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.world-map-layers {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
}

.world-map-layers[hidden],
.world-scene-actions[hidden] {
  display: none !important;
}

.world-map-layers button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.1);
  font: inherit;
  font-size: 11px;
  font-weight: 760;
}

.world-map-layers button.is-active {
  color: #152033;
  border-color: rgba(255,255,255,.82);
  background: rgba(255,255,255,.9);
}

.world-scene-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  scrollbar-width: none;
}

.world-scene-actions::-webkit-scrollbar {
  display: none;
}

.world-scene-actions button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  color: #152033;
  background: rgba(255,255,255,.88);
  font: inherit;
  font-size: 13px;
  font-weight: 780;
}

.reel-close {
  position: absolute;
  z-index: 3;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(12, 18, 28, .54);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .24);
  backdrop-filter: blur(14px);
  font: inherit;
  font-size: 28px;
  line-height: 1;
  appearance: none;
}

@media (min-aspect-ratio: 3 / 4) {
  .reel-video,
  .world-video {
    object-fit: contain;
  }
}

.mode-badge {
  position: absolute;
  z-index: 3;
  left: 12px;
  bottom: 12px;
  display: none;
  max-width: calc(100% - 24px);
  padding: 5px 9px;
  overflow: hidden;
  border-radius: 999px;
  color: rgba(255,255,255,.88);
  background: rgba(18, 26, 39, .42);
  font-size: 10px;
  letter-spacing: .02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-platform="telegram"] .mode-badge {
  display: none;
}

.chat {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.62);
  scrollbar-width: thin;
}

.empty-chat {
  margin: auto;
  max-width: 260px;
  color: #7b8798;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
}

.empty-chat strong {
  display: block;
  margin-bottom: 4px;
  color: #263247;
  font-size: 15px;
}

.empty-chat.is-hidden {
  display: none;
}

.bubble {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 18px;
  color: #172033;
  font-size: 15px;
  line-height: 1.3;
  white-space: pre-wrap;
  box-shadow: 0 6px 18px rgba(38, 51, 75, .06);
}

.bubble.user {
  align-self: flex-end;
  background: var(--user);
  border-bottom-right-radius: 7px;
}

.bubble.avatar {
  align-self: flex-start;
  background: var(--avatar);
  border-bottom-left-radius: 7px;
}

.composer {
  display: grid;
  grid-template-columns: 43px 42px 1fr 50px;
  gap: 9px;
  align-items: end;
  position: relative;
  padding-top: 18px;
}

.voice-status {
  position: absolute;
  display: none;
  left: 3px;
  top: 0;
  max-width: calc(100% - 6px);
  overflow: hidden;
  color: #7a8496;
  font-size: 11px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-status.is-visible {
  display: block;
}

body[data-voice-debug="true"] .voice-status {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.2;
}

.composer input {
  min-width: 0;
  height: 50px;
  padding: 0 15px;
  border: 1px solid rgba(178, 193, 216, .84);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255,255,255,.92);
  font-size: 16px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.composer input::placeholder {
  color: #9aa4b6;
}

.composer input:focus {
  border-color: rgba(38, 167, 232, .65);
  box-shadow: 0 0 0 4px rgba(38, 167, 232, .1);
}

.mic,
.speaker,
.send {
  height: 50px;
  display: grid;
  place-items: center;
  border: 0;
}

.mic {
  width: 43px;
  padding: 0;
  border-radius: 17px;
  background: transparent;
  color: #267dbd;
}

.mic-track {
  position: relative;
  width: 33px;
  height: 50px;
  display: block;
  border-radius: 999px;
  background: #e8f1fb;
  border: 1px solid #cbdcee;
  box-shadow: inset 0 2px 8px rgba(74, 91, 124, .08);
}

.mic-thumb {
  position: absolute;
  left: 4px;
  bottom: 4px;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #287fc4;
  background: #fff;
  box-shadow: 0 5px 12px rgba(42, 89, 142, .18);
  transition: transform 220ms ease, background 220ms ease, color 220ms ease;
}

.mic.is-voice-on .mic-track {
  background: linear-gradient(180deg, #7bddff, #1da7e4);
  border-color: #31ace8;
  box-shadow: 0 10px 24px rgba(46, 174, 234, .25);
}

.mic.is-voice-on .mic-thumb {
  color: #1595d3;
  transform: translateY(-19px);
}

.mic.is-recording .mic-thumb {
  color: #fff;
  background: #f15d5d;
}

.speaker {
  width: 42px;
  height: 42px;
  align-self: center;
  border-radius: 50%;
  color: #8b96ad;
  background: rgba(239, 244, 252, .96);
  box-shadow: inset 0 0 0 1px rgba(196, 209, 228, .85);
}

.speaker.is-speaker-on {
  color: #fff;
  background: linear-gradient(135deg, #22a8ee, #3677ff);
  box-shadow: 0 10px 22px rgba(38, 167, 232, .24);
}

.send {
  width: 50px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(38, 167, 232, .28);
}

.mic svg { width: 15px; height: 15px; fill: currentColor; }
.speaker svg { width: 21px; height: 21px; fill: currentColor; }
.send svg { width: 25px; height: 25px; fill: #fff; }

.mic:disabled,
.speaker:disabled,
.send:disabled {
  opacity: .56;
  cursor: not-allowed;
}

@media (max-height: 800px) {
  .phone-shell {
    grid-template-rows: auto minmax(330px, 1fr) minmax(104px, 23vh) auto;
    gap: 8px;
    padding: 12px;
  }
  .chat { padding: 9px; }
  .bubble { font-size: 14px; padding: 10px 12px; }
}

@media (max-height: 700px) {
  .phone-shell {
    grid-template-rows: auto minmax(290px, 1fr) minmax(88px, 20vh) auto;
  }
  .topbar { min-height: 48px; }
  h1 { font-size: 24px; }
  .topbar p { display: none; }
}

@media (max-width: 430px) {
  .memory-card {
    width: calc(100% - 18px);
    right: 9px;
  }
  .memory-form {
    grid-template-columns: 1fr;
  }
}

/* Immersive Telegram-first avatar layout. */
.menu-button,
.icon-button,
.dialog-hint {
  border: 0;
  appearance: none;
  font: inherit;
}

.menu-button {
  position: absolute;
  z-index: 30;
  top: max(12px, env(safe-area-inset-top));
  left: 14px;
  width: 44px;
  height: 44px;
  display: grid;
  place-content: center;
  gap: 4px;
  border-radius: 16px;
  color: #172033;
  background: rgba(255,255,255,.76);
  box-shadow: 0 14px 34px rgba(30, 45, 70, .14);
  backdrop-filter: blur(16px);
}

.menu-button span {
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
}

.side-menu,
.dialog-panel,
.memory-panel {
  position: absolute;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
}

.side-menu::before,
.dialog-panel::before,
.memory-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(20, 28, 42, .18);
  opacity: 0;
  transition: opacity 220ms ease;
}

.side-menu-card,
.dialog-card,
.memory-card {
  position: absolute;
  z-index: 2;
  top: max(12px, env(safe-area-inset-top));
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(330px, calc(100% - 42px));
  padding: 18px;
  border: 1px solid rgba(197, 208, 226, .72);
  border-radius: 26px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 26px 78px rgba(28, 43, 68, .22);
  backdrop-filter: blur(22px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transition: transform 260ms cubic-bezier(.2,.8,.2,1);
}

.side-menu-card {
  left: 12px;
  transform: translateX(calc(-100% - 24px));
}

.dialog-card,
.memory-card {
  right: 12px;
  transform: translateX(calc(100% + 24px));
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  color: #101827;
}

.memory-card {
  width: min(390px, calc(100% - 28px));
  grid-template-rows: auto auto minmax(0, 1fr);
}

.side-menu.is-open,
.dialog-panel.is-open,
.memory-panel.is-open { pointer-events: auto; }
.side-menu.is-open::before,
.dialog-panel.is-open::before,
.memory-panel.is-open::before { opacity: 1; }
.side-menu.is-open .side-menu-card,
.dialog-panel.is-open .dialog-card,
.memory-panel.is-open .memory-card { transform: translateX(0); }

.side-menu-head,
.dialog-head,
.memory-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 2px;
  color: #101827;
  font-size: 20px;
  letter-spacing: -.03em;
}

.dialog-title {
  margin-left: 4px;
}

.dialog-head .icon-button {
  margin-left: auto;
}

.memory-head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.memory-status {
  min-height: 24px;
  padding: 5px 8px;
  border: 1px solid rgba(183, 197, 220, .62);
  border-radius: 12px;
  color: #526176;
  background: rgba(246, 249, 253, .8);
  font-size: 12px;
}

.memory-scroll {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}

.memory-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(190, 203, 224, .68);
  border-radius: 18px;
  background: rgba(250, 252, 255, .72);
}

.memory-form label {
  display: grid;
  gap: 5px;
  color: #657286;
  font-size: 12px;
  font-weight: 760;
}

.memory-form .wide {
  grid-column: 1 / -1;
}

.memory-form .check {
  display: flex;
  align-items: center;
  gap: 7px;
}

.memory-form input,
.memory-form select,
.memory-form textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(183, 197, 220, .8);
  border-radius: 12px;
  color: #162033;
  background: rgba(255,255,255,.92);
  font: inherit;
  font-size: 14px;
}

.memory-form input,
.memory-form select {
  height: 38px;
  padding: 0 10px;
}

.memory-form textarea {
  min-height: 72px;
  padding: 9px 10px;
  resize: vertical;
}

.memory-form button,
.memory-geo-button {
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #1f7a72;
  font-weight: 820;
}

.memory-form button:disabled {
  cursor: progress;
  color: #eef4f8;
  background: #8797aa;
}

.memory-upload-progress {
  grid-column: 1 / -1;
  display: none;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(49, 100, 199, .18);
  border-radius: 12px;
  color: #35516f;
  background: rgba(232, 240, 255, .72);
  font-size: 13px;
  line-height: 1.3;
}

.memory-upload-progress.is-visible {
  display: flex;
}

.memory-upload-progress.is-loading::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid rgba(49, 100, 199, .22);
  border-top-color: #3164c7;
  border-radius: 50%;
  animation: dialog-spin 800ms linear infinite;
}

.memory-upload-progress.is-done {
  border-color: rgba(31, 122, 114, .22);
  color: #1f665f;
  background: rgba(226, 247, 243, .78);
}

.memory-upload-progress.is-error {
  border-color: rgba(222, 55, 72, .2);
  color: #a52833;
  background: rgba(255, 232, 235, .78);
}

.memory-geo-button {
  width: 100%;
  background: #2f68d8;
}

.memory-section {
  display: grid;
  gap: 8px;
}

.memory-section h2 {
  margin: 0;
  color: #253047;
  font-size: 15px;
}

.memory-list {
  display: grid;
  gap: 8px;
}

.memory-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(190, 203, 224, .68);
  border-radius: 16px;
  background: rgba(255,255,255,.76);
}

.memory-item strong,
.memory-item p,
.memory-item small {
  overflow-wrap: anywhere;
}

.memory-item strong {
  display: block;
  font-size: 14px;
}

.memory-item p {
  margin: 4px 0 0;
  color: #526176;
  font-size: 13px;
  line-height: 1.35;
}

.memory-item small {
  grid-column: 1 / -1;
  color: #7d899b;
  font-size: 11px;
}

.memory-item button {
  min-height: 30px;
  border: 1px solid rgba(183, 197, 220, .9);
  border-radius: 10px;
  color: #314057;
  background: #fff;
  font-size: 12px;
  font-weight: 780;
}

.memory-empty {
  padding: 12px;
  border-radius: 14px;
  color: #69758a;
  background: rgba(246, 249, 253, .76);
  font-size: 13px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #4b596e;
  background: rgba(235, 241, 249, .9);
  font-size: 24px;
  line-height: 1;
}

.menu-field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #667286;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.menu-field select,
.menu-action {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(183, 197, 220, .8);
  border-radius: 16px;
  color: #162033;
  background: rgba(255,255,255,.92);
  font: inherit;
  font-size: 15px;
  text-transform: none;
  letter-spacing: 0;
}

.menu-field select { padding: 0 12px; }

.menu-action {
  margin-top: 8px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #22a8ee, #3677ff);
  font-weight: 800;
}

.account-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(183, 197, 220, .78);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
}

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

.account-head strong {
  color: #172235;
  font-size: 15px;
}

.account-status {
  max-width: 150px;
  overflow: hidden;
  color: #486076;
  font-size: 12px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-profile {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(61, 122, 216, .16);
  border-radius: 12px;
  color: #1b2a3d;
  background: rgba(232, 241, 255, .7);
  font-size: 13px;
  line-height: 1.3;
}

.account-profile.is-hidden { display: none; }

.account-profile strong {
  font-size: 14px;
}

.account-profile span {
  color: #5d6d82;
  overflow-wrap: anywhere;
}

.account-secondary {
  min-height: 34px;
  border: 1px solid rgba(154, 172, 201, .54);
  border-radius: 11px;
  color: #314057;
  background: rgba(255,255,255,.86);
  font: inherit;
  font-size: 13px;
  font-weight: 760;
}

.account-secondary.is-hidden { display: none; }

.account-form {
  display: grid;
  gap: 8px;
}

.account-form.is-hidden { display: none; }

.account-form label {
  display: grid;
  gap: 5px;
  color: #66748a;
  font-size: 12px;
  font-weight: 720;
}

.account-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(154, 172, 201, .54);
  border-radius: 12px;
  padding: 0 11px;
  color: #172235;
  background: rgba(255,255,255,.92);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.account-form input:focus {
  border-color: rgba(38, 167, 232, .76);
  box-shadow: 0 0 0 3px rgba(38, 167, 232, .12);
}

.account-form button {
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: #1f91d0;
  font: inherit;
  font-size: 14px;
  font-weight: 780;
}

.account-message {
  min-height: 16px;
  color: #66748a;
  font-size: 12px;
  line-height: 1.35;
}

.account-message[data-tone="error"] { color: #b84444; }
.account-message[data-tone="ok"] { color: #147447; }

body[data-platform="telegram"] .side-menu-card {
  top: 10px;
  bottom: 10px;
  left: 10px;
  width: min(340px, calc(100% - 20px));
  padding: 14px;
  border-radius: 22px;
}

body[data-platform="telegram"] .menu-field {
  gap: 5px;
  margin-bottom: 10px;
  font-size: 11px;
}

body[data-platform="telegram"] .menu-field select,
body[data-platform="telegram"] .menu-action {
  height: 42px;
  border-radius: 14px;
  font-size: 14px;
}

body[data-platform="telegram"] .menu-action {
  margin-top: 7px;
}

body[data-platform="telegram"] .account-box {
  margin-top: 12px;
  padding: 10px;
  border-radius: 14px;
}

body[data-platform="telegram"].is-keyboard-open .side-menu-card {
  bottom: 6px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.dialog-messages {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.dialog-empty-state {
  min-height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 26px 14px;
  color: #6f7c90;
  text-align: center;
  line-height: 1.35;
}

.dialog-empty-state strong {
  color: #182235;
  font-size: 17px;
}

.dialog-empty-state p {
  max-width: 240px;
  margin: 0;
  font-size: 14px;
}

.dialog-empty-state.is-new {
  color: #66758b;
}

.dialog-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(49, 100, 199, .18);
  border-top-color: #3164c7;
  border-radius: 50%;
  animation: dialog-spin 800ms linear infinite;
}

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

.conversation-picker-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dialog-menu-button,
.compose-dialog-button,
.history-refresh {
  height: 40px;
  border: 1px solid rgba(183, 197, 220, .78);
  border-radius: 14px;
  color: #172033;
  background: rgba(255,255,255,.9);
  font: inherit;
  font-size: 14px;
}

.dialog-menu-button:disabled,
.compose-dialog-button:disabled,
.history-refresh:disabled {
  cursor: wait;
  opacity: .58;
}

.dialog-menu-button,
.compose-dialog-button {
  width: 42px;
  display: grid;
  place-content: center;
  box-shadow: 0 8px 18px rgba(28, 43, 68, .1);
}

.dialog-menu-button {
  gap: 4px;
}

.dialog-menu-button span {
  width: 16px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
}

.compose-dialog-button {
  color: #3164c7;
}

.compose-dialog-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.history-refresh {
  padding: 0 12px;
  font-weight: 760;
}

.conversation-drawer {
  min-height: 0;
  display: none;
  grid-template-rows: auto 1fr;
  gap: 12px;
  overflow: hidden;
}

.dialog-panel.is-list-mode .dialog-messages {
  display: none;
}

.dialog-panel.is-list-mode .conversation-drawer {
  display: grid;
}

.conversation-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #101827;
}

.conversation-drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conversation-list {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 8px;
}

.conversation-list-status {
  padding: 14px 10px;
  color: #718096;
  text-align: center;
  font-size: 14px;
}

.conversation-list-status.is-loading {
  color: #3164c7;
}

.conversation-item {
  width: 100%;
  border: 1px solid rgba(193, 205, 224, .72);
  border-radius: 16px;
  padding: 10px 11px;
  color: #172033;
  background: rgba(255,255,255,.86);
  text-align: left;
  font: inherit;
}

.conversation-item.is-active {
  border-color: rgba(54, 119, 255, .48);
  background: rgba(231, 239, 255, .95);
}

.conversation-item-title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 780;
  font-size: 14px;
}

.conversation-item-meta {
  display: block;
  margin-top: 4px;
  color: #78859a;
  font-size: 12px;
}

.dialog-hint {
  position: absolute;
  z-index: 36;
  top: 52%;
  right: 0;
  width: 34px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 200, 224, .8);
  border-right: 0;
  border-radius: 18px 0 0 18px;
  color: #168cf0;
  background: rgba(255,255,255,.76);
  box-shadow: 0 14px 34px rgba(30, 45, 70, .14);
  backdrop-filter: blur(16px);
  transform: translateY(-50%);
  transition: opacity 180ms ease, transform 180ms ease;
}

.dialog-hint::before {
  content: "";
  width: 13px;
  height: 13px;
  margin-right: 3px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  border-radius: 2px;
  transform: rotate(-45deg);
}

.dialog-hint:active {
  transform: translateY(-50%) translateX(-2px) scale(.98);
}

.toast-host {
  position: absolute;
  z-index: 80;
  left: 50%;
  top: max(18px, env(safe-area-inset-top));
  display: grid;
  gap: 8px;
  width: min(320px, calc(100% - 48px));
  pointer-events: none;
  transform: translateX(-50%);
}

.toast-item {
  justify-self: center;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 999px;
  color: #fff;
  background: rgba(23, 32, 47, .82);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .24);
  backdrop-filter: blur(18px);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  animation: toast-in 180ms ease both;
}

.toast-item.is-error {
  background: rgba(170, 47, 55, .88);
}

.toast-item.is-leaving {
  animation: toast-out 240ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(.98); }
}

body:not([data-layout="immersive"]) .dialog-hint,
.side-menu.is-open ~ .dialog-hint,
.dialog-panel.is-open ~ .dialog-hint,
.memory-panel.is-open ~ .dialog-hint {
  opacity: 0;
  pointer-events: none;
}

.live-caption {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 96px;
  width: calc(100% - 44px);
  max-width: min(84%, 360px);
  padding: 12px 15px;
  border-radius: 20px;
  color: #101827;
  background: rgba(255,255,255,.82);
  box-shadow: 0 18px 44px rgba(20, 31, 48, .2);
  backdrop-filter: blur(18px);
  font-size: 16px;
  line-height: 1.25;
  opacity: 0;
  transform: translate(-50%, 18px) scale(.98);
  transition: opacity 240ms ease, transform 240ms ease;
  pointer-events: none;
}

.live-caption.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.live-caption.is-leaving {
  opacity: 0;
  transform: translate(62vw, 0) scale(.98);
  transition: opacity 360ms ease, transform 520ms cubic-bezier(.5,0,.7,1);
}

body[data-bg="none"] .stage-bg { background: transparent; }
body[data-bg="none"] .stage-bg::after { opacity: .32; }
body[data-bg="soft"] .stage-bg {
  background:
    radial-gradient(circle at 50% 10%, rgba(255,255,255,.92), rgba(255,255,255,.3) 30%, transparent 54%),
    linear-gradient(180deg, #edf4fb, #d7e3f0 62%, #c4d3e2);
}
body[data-bg="studio"] .stage-bg {
  background:
    radial-gradient(circle at 50% 4%, rgba(255,255,255,.75) 0 12%, transparent 42%),
    linear-gradient(155deg, #263143, #63758c);
}
body[data-bg="gradient"] .stage-bg {
  background:
    radial-gradient(circle at 76% 15%, rgba(255,214,176,.62), transparent 34%),
    radial-gradient(circle at 24% 28%, rgba(135,207,255,.5), transparent 42%),
    linear-gradient(158deg, #eef8ff, #f8efe6 48%, #dfeaff);
}

body[data-layout="immersive"] {
  background: #eef4fa;
}

body[data-layout="immersive"] .phone-shell {
  position: relative;
  width: min(460px, 100%);
  height: min(930px, 100vh);
  grid-template-rows: 1fr auto;
  gap: 0;
  padding: 0;
  border-radius: 0;
  background: #eef4fa;
}

body[data-platform="telegram"][data-layout="immersive"] .phone-shell {
  width: 100%;
  height: var(--app-height, 100dvh);
  min-height: var(--app-height, 100dvh);
}

body[data-layout="immersive"] .topbar {
  display: none;
}

body[data-layout="immersive"] .avatar-stage {
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 0;
  border-radius: 0;
  min-height: 100%;
  box-shadow: none;
}

body[data-layout="immersive"] .avatar-canvas,
body[data-layout="immersive"] .avatar-video {
  height: 88%;
  bottom: 78px;
}

body[data-layout="immersive"] .chat {
  position: absolute;
  right: 12px;
  bottom: 90px;
  width: min(320px, calc(100% - 24px));
  max-height: 36vh;
  opacity: 0;
  pointer-events: none;
  transform: translateX(105%);
}

body[data-layout="immersive"] .empty-chat {
  display: none;
}

body[data-layout="immersive"] .composer {
  position: absolute;
  z-index: 35;
  left: 12px;
  right: 12px;
  bottom: max(10px, env(safe-area-inset-bottom));
  grid-template-columns: 46px 44px 1fr 52px;
  padding: 0;
}

body[data-layout="immersive"] .voice-status {
  left: 92px;
  right: 72px;
  top: auto;
  bottom: calc(64px + max(10px, env(safe-area-inset-bottom)));
  max-width: none;
  min-height: 22px;
  padding: 5px 10px;
  border: 1px solid rgba(190, 205, 227, .72);
  border-radius: 999px;
  color: #607086;
  background: rgba(255,255,255,.72);
  box-shadow: 0 10px 24px rgba(30, 45, 70, .1);
  backdrop-filter: blur(16px);
  font-size: 12px;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

body[data-layout="immersive"] .voice-status.is-visible {
  display: block;
}

body[data-layout="immersive"][data-voice-debug="true"] .voice-status {
  bottom: calc(66px + max(10px, env(safe-area-inset-bottom)));
  min-height: 26px;
  padding: 6px 10px;
  font-size: 12px;
}

body[data-layout="immersive"] .composer input {
  height: 54px;
  border-radius: 22px;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 34px rgba(30, 45, 70, .14);
}

body[data-layout="immersive"] .send {
  width: 52px;
  height: 52px;
}

body[data-layout="immersive"][data-scene="reel"] .reels-tray,
body[data-layout="immersive"][data-scene="place"] .reels-tray {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
}

body[data-layout="immersive"][data-scene="reel"] .avatar-stage,
body[data-layout="immersive"][data-scene="place"] .avatar-stage {
  z-index: 34;
  top: auto;
  left: auto;
  right: 18px;
  bottom: calc(86px + max(10px, env(safe-area-inset-bottom)));
  width: 112px;
  height: 112px;
  min-height: 0;
  border: 2px solid rgba(255,255,255,.92);
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body[data-layout="immersive"][data-scene="reel"] .avatar-stage .stage-bg,
body[data-layout="immersive"][data-scene="place"] .avatar-stage .stage-bg {
  display: none;
}

body[data-layout="immersive"][data-scene="reel"] .avatar-stage .stage-bg::after,
body[data-layout="immersive"][data-scene="place"] .avatar-stage .stage-bg::after {
  display: none;
}

body[data-layout="immersive"][data-scene="reel"] .avatar-canvas,
body[data-layout="immersive"][data-scene="reel"] .avatar-video,
body[data-layout="immersive"][data-scene="place"] .avatar-canvas,
body[data-layout="immersive"][data-scene="place"] .avatar-video {
  height: 300%;
  bottom: -192%;
  border-radius: 0;
  clip-path: none;
  filter: none;
}

body[data-layout="immersive"][data-scene="reel"] .live-caption,
body[data-layout="immersive"][data-scene="place"] .live-caption {
  display: none;
}

body[data-layout="immersive"][data-scene="reel"] .menu-button,
body[data-layout="immersive"][data-scene="reel"] .dialog-hint,
body[data-layout="immersive"][data-scene="reel"] .nearby-button,
body[data-layout="immersive"][data-scene="reel"] .places-panel,
body[data-layout="immersive"][data-scene="place"] .menu-button,
body[data-layout="immersive"][data-scene="place"] .nearby-button,
body[data-layout="immersive"][data-scene="place"] .places-panel {
  opacity: 0;
  pointer-events: none;
}

body[data-layout="immersive"][data-scene="reel"] .avatar-stage,
body[data-layout="immersive"][data-scene="place"] .avatar-stage {
  overflow: hidden;
}

body[data-layout="immersive"][data-scene="reel"] .avatar-stage::before,
body[data-layout="immersive"][data-scene="place"] .avatar-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 48% 26%, #687586, #263143 72%);
}

body[data-layout="immersive"][data-scene="reel"] .composer,
body[data-layout="immersive"][data-scene="place"] .composer {
  left: 12px;
  right: 12px;
  grid-template-columns: 46px 44px minmax(0, 1fr) 52px;
}

body[data-layout="immersive"][data-scene="reel"] .voice-status,
body[data-layout="immersive"][data-scene="place"] .voice-status {
  display: none !important;
}

@media (max-width: 380px) {
  body[data-layout="immersive"][data-scene="reel"] .avatar-stage,
  body[data-layout="immersive"][data-scene="place"] .avatar-stage {
    right: 12px;
    width: 102px;
    height: 102px;
  }

  body[data-layout="immersive"][data-scene="reel"] .composer,
  body[data-layout="immersive"][data-scene="place"] .composer {
    grid-template-columns: 42px 40px minmax(0, 1fr) 48px;
  }

  .world-scene-card {
    left: 12px;
    right: 122px;
    bottom: calc(148px + max(10px, env(safe-area-inset-bottom)));
  }
}

@media (max-height: 760px) {
  body[data-layout="immersive"] .avatar-canvas,
  body[data-layout="immersive"] .avatar-video {
    height: 84%;
    bottom: 74px;
  }
}

@media (max-height: 760px) {
  .live-caption {
    bottom: 88px;
    font-size: 15px;
  }
}
body[data-bg="image"] .stage-bg {
  background-image: var(--custom-stage-bg-image);
  background-size: cover;
  background-position: center;
}
body[data-bg="image"] .stage-bg::after { opacity: .28; }
body[data-bg="none"] .avatar-stage {
  background: transparent;
}
body[data-layout="immersive"][data-bg="none"] .phone-shell {
  background: linear-gradient(180deg, #f6fbff, #eef4fa);
}
body[data-platform="telegram"][data-layout="immersive"] .mode-badge {
  display: none;
}
