:root {
  color-scheme: dark;
  --bg: #020308;
  --glass: rgba(7, 10, 18, .42);
  --glass2: rgba(8, 11, 20, .72);
  --line: rgba(255,255,255,.13);
  --text: #f7f8fb;
  --muted: #aab2c8;
  --accent: #64e8ff;
  --ok: #48e6a0;
  --warn: #ffd166;
  --bad: #ff5f7e;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #000;
  color: var(--text);
  overflow: hidden;
}
.stage-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  background: #000;
}
.video-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
}
.video-frame {
  position: absolute;
  inset: 0;
  border-radius: 0;
  overflow: hidden;
  border: 0;
  background: #000;
}
.unreal-video, .unreal-frame, .unreal-mjpeg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  background: #000;
  z-index: 1;
}
.unreal-video[hidden], .unreal-frame[hidden], .unreal-mjpeg[hidden], .video-fallback[hidden], .stream-shield[hidden], .stream-unlock[hidden] { display: none !important; }
.stream-shield {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: transparent;
  cursor: not-allowed;
}
.stream-unlock {
  position: absolute;
  left: 68px;
  top: 14px;
  z-index: 7;
  color: rgba(235, 242, 255, .9);
  background: rgba(5, 8, 16, .55);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 11px;
  backdrop-filter: blur(14px);
}
.video-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.72)),
    radial-gradient(circle at 50% 48%, rgba(100,232,255,.22), transparent 18rem),
    radial-gradient(circle at 76% 16%, rgba(139,92,246,.26), transparent 22rem),
    linear-gradient(135deg, #0b1020, #111827 48%, #06070b);
}
.video-fallback::before { content: ""; position: absolute; inset: 9%; border-radius: 34px; background: linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px) 0 0 / 72px 72px, linear-gradient(0deg, rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 72px 72px; border: 1px solid rgba(255,255,255,.10); }
.signal-ring { width: min(36vw, 380px); aspect-ratio: 1; border-radius: 50%; position: relative; z-index: 1; border: 1px solid rgba(100,232,255,.25); box-shadow: 0 0 90px rgba(100,232,255,.14), inset 0 0 90px rgba(139,92,246,.10); animation: pulse 3s ease-in-out infinite; }
.signal-ring::after { content: "LIVE"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: rgba(255,255,255,.22); font-weight: 900; letter-spacing: .3em; }
.fallback-copy { position: absolute; z-index: 2; left: 42px; bottom: 36px; max-width: 560px; padding: 18px 20px; border: 1px solid rgba(255,255,255,.12); border-radius: 24px; background: rgba(5,7,14,.48); backdrop-filter: blur(18px); }
.fallback-copy h1 { margin: 0 0 8px; font-size: clamp(42px, 6vw, 82px); line-height: .88; }
.fallback-copy p:last-child { margin: 0; color: var(--muted); line-height: 1.45; }
@keyframes pulse { 0%,100% { transform: scale(.98); opacity:.72; } 50% { transform: scale(1.03); opacity:1; } }
.topbar {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  pointer-events: none;
  text-shadow: 0 2px 18px rgba(0,0,0,.82);
}
.topbar > div:first-child {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 360px));
  text-align: center;
}
.eyebrow { margin: 0 0 4px; color: rgba(182,245,255,.94); letter-spacing: .22em; text-transform: uppercase; font-size: clamp(15px, 1.7vw, 24px); font-weight: 950; }
h2 { margin: 0; font-size: clamp(26px, 3.1vw, 46px); line-height: .95; letter-spacing: -.035em; font-weight: 950; }

.logout-btn {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  pointer-events: auto;
  color: rgba(245, 248, 255, .94);
  background: rgba(5, 8, 16, .56);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  padding: 10px 14px;
  min-width: 64px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: 0 14px 34px rgba(0,0,0,.35);
  backdrop-filter: blur(14px);
}
.logout-btn:hover { border-color: rgba(100,232,255,.65); color: #fff; }
.logout-btn:disabled { opacity: .7; cursor: wait; }

.micro-status {
  position: absolute;
  right: 0;
  top: 0;
  pointer-events: none;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 11px;
  background: rgba(5,8,15,.44);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  backdrop-filter: blur(18px);
  color: rgba(232,238,255,.86);
  font-size: 12px;
  max-width: 56vw;
  flex-wrap: wrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 14px currentColor; flex: 0 0 auto; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.live-badge { color: #03120b; background: linear-gradient(135deg, var(--ok), #b6ffd9); border: 1px solid rgba(255,255,255,.34); border-radius: 999px; padding: 4px 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; font-size: 10px; box-shadow: 0 0 22px rgba(72,230,160,.24); }
.live-badge[hidden] { display: none !important; }

body.home-mode .chat-dock { display: none !important; }
body.home-mode .stream-unlock,
body.home-mode .stream-shield { display: none !important; }
.landing-panel {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 38%, rgba(100,232,255,.10), transparent 26rem),
    linear-gradient(180deg, rgba(0,0,0,.20), rgba(0,0,0,.60));
}
body:not(.home-mode) .landing-panel { display: none !important; }
.landing-card {
  width: min(760px, calc(100vw - 32px));
  pointer-events: auto;
  text-align: center;
  padding: clamp(24px, 4.2vw, 46px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(7,10,20,.72), rgba(4,6,12,.52));
  box-shadow: 0 28px 110px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(22px) saturate(1.18);
}
.landing-kicker {
  margin: 0 0 14px;
  color: rgba(182,245,255,.96);
  letter-spacing: .24em;
  text-transform: uppercase;
  font-size: clamp(12px, 1.5vw, 15px);
  font-weight: 950;
}
.landing-card h1 {
  margin: 0 auto 14px;
  max-width: 740px;
  font-size: clamp(34px, 5.4vw, 74px);
  line-height: .94;
  letter-spacing: -.055em;
  font-weight: 950;
}
.landing-copy {
  margin: 0 auto 24px;
  max-width: 620px;
  color: rgba(226,233,249,.82);
  font-size: clamp(15px, 1.6vw, 20px);
  line-height: 1.45;
}
.landing-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.landing-primary,
.landing-secondary {
  min-height: 50px;
  border-radius: 999px;
  padding: 0 24px;
  pointer-events: auto;
  box-shadow: 0 16px 42px rgba(0,0,0,.38);
}
.landing-primary {
  color: #041017;
  background: linear-gradient(135deg, var(--accent), #b5fbff);
}
.landing-secondary {
  color: var(--text);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
}
.landing-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.landing-pills span {
  color: rgba(235,242,255,.86);
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.chat-dock {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 190px));
  max-height: 46vh;
  background: rgba(5, 8, 16, .56);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 20px;
  box-shadow: 0 18px 70px rgba(0,0,0,.46);
  backdrop-filter: blur(20px) saturate(1.08);
  overflow: hidden;
}
.conversation {
  max-height: 92px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 9px 11px 0;
  display: grid;
  gap: 5px;
}
.conversation::-webkit-scrollbar { width: 8px; }
.conversation::-webkit-scrollbar-track { background: rgba(255,255,255,.05); border-radius: 999px; }
.conversation::-webkit-scrollbar-thumb { background: rgba(170,178,200,.42); border-radius: 999px; }
.conversation::-webkit-scrollbar-thumb:hover { background: rgba(100,232,255,.58); }
.bubble { max-width: 78%; border: 1px solid rgba(255,255,255,.10); border-radius: 13px; padding: 5px 9px; background: rgba(255,255,255,.052); }
.bubble span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1px; }
.bubble p { margin: 0; line-height: 1.22; font-size: 12px; }
.bubble.user { margin-left: auto; background: rgba(100,232,255,.11); }
.bubble.assistant { margin-right: auto; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px 9px; }
textarea, input[type="url"] {
  width: 100%;
  resize: none;
  max-height: 76px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(1,3,10,.68);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  outline: none;
  font: inherit;
}
textarea:focus, input[type="url"]:focus { border-color: rgba(100,232,255,.85); box-shadow: 0 0 0 4px rgba(100,232,255,.12); }
.composer-actions { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: row; gap: 10px; align-items: center; z-index: 45; }
button { border: 0; cursor: pointer; font: inherit; font-weight: 800; }
.icon-btn, .secondary, .tiny-btn { color: var(--text); background: rgba(28,31,42,.76); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 0; min-width: 46px; width: 46px; height: 46px; display: inline-grid; place-items: center; box-shadow: 0 14px 34px rgba(0,0,0,.35); backdrop-filter: blur(14px); }
.tiny-btn { min-width: 46px; width: 46px; height: 46px; font-size: 18px; pointer-events: auto; }
.icon-btn span { display: none; }
.icon-btn.active { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(100,232,255,.12); }
.send-btn { color: #041017; background: linear-gradient(135deg, var(--accent), #9bf6ff); border-radius: 999px; padding: 0 22px; min-width: 92px; height: 46px; box-shadow: 0 14px 34px rgba(0,0,0,.35); }
button:disabled { opacity: .55; cursor: wait; }
.advanced { display: none !important; }
.advanced summary { color: var(--muted); cursor: pointer; padding: 10px 2px; font-size: 12px; }
.advanced-grid { display: grid; grid-template-columns: 1fr 1.3fr auto auto 1fr 1.3fr auto; gap: 10px; align-items: end; }
label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.field-hint { color: rgba(214,222,243,.72); font-size: 10px; line-height: 1.25; overflow-wrap: anywhere; }
select { width: 100%; border: 1px solid rgba(255,255,255,.12); background: rgba(1,3,10,.72); color: var(--text); border-radius: 14px; padding: 10px; }
.take-meta { display: grid; gap: 2px; min-width: 0; }
.take-meta strong, .take-meta small { overflow-wrap: anywhere; }
.take-meta small, .meta-list, .log { color: var(--muted); }
audio { width: 100%; height: 36px; }
.meta-list { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 14px; margin: 10px 0 0; font-size: 12px; }
.meta-list div { min-width: 0; } dt { color: #d6def3; } dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.log { white-space: pre-wrap; max-height: 80px; overflow: auto; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.10); border-radius: 14px; padding: 9px; }
@media (max-width: 1100px) { .advanced-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 780px) {
  .landing-card { border-radius: 24px; padding: 24px 18px; }
  .landing-card h1 { font-size: clamp(32px, 10vw, 48px); }
  .landing-copy { font-size: 15px; }
  .landing-actions { gap: 9px; }
  .landing-primary, .landing-secondary { width: 100%; min-height: 48px; }

  .logout-btn { left: max(12px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); min-width: 58px; height: 38px; padding: 8px 11px; font-size: 11px; }

  body { overflow: hidden; }
  .topbar { left: 10px; right: 10px; top: 10px; display: flex; justify-content: center; }
  .topbar > div:first-child { top: 0; width: calc(100vw - 20px); }
  .eyebrow { font-size: clamp(13px, 4.4vw, 18px); letter-spacing: .18em; line-height: 1.18; }
  .micro-status { display: none; }
  h2 { font-size: 26px; }
  .chat-dock {
    width: calc(100vw - 20px);
    left: 10px;
    right: 10px;
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: none;
    border-radius: 18px;
    max-height: 28vh;
    background: rgba(5,8,16,.70);
  }
  .conversation { max-height: 58px; padding: 7px 9px 0; gap: 4px; }
  .bubble { padding: 4px 8px; border-radius: 12px; }
  .bubble p { font-size: 14px; line-height: 1.18; }
  .bubble span { font-size: 8px; }
  .composer { position: relative; display: block; padding: 6px 7px 7px; }
  textarea { min-height: 50px; height: 50px; max-height: 50px; padding: 13px 222px 10px 12px; border-radius: 16px; font-size: 15px; line-height: 1.15; }
  .composer-actions { position: absolute; right: 12px; bottom: 12px; gap: 6px; z-index: 46; }
  .icon-btn, .tiny-btn { min-width: 42px; width: 42px; height: 42px; font-size: 17px; }
  .send-btn { min-width: 78px; height: 42px; padding: 0 14px; font-size: 15px; }
  .advanced-grid, .meta-list { grid-template-columns: 1fr; }
}
@media (max-width: 390px) {
  .eyebrow { font-size: 12px; letter-spacing: .16em; }
  textarea { padding-right: 205px; }
  .icon-btn, .tiny-btn { min-width: 38px; width: 38px; height: 38px; }
  .send-btn { min-width: 72px; height: 38px; padding: 0 12px; }
  .composer-actions { right: 10px; bottom: 13px; gap: 5px; }
}

/* responsive-polish: landing scales for mobile/PC screenshots, logout always bottom-left */
html, body { min-height: 100%; }
body.home-mode { overflow: hidden; }
body.home-mode .logout-btn,
.logout-btn {
  position: fixed !important;
  top: auto !important;
  right: auto !important;
  left: max(18px, env(safe-area-inset-left)) !important;
  bottom: max(22px, env(safe-area-inset-bottom)) !important;
  z-index: 80 !important;
  opacity: .96;
  background: rgba(5,8,16,.72);
}
.landing-panel {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  align-items: center;
  justify-items: center;
  padding: clamp(16px, 3.2svh, 34px) clamp(14px, 2.6vw, 28px) calc(max(84px, env(safe-area-inset-bottom) + 72px)) clamp(14px, 2.6vw, 28px);
}
.landing-card {
  width: min(720px, calc(100vw - 40px));
  max-height: calc(100dvh - 132px);
  overflow: auto;
  scrollbar-width: thin;
}
.landing-card h1 { text-wrap: balance; }
.landing-copy { text-wrap: pretty; }

@media (min-width: 781px) and (max-height: 760px) {
  .landing-panel { padding-top: 18px; padding-bottom: 78px; }
  .landing-card { max-width: 620px; padding: 24px 30px; }
  .landing-kicker { margin-bottom: 8px; font-size: 12px; }
  .landing-card h1 { font-size: clamp(34px, 4.4vw, 56px); margin-bottom: 10px; line-height: .96; }
  .landing-copy { font-size: 16px; margin-bottom: 16px; line-height: 1.35; }
  .landing-actions { margin-bottom: 12px; }
  .landing-primary, .landing-secondary { min-height: 46px; }
  .landing-pills span { padding: 6px 9px; font-size: 10px; }
}

@media (max-width: 780px) {
  body.home-mode .topbar { display: none !important; }
  .landing-panel {
    place-items: start center;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: calc(max(74px, env(safe-area-inset-bottom) + 62px));
    background:
      radial-gradient(circle at 50% 18%, rgba(100,232,255,.12), transparent 17rem),
      linear-gradient(180deg, rgba(0,0,0,.22), rgba(0,0,0,.66));
  }
  .landing-card {
    width: min(540px, calc(100vw - 24px));
    max-height: calc(100dvh - 104px);
    border-radius: 22px;
    padding: clamp(18px, 4.2vw, 24px) clamp(16px, 4.2vw, 22px);
  }
  .landing-kicker {
    margin-bottom: 10px;
    font-size: clamp(10px, 3.1vw, 12px);
    letter-spacing: .18em;
    line-height: 1.22;
  }
  .landing-card h1 {
    max-width: 10.6em;
    font-size: clamp(30px, 8.6vw, 42px);
    line-height: .98;
    letter-spacing: -.06em;
    margin-bottom: 12px;
  }
  .landing-copy {
    max-width: 27em;
    font-size: clamp(14px, 3.75vw, 16px);
    line-height: 1.38;
    margin-bottom: 18px;
  }
  .landing-actions { gap: 8px; margin-bottom: 14px; }
  .landing-primary,
  .landing-secondary {
    width: min(100%, 430px);
    min-height: 48px;
    padding: 0 18px;
    font-size: 16px;
  }
  .landing-pills { gap: 7px; max-width: 420px; margin: 0 auto; }
  .landing-pills span { padding: 6px 9px; font-size: 10px; letter-spacing: .035em; }
  .logout-btn {
    left: max(14px, env(safe-area-inset-left)) !important;
    bottom: max(18px, env(safe-area-inset-bottom)) !important;
    min-width: 56px;
    height: 36px;
    padding: 7px 10px;
    font-size: 10px;
    background: rgba(5,8,16,.82);
    border-color: rgba(255,255,255,.22);
  }
}

@media (max-width: 390px), (max-height: 700px) and (max-width: 780px) {
  .landing-panel { padding-top: 8px; padding-bottom: 64px; }
  .landing-card { max-height: calc(100dvh - 82px); padding: 16px 14px; border-radius: 20px; }
  .landing-kicker { font-size: 9.5px; margin-bottom: 7px; letter-spacing: .16em; }
  .landing-card h1 { font-size: clamp(27px, 8.1vw, 36px); margin-bottom: 9px; line-height: 1; }
  .landing-copy { font-size: 13.5px; line-height: 1.32; margin-bottom: 13px; }
  .landing-primary, .landing-secondary { min-height: 44px; font-size: 15px; }
  .landing-actions { margin-bottom: 10px; }
  .landing-pills span { font-size: 9px; padding: 5px 8px; }
  .logout-btn { bottom: max(10px, env(safe-area-inset-bottom)) !important; height: 34px; min-width: 52px; font-size: 9.5px; }
}

/* mobile final polish: keep logout visible above mobile browser chrome; hide secondary cards on home */
body.home-mode .advanced-panel,
body.home-mode .video-panel,
body.home-mode .info-panel,
body.home-mode .panel,
body.home-mode .control-panel,
body.home-mode .side-panel {
  display: none !important;
}
@media (max-width: 780px) {
  body.home-mode .logout-btn,
  .logout-btn {
    bottom: max(76px, calc(env(safe-area-inset-bottom) + 62px)) !important;
    left: max(14px, env(safe-area-inset-left)) !important;
    opacity: .98;
  }
}
@media (max-height: 700px) and (max-width: 780px) {
  body.home-mode .logout-btn,
  .logout-btn { bottom: max(58px, calc(env(safe-area-inset-bottom) + 48px)) !important; }
}

/* home-clean final: keep logout visible, hide generic fallback panels while landing is open */
body.home-mode #videoFallback,
body.home-mode .video-fallback,
body.home-mode .fallback-copy {
  display: none !important;
}
@media (max-width: 780px) {
  body.home-mode .topbar {
    display: block !important;
    pointer-events: none;
  }
  body.home-mode .topbar > div:first-child,
  body.home-mode .topbar .micro-status {
    display: none !important;
  }
  body.home-mode .logout-btn,
  .logout-btn {
    display: inline-grid !important;
    pointer-events: auto !important;
    bottom: max(76px, calc(env(safe-area-inset-bottom) + 62px)) !important;
    left: max(14px, env(safe-area-inset-left)) !important;
  }
}

/* demo-personality: optional demo name field */
.landing-name {
  width: min(100%, 420px);
  margin: 0 auto 16px;
  display: grid;
  gap: 6px;
  text-align: left;
  color: rgba(226,233,249,.78);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.landing-name input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  padding: 0 18px;
  color: var(--text);
  background: rgba(255,255,255,.075);
  outline: none;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.landing-name input::placeholder { color: rgba(226,233,249,.48); }
.landing-name input:focus {
  border-color: rgba(100,232,255,.55);
  box-shadow: 0 0 0 3px rgba(100,232,255,.12), inset 0 1px 0 rgba(255,255,255,.08);
}
@media (max-width: 780px) {
  .landing-name { margin-bottom: 12px; }
  .landing-name input { min-height: 44px; font-size: 14px; }
}
@media (max-width: 390px), (max-height: 700px) and (max-width: 780px) {
  .landing-name { margin-bottom: 9px; gap: 4px; font-size: 9.5px; }
  .landing-name input { min-height: 40px; padding: 0 14px; font-size: 13.5px; }
}



/* mobile-closeup-fix: restore old mobile avatar framing (crop/cover instead of full landscape contain) */
@media (max-width: 780px) and (orientation: portrait) {
  body:not(.home-mode) .video-stage,
  body:not(.home-mode) .video-frame {
    overflow: hidden !important;
    background: #000 !important;
  }

  body:not(.home-mode) .unreal-frame {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transform: scale(1.78) translateY(-2.5vh);
    transform-origin: 50% 48%;
    will-change: transform;
  }
}


/* mobile-chat-blob-fix: remove the dark chat window over the avatar; keep only composer controls */
@media (max-width: 780px) {
  body:not(.home-mode) .chat-dock {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    overflow: visible !important;
    max-height: none !important;
  }

  body:not(.home-mode) .conversation {
    display: none !important;
  }

  body:not(.home-mode) .composer {
    border-radius: 20px !important;
    background: rgba(5, 8, 16, .42) !important;
    border: 1px solid rgba(100, 232, 255, .45) !important;
    box-shadow: 0 10px 36px rgba(0,0,0,.30) !important;
    backdrop-filter: blur(14px) saturate(1.05) !important;
  }
}




/* desktop-safe-stage: keep PC stream natural; Pixel UI is hidden inside iframe by JS */
@media (min-width: 781px) {
  body:not(.home-mode) .video-stage,
  body:not(.home-mode) .video-frame {
    overflow: hidden !important;
    background: #000 !important;
  }
  body:not(.home-mode) .unreal-frame {
    transform: none !important;
    width: 100% !important;
    height: 100% !important;
  }
}

/* format-fix-20260615: videollamada 16:9 centrada para Pixel Streaming */
body:not(.home-mode) {
  background: #000;
}
body:not(.home-mode) .video-stage {
  display: grid;
  place-items: center;
  padding: max(58px, env(safe-area-inset-top) + 48px) clamp(10px, 2vw, 24px) max(132px, env(safe-area-inset-bottom) + 116px);
  background:
    radial-gradient(circle at 50% 35%, rgba(100,232,255,.08), transparent 26rem),
    #000;
}
body:not(.home-mode) .video-frame {
  position: relative;
  inset: auto;
  width: min(100%, calc((100vh - 210px) * 16 / 9));
  max-width: min(1500px, calc(100vw - 28px));
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 24px 90px rgba(0,0,0,.72), 0 0 0 1px rgba(100,232,255,.08);
  background: #000;
}
body:not(.home-mode) .unreal-video,
body:not(.home-mode) .unreal-frame,
body:not(.home-mode) .unreal-mjpeg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  background: #000;
}
body:not(.home-mode) .video-fallback {
  inset: 0;
}
body:not(.home-mode) .topbar {
  top: max(10px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
}
body:not(.home-mode) .topbar > div:first-child {
  top: 0;
  width: min(760px, calc(100vw - 260px));
}
body:not(.home-mode) .eyebrow {
  font-size: clamp(12px, 1.15vw, 17px);
}
body:not(.home-mode) .micro-status {
  transform: scale(.92);
  transform-origin: top right;
  max-width: min(560px, 52vw);
}
body:not(.home-mode) .chat-dock {
  width: min(760px, calc(100vw - 178px));
  max-height: 118px;
  bottom: max(14px, env(safe-area-inset-bottom));
  background: rgba(5,8,16,.72);
}
body:not(.home-mode) .conversation {
  max-height: 42px;
}
body:not(.home-mode) .composer {
  grid-template-columns: 1fr auto;
}
body:not(.home-mode) textarea {
  height: 48px;
  max-height: 48px;
}
body:not(.home-mode) .composer-actions {
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
}
body:not(.home-mode) .logout-btn {
  bottom: max(18px, env(safe-area-inset-bottom)) !important;
}
@media (max-width: 780px) {
  body:not(.home-mode) .video-stage {
    padding: max(54px, env(safe-area-inset-top) + 46px) 8px max(178px, env(safe-area-inset-bottom) + 164px);
  }
  body:not(.home-mode) .video-frame {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    border-radius: 14px;
  }
  body:not(.home-mode) .topbar > div:first-child { width: calc(100vw - 24px); }
  body:not(.home-mode) .chat-dock {
    width: calc(100vw - 18px);
    max-height: 150px;
    bottom: max(72px, env(safe-area-inset-bottom) + 66px);
  }
  body:not(.home-mode) .conversation { max-height: 48px; }
  body:not(.home-mode) textarea { height: 52px; max-height: 52px; padding-right: 210px; }
}

/* mobile-format-fix-20260615: móvil vertical en 9:16, PC intacto */
@media (max-width: 780px) and (orientation: portrait) {
  body:not(.home-mode) .video-stage {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: max(42px, env(safe-area-inset-top) + 34px) 8px max(188px, env(safe-area-inset-bottom) + 176px) !important;
    overflow: hidden !important;
  }
  body:not(.home-mode) .video-frame {
    position: relative !important;
    inset: auto !important;
    width: min(calc(100vw - 16px), calc((100dvh - 240px) * 9 / 16)) !important;
    max-width: calc(100vw - 16px) !important;
    height: auto !important;
    max-height: calc(100dvh - 240px) !important;
    aspect-ratio: 9 / 16 !important;
    border-radius: 18px !important;
    background: #000 !important;
  }
  body:not(.home-mode) .unreal-frame {
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    width: 177.7778% !important;
    max-width: none !important;
    height: 100% !important;
    transform: translateX(-50%) !important;
    transform-origin: center center !important;
    border: 0 !important;
    background: #000 !important;
  }
  body:not(.home-mode) .unreal-video,
  body:not(.home-mode) .unreal-mjpeg {
    object-fit: cover !important;
    object-position: center center !important;
  }
  body:not(.home-mode) .topbar {
    top: max(6px, env(safe-area-inset-top)) !important;
    left: 8px !important;
    right: 8px !important;
    height: 34px !important;
  }
  body:not(.home-mode) .topbar > div:first-child {
    top: 0 !important;
    width: calc(100vw - 16px) !important;
  }
  body:not(.home-mode) .eyebrow {
    font-size: clamp(10px, 3vw, 13px) !important;
    letter-spacing: .18em !important;
    white-space: nowrap !important;
  }
  body:not(.home-mode) .micro-status {
    display: none !important;
  }
  body:not(.home-mode) .chat-dock {
    left: 8px !important;
    right: 8px !important;
    bottom: max(64px, env(safe-area-inset-bottom) + 58px) !important;
    transform: none !important;
    width: auto !important;
    max-height: 126px !important;
    border-radius: 18px !important;
  }
  body:not(.home-mode) .conversation {
    display: none !important;
  }
  body:not(.home-mode) .composer {
    display: block !important;
    padding: 7px !important;
  }
  body:not(.home-mode) textarea {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    padding: 14px 202px 10px 12px !important;
    font-size: 14px !important;
  }
  body:not(.home-mode) .composer-actions {
    position: absolute !important;
    right: 14px !important;
    bottom: 13px !important;
    gap: 6px !important;
  }
  body:not(.home-mode) .icon-btn,
  body:not(.home-mode) .tiny-btn {
    min-width: 38px !important;
    width: 38px !important;
    height: 38px !important;
    font-size: 15px !important;
  }
  body:not(.home-mode) .send-btn {
    min-width: 70px !important;
    height: 38px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
  }
  body:not(.home-mode) .logout-btn {
    left: max(10px, env(safe-area-inset-left)) !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    height: 38px !important;
    min-width: 56px !important;
    font-size: 10px !important;
    z-index: 90 !important;
  }
}
@media (max-width: 780px) and (orientation: landscape) {
  body:not(.home-mode) .video-stage {
    padding: 42px 8px 104px !important;
  }
  body:not(.home-mode) .video-frame {
    width: min(calc(100vw - 16px), calc((100dvh - 150px) * 16 / 9)) !important;
    aspect-ratio: 16 / 9 !important;
  }
  body:not(.home-mode) .chat-dock {
    bottom: 10px !important;
    max-height: 82px !important;
  }
  body:not(.home-mode) .conversation { display: none !important; }
}

/* mobile-tune-20260615: ventana móvil más grande y avatar más centrado */
@media (max-width: 780px) and (orientation: portrait) {
  body:not(.home-mode) .video-stage {
    padding: max(34px, env(safe-area-inset-top) + 26px) 4px max(152px, env(safe-area-inset-bottom) + 140px) !important;
  }
  body:not(.home-mode) .video-frame {
    width: min(calc(100vw - 8px), calc((100dvh - 186px) * 9 / 16)) !important;
    max-width: calc(100vw - 8px) !important;
    max-height: calc(100dvh - 186px) !important;
    border-radius: 18px !important;
  }
  body:not(.home-mode) .unreal-frame {
    top: 2.4% !important;
    height: 100% !important;
    width: 177.7778% !important;
  }
  body:not(.home-mode) .topbar {
    top: max(3px, env(safe-area-inset-top)) !important;
    height: 28px !important;
  }
  body:not(.home-mode) .eyebrow {
    font-size: clamp(9px, 2.65vw, 12px) !important;
    letter-spacing: .20em !important;
  }
  body:not(.home-mode) .chat-dock {
    bottom: max(58px, env(safe-area-inset-bottom) + 52px) !important;
    left: 8px !important;
    right: 8px !important;
    max-height: 116px !important;
  }
  body:not(.home-mode) textarea {
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
  }
}
@media (max-width: 430px) and (orientation: portrait) {
  body:not(.home-mode) .video-frame {
    width: min(calc(100vw - 6px), calc((100dvh - 176px) * 9 / 16)) !important;
    max-height: calc(100dvh - 176px) !important;
  }
  body:not(.home-mode) .video-stage {
    padding-top: max(30px, env(safe-area-inset-top) + 22px) !important;
    padding-bottom: max(148px, env(safe-area-inset-bottom) + 136px) !important;
  }
}

/* mobile-center-20260615: bajar ligeramente el encuadre vertical del avatar */
@media (max-width: 780px) and (orientation: portrait) {
  body:not(.home-mode) .unreal-frame {
    top: 5.2% !important;
  }
  body:not(.home-mode) .unreal-video,
  body:not(.home-mode) .unreal-mjpeg {
    object-position: center 54% !important;
  }
}

/* mobile-natural-20260615: menos macro-zoom, avatar centrado natural */
@media (max-width: 780px) and (orientation: portrait) {
  body:not(.home-mode) .video-stage {
    padding: max(34px, env(safe-area-inset-top) + 26px) 6px max(150px, env(safe-area-inset-bottom) + 138px) !important;
  }
  body:not(.home-mode) .video-frame {
    width: min(calc(100vw - 12px), calc((100dvh - 184px) * 10 / 16)) !important;
    max-width: calc(100vw - 12px) !important;
    aspect-ratio: 10 / 16 !important;
    max-height: calc(100dvh - 184px) !important;
    border-radius: 18px !important;
  }
  body:not(.home-mode) .unreal-frame {
    left: 50% !important;
    top: -4% !important;
    width: 150% !important;
    height: 100% !important;
    transform: translateX(-50%) !important;
    transform-origin: center center !important;
  }
  body:not(.home-mode) .unreal-video,
  body:not(.home-mode) .unreal-mjpeg {
    object-fit: cover !important;
    object-position: center 49% !important;
  }
}
@media (max-width: 430px) and (orientation: portrait) {
  body:not(.home-mode) .video-frame {
    width: min(calc(100vw - 10px), calc((100dvh - 174px) * 10 / 16)) !important;
    max-height: calc(100dvh - 174px) !important;
  }
  body:not(.home-mode) .unreal-frame {
    width: 148% !important;
    top: -4.5% !important;
  }
}

/* mobile-nocrop-20260615: quitar macro zoom/crop del iframe móvil */
@media (max-width: 780px) and (orientation: portrait) {
  body:not(.home-mode) .video-stage {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: max(34px, env(safe-area-inset-top) + 26px) 4px max(146px, env(safe-area-inset-bottom) + 134px) !important;
    overflow: hidden !important;
  }
  body:not(.home-mode) .video-frame {
    position: relative !important;
    inset: auto !important;
    width: calc(100vw - 8px) !important;
    max-width: calc(100vw - 8px) !important;
    aspect-ratio: 3 / 4 !important;
    height: auto !important;
    max-height: calc(100dvh - 180px) !important;
    border-radius: 18px !important;
    background: #000 !important;
  }
  body:not(.home-mode) .unreal-frame {
    position: absolute !important;
    inset: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    transform: none !important;
    transform-origin: center center !important;
    border: 0 !important;
    background: #000 !important;
  }
  body:not(.home-mode) .unreal-video,
  body:not(.home-mode) .unreal-mjpeg {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
  }
  body:not(.home-mode) .chat-dock {
    left: 8px !important;
    right: 8px !important;
    bottom: max(58px, env(safe-area-inset-bottom) + 52px) !important;
    width: auto !important;
    transform: none !important;
    max-height: 116px !important;
  }
  body:not(.home-mode) .conversation { display: none !important; }
}

/* mobile-small-right-20260615: avatar un poco más pequeño y 10% a la derecha */
@media (max-width: 780px) and (orientation: portrait) {
  body:not(.home-mode) .unreal-frame {
    inset: auto !important;
    left: 10% !important;
    top: 4% !important;
    width: 92% !important;
    height: 92% !important;
    max-width: none !important;
    transform: none !important;
    transform-origin: center center !important;
    border: 0 !important;
    background: #000 !important;
  }
  body:not(.home-mode) .unreal-video,
  body:not(.home-mode) .unreal-mjpeg {
    object-fit: contain !important;
    object-position: 60% center !important;
  }
}

/* mobile-finalsize-20260615: 5% menos imagen y sin bordes internos */
@media (max-width: 780px) and (orientation: portrait) {
  body:not(.home-mode) .video-frame {
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    background: #000 !important;
  }
  body:not(.home-mode) .video-frame::before,
  body:not(.home-mode) .video-frame::after {
    display: none !important;
    content: none !important;
  }
  body:not(.home-mode) .unreal-frame {
    left: 12.5% !important;
    top: 6.5% !important;
    width: 87.4% !important;
    height: 87.4% !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
  }
  body:not(.home-mode) .unreal-video,
  body:not(.home-mode) .unreal-mjpeg {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    object-fit: contain !important;
    object-position: 60% center !important;
  }
}

/* mobile-letterbox-20260615: Pixel Streaming en 16:9 real para no cortar cabeza */
@media (max-width: 780px) and (orientation: portrait) {
  body:not(.home-mode) .video-stage {
    padding: max(34px, env(safe-area-inset-top) + 26px) 6px max(146px, env(safe-area-inset-bottom) + 134px) !important;
  }
  body:not(.home-mode) .video-frame {
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
    aspect-ratio: 3 / 4 !important;
    max-height: calc(100dvh - 180px) !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    background: #000 !important;
  }
  body:not(.home-mode) .unreal-frame {
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    max-width: none !important;
    transform: translateY(-56%) !important;
    transform-origin: center center !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
  }
}

/* mobile-midzoom-20260615: punto medio, más grande sin cortar cabeza */
@media (max-width: 780px) and (orientation: portrait) {
  body:not(.home-mode) .video-frame {
    width: calc(100vw - 8px) !important;
    max-width: calc(100vw - 8px) !important;
    aspect-ratio: 3 / 4 !important;
    max-height: calc(100dvh - 178px) !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
  }
  body:not(.home-mode) .unreal-frame {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: 135% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    max-width: none !important;
    transform: translate(-50%, -55%) !important;
    transform-origin: center center !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
  }
}

/* mobile-plus25-20260615: aumentar avatar 25% desde el punto medio */
@media (max-width: 780px) and (orientation: portrait) {
  body:not(.home-mode) .unreal-frame {
    left: 50% !important;
    top: 50% !important;
    width: 169% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    transform: translate(-50%, -55%) !important;
    transform-origin: center center !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
  }
}

/* mobile-lower-bigger-20260615: más grande y bastante más abajo */
@media (max-width: 780px) and (orientation: portrait) {
  body:not(.home-mode) .unreal-frame {
    left: 50% !important;
    top: 50% !important;
    width: 185% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    transform: translate(-50%, -47%) !important;
    transform-origin: center center !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
  }
}

/* mobile-lower-plus-20260615: un poco más abajo y grande */
@media (max-width: 780px) and (orientation: portrait) {
  body:not(.home-mode) .unreal-frame {
    left: 50% !important;
    top: 50% !important;
    width: 198% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    transform: translate(-50%, -43%) !important;
    transform-origin: center center !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
  }
}

/* fullscreen-avatar-test-20260629: INFT ocupa toda la pantalla; chat flotante encima */
body:not(.home-mode) {
  background: #000 !important;
  overflow: hidden !important;
}
body:not(.home-mode) .stage-shell,
body:not(.home-mode) .video-stage {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  overflow: hidden !important;
  background: #000 !important;
}
body:not(.home-mode) .video-frame {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  overflow: hidden !important;
  background: #000 !important;
}
body:not(.home-mode) .video-frame::before,
body:not(.home-mode) .video-frame::after {
  display: none !important;
  content: none !important;
}
body:not(.home-mode) .unreal-video,
body:not(.home-mode) .unreal-frame,
body:not(.home-mode) .unreal-mjpeg {
  position: absolute !important;
  inset: 0 !important;
  left: 0 !important;
  top: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  transform-origin: center center !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  background: #000 !important;
}
body:not(.home-mode) .topbar {
  position: fixed !important;
  top: max(12px, env(safe-area-inset-top)) !important;
  left: max(12px, env(safe-area-inset-left)) !important;
  right: max(12px, env(safe-area-inset-right)) !important;
  z-index: 60 !important;
  pointer-events: none !important;
}
body:not(.home-mode) .topbar > div:first-child {
  position: absolute !important;
  top: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: min(760px, calc(100vw - 360px)) !important;
  text-align: center !important;
}
body:not(.home-mode) .eyebrow {
  font-size: clamp(12px, 1.2vw, 17px) !important;
  letter-spacing: .24em !important;
}
body:not(.home-mode) .micro-status {
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  transform: none !important;
  max-width: min(560px, 52vw) !important;
  background: rgba(5,8,16,.50) !important;
  backdrop-filter: blur(18px) !important;
}
body:not(.home-mode) .chat-dock {
  position: fixed !important;
  z-index: 70 !important;
  left: 50% !important;
  right: auto !important;
  bottom: max(18px, env(safe-area-inset-bottom)) !important;
  transform: translateX(-50%) !important;
  width: min(760px, calc(100vw - 190px)) !important;
  max-height: 118px !important;
  border-radius: 20px !important;
  background: rgba(5,8,16,.68) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: 0 18px 70px rgba(0,0,0,.48) !important;
  backdrop-filter: blur(20px) saturate(1.08) !important;
}
body:not(.home-mode) .conversation {
  display: grid !important;
  max-height: 42px;
}
body:not(.home-mode) .composer {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
}
body:not(.home-mode) textarea {
  height: 48px !important;
  max-height: 48px !important;
}
body:not(.home-mode) .composer-actions {
  position: fixed !important;
  right: max(16px, env(safe-area-inset-right)) !important;
  bottom: max(18px, env(safe-area-inset-bottom)) !important;
  z-index: 80 !important;
}
body:not(.home-mode) .logout-btn {
  z-index: 85 !important;
}
@media (max-width: 780px) {
  body:not(.home-mode) .topbar > div:first-child { width: calc(100vw - 24px) !important; }
  body:not(.home-mode) .micro-status { display: none !important; }
  body:not(.home-mode) .chat-dock {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    transform: none !important;
    bottom: max(58px, env(safe-area-inset-bottom) + 52px) !important;
  }
  body:not(.home-mode) .conversation { display: none !important; }
  body:not(.home-mode) textarea { height: 52px !important; max-height: 52px !important; }
}

/* fullscreen-avatar-test-20260629b: mantener Pixel Streaming 16:9 en modo cover */
body:not(.home-mode) .unreal-frame {
  width: max(100vw, calc(100dvh * 16 / 9)) !important;
  height: max(100dvh, calc(100vw * 9 / 16)) !important;
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
}
body:not(.home-mode) .unreal-video,
body:not(.home-mode) .unreal-mjpeg {
  width: 100vw !important;
  height: 100dvh !important;
  object-fit: cover !important;
  object-position: center center !important;
}

/* chat-history-resize-20260629: histórico redimensionable con scroll interno */
body:not(.home-mode) .chat-dock {
  max-height: min(72vh, 620px) !important;
  overflow: visible !important;
}
body:not(.home-mode) .conversation {
  display: grid !important;
  height: clamp(42px, 14vh, 180px);
  min-height: 42px;
  max-height: min(52vh, 430px) !important;
  resize: vertical !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 16px !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(100,232,255,.55) rgba(255,255,255,.06) !important;
  position: relative !important;
}
body:not(.home-mode) .conversation::after {
  content: "↕";
  position: sticky;
  right: 0;
  bottom: 0;
  justify-self: end;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  margin-top: -18px;
  border-radius: 8px 0 8px 0;
  color: rgba(230,245,255,.88);
  background: rgba(100,232,255,.18);
  border: 1px solid rgba(100,232,255,.30);
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
}
body:not(.home-mode) .conversation::-webkit-scrollbar {
  width: 10px !important;
}
body:not(.home-mode) .conversation::-webkit-scrollbar-track {
  background: rgba(255,255,255,.06) !important;
  border-radius: 999px !important;
}
body:not(.home-mode) .conversation::-webkit-scrollbar-thumb {
  background: rgba(100,232,255,.55) !important;
  border-radius: 999px !important;
}
body:not(.home-mode) .composer {
  position: relative !important;
}
@media (max-width: 780px) {
  body:not(.home-mode) .conversation {
    display: grid !important;
    height: 42px;
    min-height: 0 !important;
    max-height: 28vh !important;
    resize: vertical !important;
  }
}
