/* Nabgol Live call — world-class voice/video overlay */
#liveCallOverlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) 1rem max(0.75rem, env(safe-area-inset-bottom));
  background: rgba(6, 10, 16, 0.72);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  direction: rtl;
  font-family: Vazirmatn, Tahoma, sans-serif;
}

#liveCallOverlay.is-open {
  display: flex;
  animation: liveOverlayIn 220ms ease-out;
}

@keyframes liveOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.live-call-panel {
  width: min(440px, 100%);
  max-height: min(92dvh, 760px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(79, 140, 255, 0.18), transparent 55%),
    linear-gradient(165deg, #1c2636 0%, #121a24 48%, #0c121a 100%);
  color: #eef3f8;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 1.1rem 1.05rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.live-call-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  position: relative;
  padding-inline-end: 2.75rem; /* room for back btn on visual left in RTL */
}

.live-call-top-text {
  min-width: 0;
  flex: 1;
}

.live-call-back {
  position: absolute;
  top: 0;
  left: 0; /* visual left in both LTR/RTL */
  z-index: 5;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  color: #eef3f8;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  -webkit-tap-highlight-color: transparent;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.live-call-back:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

.live-call-back:active {
  transform: scale(0.94);
}

.live-call-back svg {
  /* chevron points to visual left already in RTL mirroring? path is « which for back-to-previous in RTL often flips */
  transform: scaleX(1);
}

.live-call-panel[data-live-theme="light"] .live-call-back {
  color: #152033;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(20, 40, 70, 0.14);
  box-shadow: 0 2px 10px rgba(30, 50, 80, 0.12);
}

.live-call-title {
  margin: 0 0 0.2rem;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.live-call-status {
  margin: 0;
  min-height: 1.35em;
  font-size: 0.88rem;
  color: #9fb2c7;
}

.live-call-status[data-tone="live"] { color: #6dcea2; }
.live-call-status[data-tone="warn"] { color: #e2b76a; }
.live-call-status[data-tone="error"] { color: #ef8b8b; }

.live-call-timer {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  font-weight: 600;
  color: #c5d4e4;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  margin-top: 0.15rem;
}

.live-call-timer[hidden] {
  display: none !important;
}

/* Stage: voice orb OR camera preview + captions */
.live-call-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.live-call-voice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.35rem 0.5rem 0.15rem;
  flex: 0 0 auto;
}

.live-call-voice[hidden] {
  display: none !important;
}

/* Brand thinking orb (replaces flat mic icon) */
.live-call-mic {
  --mic-level: 0;
  position: relative;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  margin: 0.2rem 0;
}

.live-call-mic-glow {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(52, 211, 153, 0.42) 0%,
    rgba(251, 191, 36, 0.22) 42%,
    transparent 72%);
  transform: scale(calc(0.88 + var(--mic-level) * 0.5));
  opacity: calc(0.4 + var(--mic-level) * 0.55);
  transition: transform 80ms linear, opacity 80ms linear;
  filter: blur(10px);
}

.live-call-mic-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(52, 211, 153, 0.28);
  pointer-events: none;
}

.live-call-mic-ring--a {
  animation: liveMicRing 2.8s ease-out infinite;
}

.live-call-mic-ring--b {
  inset: 8%;
  border-color: rgba(251, 191, 36, 0.28);
  animation: liveMicRing 2.8s ease-out infinite 0.55s;
}

.live-call-mic-ring--c {
  inset: 16%;
  border-color: rgba(110, 231, 183, 0.2);
  animation: liveMicRing 2.8s ease-out infinite 1.1s;
}

.live-call-mic.is-level .live-call-mic-ring--a,
.live-call-mic.is-level .live-call-mic-ring--b,
.live-call-mic.is-level .live-call-mic-ring--c {
  animation: none;
  transform: scale(calc(1 + var(--mic-level) * 0.22));
  opacity: calc(0.35 + var(--mic-level) * 0.65);
  transition: transform 70ms linear, opacity 70ms linear;
}

.live-call-mic-core {
  position: relative;
  z-index: 2;
  width: 96px;
  height: 96px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: transparent;
  background: transparent;
  box-shadow: none;
  transform: scale(calc(1 + var(--mic-level) * 0.05));
  transition: transform 70ms linear;
  overflow: visible;
}

.live-call-brand-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: transparent;
  border: 0;
  border-radius: 0;
  pointer-events: none;
  filter: drop-shadow(0 8px 22px rgba(52, 211, 153, 0.28));
  -webkit-filter: drop-shadow(0 8px 22px rgba(52, 211, 153, 0.28));
}

@supports (mix-blend-mode: plus-lighter) {
  .live-call-panel[data-live-theme="dark"] .live-call-brand-video {
    mix-blend-mode: plus-lighter;
  }
}

/* Fullscreen video brand bug — pinned top-left of the video frame (not stage) */
.live-call-brand-bug {
  display: none;
  position: absolute;
  z-index: 5;
  top: 0.5rem;
  left: 0.5rem;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  object-fit: contain;
  object-position: 50% 36%;
  background: transparent;
  border: 0;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0.95;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
  -webkit-filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
  /* Optical lift: webm plant sits slightly low in its frame */
  transform: translateY(-3px);
}

.live-call-panel[data-view="full"] .live-call-stage.has-video .live-call-brand-bug,
.live-call-panel:fullscreen .live-call-stage.has-video .live-call-brand-bug,
.live-call-panel:-webkit-full-screen .live-call-stage.has-video .live-call-brand-bug {
  display: block;
}

.live-call-panel:fullscreen .live-call-brand-bug,
.live-call-panel:-webkit-full-screen .live-call-brand-bug {
  width: 48px;
  height: 48px;
  top: 0.55rem;
  left: 0.55rem;
  transform: translateY(-4px);
}

.live-call-mic.is-speaking .live-call-mic-core {
  box-shadow: none;
  transform: scale(1.07);
  transition: transform 160ms ease;
}

@keyframes liveMicRing {
  0% { transform: scale(0.92); opacity: 0.7; }
  70% { transform: scale(1.2); opacity: 0; }
  100% { transform: scale(1.2); opacity: 0; }
}

/* legacy class alias */
.live-call-orb {
  /* kept as id target; styled via .live-call-mic */
}

.live-call-stage.has-video .live-call-mic-ring {
  animation: none;
}

.live-call-meter {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 36px;
  width: min(220px, 70%);
}

.live-call-meter span {
  flex: 1 1 0;
  max-width: 6px;
  height: 18%;
  border-radius: 999px;
  background: linear-gradient(180deg, #9ec5ff, #4f8cff 55%, #6dcea2);
  opacity: 0.75;
  transform-origin: bottom;
  transition: height 70ms linear, opacity 70ms linear;
}

.live-call-meter.is-active:not(.is-level) span {
  animation: liveMeterPulse 1.05s ease-in-out infinite;
}
.live-call-meter.is-active:not(.is-level) span:nth-child(2) { animation-delay: 0.05s; }
.live-call-meter.is-active:not(.is-level) span:nth-child(3) { animation-delay: 0.1s; }
.live-call-meter.is-active:not(.is-level) span:nth-child(4) { animation-delay: 0.15s; }
.live-call-meter.is-active:not(.is-level) span:nth-child(5) { animation-delay: 0.2s; }
.live-call-meter.is-active:not(.is-level) span:nth-child(6) { animation-delay: 0.25s; }
.live-call-meter.is-active:not(.is-level) span:nth-child(7) { animation-delay: 0.3s; }
.live-call-meter.is-active:not(.is-level) span:nth-child(8) { animation-delay: 0.35s; }
.live-call-meter.is-active:not(.is-level) span:nth-child(9) { animation-delay: 0.4s; }
.live-call-meter.is-active:not(.is-level) span:nth-child(10) { animation-delay: 0.45s; }
.live-call-meter.is-active:not(.is-level) span:nth-child(11) { animation-delay: 0.5s; }

.live-call-meter.is-level span {
  animation: none;
  height: calc(14% + var(--mic-level, 0) * 78%);
  opacity: calc(0.4 + var(--mic-level, 0) * 0.6);
}
.live-call-meter.is-level span:nth-child(1) { height: calc(10% + var(--mic-level, 0) * 42%); }
.live-call-meter.is-level span:nth-child(2) { height: calc(10% + var(--mic-level, 0) * 58%); }
.live-call-meter.is-level span:nth-child(3) { height: calc(10% + var(--mic-level, 0) * 74%); }
.live-call-meter.is-level span:nth-child(4) { height: calc(10% + var(--mic-level, 0) * 88%); }
.live-call-meter.is-level span:nth-child(5) { height: calc(10% + var(--mic-level, 0) * 96%); }
.live-call-meter.is-level span:nth-child(6) { height: calc(10% + var(--mic-level, 0) * 100%); }
.live-call-meter.is-level span:nth-child(7) { height: calc(10% + var(--mic-level, 0) * 94%); }
.live-call-meter.is-level span:nth-child(8) { height: calc(10% + var(--mic-level, 0) * 82%); }
.live-call-meter.is-level span:nth-child(9) { height: calc(10% + var(--mic-level, 0) * 68%); }
.live-call-meter.is-level span:nth-child(10) { height: calc(10% + var(--mic-level, 0) * 52%); }
.live-call-meter.is-level span:nth-child(11) { height: calc(10% + var(--mic-level, 0) * 38%); }

@keyframes liveMeterPulse {
  0%, 100% { height: 16%; opacity: 0.5; }
  50% { height: 88%; opacity: 1; }
}

.live-call-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(42dvh, 280px);
  border-radius: 16px;
  overflow: hidden;
  background: #05080d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.live-call-preview[hidden] {
  display: none !important;
}

.live-call-preview.is-live {
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(109, 206, 162, 0.4);
}

.live-call-preview-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.live-call-preview.is-screen .live-call-preview-video,
.live-call-preview.is-still .live-call-preview-video {
  object-fit: contain;
}

.live-call-preview.is-still .live-call-preview-video {
  display: none;
}

.live-call-still-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  position: absolute;
  inset: 0;
}

.live-call-still-img[hidden] {
  display: none !important;
}

.live-call-preview-video.is-mirrored {
  transform: scaleX(-1);
}

.live-call-pip-bar {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0.55rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  pointer-events: none;
}

.live-call-pip-bar[hidden] {
  display: none !important;
}

.live-call-pip {
  pointer-events: auto;
  position: relative;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.live-call-pip[hidden] {
  display: none !important;
}

.live-call-pip-label {
  display: none;
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.live-call-more-src {
  position: relative;
  pointer-events: auto;
  z-index: 6;
}

.live-call-src-fab-wrap,
.live-call-panel:not([data-desk="teach"]) .live-call-src-fab-wrap:not([hidden]) {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 24;
  pointer-events: none;
  display: none;
}

.live-call-panel:not([data-desk="teach"]) .live-call-src-fab-wrap:not([hidden]) {
  display: block;
  pointer-events: auto;
}

.live-call-panel[data-desk="teach"] .live-call-src-fab-wrap {
  display: none !important;
}

.live-call-src-fab {
  appearance: none;
  pointer-events: auto;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 14px;
  border: 1.5px solid rgba(56, 189, 248, 0.7);
  background: rgba(8, 47, 73, 0.88);
  color: #e0f2fe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.live-call-src-fab:hover,
.live-call-src-fab:focus-visible {
  background: rgba(3, 105, 161, 0.95);
  outline: none;
}

.live-call-more-src-menu {
  top: calc(100% + 0.4rem);
  bottom: auto;
  left: 0;
  right: auto;
  transform: none;
  min-width: 10rem;
}

.live-call-more-src-menu button,
.live-teach-more-src-menu button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  text-align: right;
}

.live-src-ico {
  display: inline-flex;
  width: 1.1rem;
  height: 1.1rem;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #7dd3fc;
}

.live-src-ico svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}

.live-call-pip-privacy.is-private {
  border-color: rgba(226, 183, 106, 0.7);
  background: rgba(120, 80, 20, 0.75);
  color: #ffe6b0;
}

.live-call-pip-full.is-on {
  border-color: rgba(79, 140, 255, 0.7);
  background: rgba(40, 80, 160, 0.7);
}

.live-call-preview.is-private::after {
  content: "خصوصی";
  position: absolute;
  top: 0.55rem;
  inset-inline-start: 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffe6b0;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  pointer-events: none;
  z-index: 3;
}

.live-call-top-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.live-call-theme-toggle {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #eef3f8;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.live-call-theme-toggle .theme-moon {
  display: none;
}

.live-call-panel[data-live-theme="light"] .live-call-theme-toggle .theme-sun {
  display: none;
}

.live-call-panel[data-live-theme="light"] .live-call-theme-toggle .theme-moon {
  display: inline;
}

/* Voice captions: large readable area */
.live-call-captions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.35rem 0 0.15rem;
  max-height: none;
  flex: 1 1 auto;
  min-height: 7rem;
  overflow: auto;
  scrollbar-width: thin;
  z-index: 3;
}

.live-call-captions[hidden] {
  display: none !important;
}

.live-call-captions--on-video {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 3.4rem;
  margin: 0;
  max-height: min(42%, 9rem);
  min-height: 0;
  flex: none;
  pointer-events: none;
  overflow: auto;
}

.live-call-captions--on-video .live-cap {
  background: transparent !important;
  border: none !important;
  backdrop-filter: none;
  padding: 0.12rem 0.05rem;
  box-shadow: none;
}

.live-call-captions--on-video .live-cap-label,
.live-call-captions--on-video .live-cap-text {
  color: #fff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 10px rgba(0, 0, 0, 0.75),
    0 0 2px rgba(0, 0, 0, 1);
}

.live-call-stage.has-video .live-call-captions--voice {
  display: none !important;
}

/* View modes: minimal / half / full */
.live-call-panel[data-view="minimal"] .live-call-preview {
  max-height: min(26dvh, 168px);
  aspect-ratio: 16 / 10;
}

.live-call-panel[data-view="minimal"] .live-call-captions--on-video {
  max-height: 3.6rem;
  bottom: 3.1rem;
}

.live-call-panel[data-view="minimal"] .live-call-seen {
  display: flex;
}

.live-call-panel[data-view="minimal"] .live-call-tray-btn {
  display: none !important;
}

.live-call-panel[data-view="half"] .live-call-stage.has-video {
  min-height: min(42dvh, 300px);
}

.live-call-panel[data-view="half"] .live-call-preview {
  max-height: min(40dvh, 260px);
  aspect-ratio: auto;
  flex: 1 1 auto;
  min-height: 160px;
}

.live-call-panel[data-view="half"] .live-call-captions--on-video {
  max-height: min(42%, 8.5rem);
  bottom: 3.2rem;
}

.live-call-panel[data-view="half"] .live-call-seen {
  display: none !important;
}

.live-call-panel[data-view="full"] {
  width: min(100vw - 0.5rem, 560px);
  max-height: min(98dvh, 920px);
  padding: 0.65rem 0.7rem 0.75rem;
}

.live-call-panel[data-view="full"] .live-call-top {
  margin-bottom: 0.45rem;
}

.live-call-panel[data-view="full"] .live-call-stage.has-video {
  min-height: min(68dvh, 560px);
  flex: 1 1 auto;
}

.live-call-panel[data-view="full"] .live-call-preview {
  max-height: none;
  height: min(64dvh, 540px);
  aspect-ratio: auto;
  flex: 1 1 auto;
  border-radius: 14px;
}

.live-call-panel[data-view="full"] .live-call-captions--on-video {
  max-height: min(48%, 14rem);
  bottom: 4.2rem;
}

.live-call-panel[data-view="full"] .live-call-pip {
  width: 2.75rem;
  height: 2.75rem;
}

.live-call-panel[data-view="full"] .live-call-pip-label {
  display: block;
}

.live-call-panel[data-view="full"] .live-call-pip-bar {
  bottom: 1.15rem;
  gap: 1.1rem;
}

.live-call-panel[data-view="full"] .live-call-seen,
.live-call-panel[data-view="full"] .live-call-hint {
  display: none !important;
}

.live-call-panel[data-view="full"] .live-call-layout-bar {
  display: flex !important;
}

.live-call-panel[data-view="full"] .live-call-view-dock {
  opacity: 1;
  pointer-events: auto;
}

/* Immersive browser fullscreen — previous true-fullscreen feel + controls */
.live-call-panel:fullscreen,
.live-call-panel:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  padding:
    max(0.75rem, env(safe-area-inset-top))
    max(0.85rem, env(safe-area-inset-right))
    max(0.85rem, env(safe-area-inset-bottom))
    max(0.85rem, env(safe-area-inset-left)) !important;
  display: flex !important;
  flex-direction: column !important;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(79, 140, 255, 0.16), transparent 55%),
    linear-gradient(165deg, #1c2636 0%, #121a24 48%, #0c121a 100%) !important;
}

.live-call-panel:fullscreen .live-call-stage.has-video,
.live-call-panel:-webkit-full-screen .live-call-stage.has-video {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0.45rem;
}

.live-call-panel:fullscreen .live-call-preview,
.live-call-panel:-webkit-full-screen .live-call-preview {
  flex: 1 1 auto;
  width: 100%;
  height: auto !important;
  max-height: none !important;
  min-height: 52vh;
  aspect-ratio: auto;
  border-radius: 16px;
}

.live-call-panel:fullscreen .live-call-captions--on-video,
.live-call-panel:-webkit-full-screen .live-call-captions--on-video {
  display: flex !important;
  max-height: min(40%, 16rem);
  bottom: 4.6rem;
}

.live-call-panel:fullscreen .live-call-pip-label,
.live-call-panel:-webkit-full-screen .live-call-pip-label {
  display: block;
}

.live-call-panel:fullscreen .live-call-pip-bar,
.live-call-panel:-webkit-full-screen .live-call-pip-bar {
  bottom: 1.2rem;
  gap: 1.2rem;
}

.live-call-panel:fullscreen .live-call-pip,
.live-call-panel:-webkit-full-screen .live-call-pip {
  width: 2.85rem;
  height: 2.85rem;
}

.live-call-panel:fullscreen .live-call-layout-bar,
.live-call-panel:-webkit-full-screen .live-call-layout-bar {
  display: flex !important;
}

.live-call-panel:fullscreen .live-call-view-dock,
.live-call-panel:-webkit-full-screen .live-call-view-dock {
  opacity: 1;
  pointer-events: auto;
}

.live-call-panel:fullscreen .live-call-back,
.live-call-panel:-webkit-full-screen .live-call-back {
  left: max(0.85rem, env(safe-area-inset-left));
  top: max(0.15rem, env(safe-area-inset-top));
}

.live-call-panel:fullscreen .live-call-actions,
.live-call-panel:-webkit-full-screen .live-call-actions {
  margin-top: 0.25rem;
}

.live-call-layout-bar {
  display: flex;
  gap: 0.4rem;
  margin: 0.35rem 0 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.live-call-layout-bar[hidden] {
  display: none !important;
}

.live-call-view-modes {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.live-call-layout-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #d7e4f2;
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
  flex: 1 1 auto;
  text-align: center;
}

.live-call-layout-btn.is-on {
  border-color: rgba(79, 140, 255, 0.55);
  background: rgba(79, 140, 255, 0.22);
  color: #e8f1ff;
  font-weight: 700;
}

.live-call-tray-btn {
  flex: 0 0 auto;
  min-width: 5.5rem;
}

.live-call-tray-btn[hidden] {
  display: none !important;
}

/* Compact view dock on the video — always reachable in full */
.live-call-view-dock {
  position: absolute;
  z-index: 5;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.live-call-dock-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.live-call-dock-btn.is-on {
  background: rgba(79, 140, 255, 0.55);
  color: #fff;
}

.live-call-panel[data-view="minimal"] .live-call-view-dock,
.live-call-panel[data-view="half"] .live-call-view-dock {
  opacity: 0.92;
}

.live-call-seen {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.25rem 0 0.45rem;
  padding: 0.35rem 0.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.live-call-seen[hidden] {
  display: none !important;
}

.live-call-seen-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 42px;
  border-radius: 8px;
  background-color: #000;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.live-call-seen-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #d7e4f2;
}

.live-call-secondary {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.6rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.live-call-secondary[hidden] {
  display: none !important;
}

.live-call-secondary.is-collapsed {
  display: none !important;
}

.live-call-secondary.is-collapsed[hidden] {
  display: none !important;
}

/* When voice-only: more room for captions, tighter chrome */
.live-call-panel[data-mode="voice"] .live-call-layout-bar {
  display: none !important;
}

.live-call-panel[data-mode="voice"] .live-call-top {
  margin-bottom: 0.45rem;
}

.live-call-stage:not(.has-video) {
  min-height: 0;
  flex: 1 1 auto;
  justify-content: flex-start;
  margin-bottom: 0.35rem;
}

.live-call-stage:not(.has-video) .live-call-captions--voice {
  min-height: 9rem;
  max-height: min(42dvh, 280px);
}

.live-call-share-row {
  display: none !important;
}

.live-call-quality,
.live-call-source-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.live-call-q,
.live-call-src,
.live-call-mini {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #d7e4f2;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.live-call-q.is-on,
.live-call-src.is-on,
.live-call-mini.is-on {
  border-color: rgba(79, 140, 255, 0.55);
  background: rgba(79, 140, 255, 0.2);
}

.live-call-audio-row,
.live-call-theme-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.live-call-vol {
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: #9fb2c7;
}

.live-call-vol input[type="range"] {
  width: 100%;
  accent-color: #4f8cff;
}

.live-call-mic.is-speaking .live-call-mic-core {
  box-shadow: none;
  transform: scale(1.07);
  transition: transform 160ms ease;
}

.live-call-panel[data-live-theme="light"] {
  --lc-fg: #152033;
  --lc-muted: #4a5d73;
  --lc-card: rgba(255, 255, 255, 0.72);
  --lc-border: rgba(20, 40, 70, 0.14);
  --lc-chip: rgba(20, 40, 70, 0.06);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(79, 140, 255, 0.16), transparent 55%),
    linear-gradient(165deg, #f7f9fc 0%, #eef3f9 48%, #e4ebf4 100%);
  color: var(--lc-fg);
  border-color: var(--lc-border);
  box-shadow: 0 24px 64px rgba(30, 50, 80, 0.18);
}

.live-call-panel[data-live-theme="light"] .live-call-title,
.live-call-panel[data-live-theme="light"] .live-cap-text,
.live-call-panel[data-live-theme="light"] .live-call-seen-title {
  color: var(--lc-fg);
}

.live-call-panel[data-live-theme="light"] .live-call-status {
  color: var(--lc-muted);
}

.live-call-panel[data-live-theme="light"] .live-call-status[data-tone="live"] { color: #157a4f; }
.live-call-panel[data-live-theme="light"] .live-call-status[data-tone="warn"] { color: #9a6b12; }
.live-call-panel[data-live-theme="light"] .live-call-status[data-tone="error"] { color: #b42318; }

.live-call-panel[data-live-theme="light"] .live-call-timer,
.live-call-panel[data-live-theme="light"] .live-call-theme-toggle,
.live-call-panel[data-live-theme="light"] .live-call-q,
.live-call-panel[data-live-theme="light"] .live-call-src,
.live-call-panel[data-live-theme="light"] .live-call-mini {
  color: var(--lc-fg);
  background: var(--lc-chip);
  border-color: var(--lc-border);
}

.live-call-panel[data-live-theme="light"] .live-call-ctrl-label,
.live-call-panel[data-live-theme="light"] .live-call-vol,
.live-call-panel[data-live-theme="light"] .live-cap-label {
  color: var(--lc-muted);
}

.live-call-panel[data-live-theme="light"] .live-call-ctrl-ico {
  background: #fff;
  border-color: var(--lc-border);
  color: var(--lc-fg);
  box-shadow: 0 1px 2px rgba(20, 40, 70, 0.08);
}

.live-call-panel[data-live-theme="light"] .live-call-ctrl.is-on .live-call-ctrl-ico {
  background: rgba(31, 138, 90, 0.14);
  border-color: rgba(31, 138, 90, 0.45);
  color: #157a4f;
}

.live-call-panel[data-live-theme="light"] .live-call-ctrl.is-muted .live-call-ctrl-ico {
  background: rgba(180, 35, 24, 0.12);
  border-color: rgba(180, 35, 24, 0.4);
  color: #b42318;
}

.live-call-panel[data-live-theme="light"] .live-cap,
.live-call-panel[data-live-theme="light"] .live-call-secondary,
.live-call-panel[data-live-theme="light"] .live-call-seen,
.live-call-panel[data-live-theme="light"] .live-call-hint {
  background: var(--lc-card);
  border-color: var(--lc-border);
  color: var(--lc-fg);
}

.live-call-panel[data-live-theme="light"] .live-call-hint {
  color: #7a5410;
  background: rgba(226, 183, 106, 0.22);
}

.live-call-panel[data-live-theme="light"] .live-call-layout-btn {
  color: var(--lc-fg);
  background: var(--lc-chip);
  border-color: var(--lc-border);
}

.live-call-panel[data-live-theme="light"] .live-call-layout-btn.is-on {
  background: rgba(79, 140, 255, 0.18);
  border-color: rgba(79, 140, 255, 0.55);
  color: #1a4ea8;
}

.live-call-panel[data-live-theme="light"] .live-call-q.is-on,
.live-call-panel[data-live-theme="light"] .live-call-src.is-on,
.live-call-panel[data-live-theme="light"] .live-call-mini.is-on {
  background: rgba(79, 140, 255, 0.18);
  border-color: rgba(79, 140, 255, 0.55);
  color: #1a4ea8;
}

.live-call-panel[data-live-theme="light"] .live-call-stage.has-video .live-cap-label,
.live-call-panel[data-live-theme="light"] .live-call-stage.has-video .live-cap-text {
  color: #fff;
}

.live-call-hint {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: rgba(226, 183, 106, 0.12);
  border: 1px solid rgba(226, 183, 106, 0.35);
  color: #f0d7a0;
  font-size: 0.84rem;
  line-height: 1.55;
  text-align: center;
}

.live-call-hint[data-tone="error"] {
  background: rgba(239, 139, 139, 0.12);
  border-color: rgba(239, 139, 139, 0.4);
  color: #ffc9c9;
}

.live-call-hint[hidden] {
  display: none !important;
}

.live-cap {
  border-radius: 12px;
  padding: 0.5rem 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.live-cap[hidden] {
  display: none !important;
}

.live-cap-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #8fa3b8;
  margin-bottom: 0.15rem;
}

.live-cap-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #eef3f8;
  white-space: pre-wrap;
  word-break: break-word;
}

.live-cap-user {
  border-color: rgba(79, 140, 255, 0.35);
  background: rgba(79, 140, 255, 0.1);
}

.live-cap-model {
  border-color: rgba(109, 206, 162, 0.35);
  background: rgba(109, 206, 162, 0.1);
}

/* Circular control dock */
.live-call-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.55rem;
  justify-content: center;
  align-items: flex-start;
  padding-top: 0.15rem;
}

.live-call-ctrl {
  appearance: none;
  flex: 0 0 auto;
  width: 4.35rem;
  border: none;
  background: transparent;
  color: #eef3f8;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.live-call-ctrl-ico {
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.live-call-ctrl-ico svg {
  width: 1.35rem;
  height: 1.35rem;
}

.live-call-ctrl-label {
  font-size: 0.72rem;
  color: #a8b9cb;
  line-height: 1.2;
  text-align: center;
}

.live-call-ctrl:hover .live-call-ctrl-ico {
  background: rgba(255, 255, 255, 0.14);
}

.live-call-ctrl:active .live-call-ctrl-ico {
  transform: scale(0.94);
}

.live-call-ctrl.is-on .live-call-ctrl-ico {
  border-color: rgba(109, 206, 162, 0.55);
  background: rgba(109, 206, 162, 0.22);
  color: #b8f5d4;
}

.live-call-ctrl.is-muted .live-call-ctrl-ico {
  border-color: rgba(239, 139, 139, 0.5);
  background: rgba(239, 139, 139, 0.2);
  color: #ffc9c9;
}

.live-call-ctrl:disabled {
  opacity: 0.5;
  cursor: wait;
}

.live-call-ctrl[hidden] {
  display: none !important;
}

.live-call-ctrl.live-call-end .live-call-ctrl-ico {
  background: #c23b3b;
  border-color: #a82f2f;
  color: #fff;
}

.live-call-ctrl.live-call-end:hover .live-call-ctrl-ico {
  background: #d24747;
}

.live-call-ctrl.live-call-end .live-call-ctrl-label {
  color: #ef8b8b;
  font-weight: 600;
}

/* Composer live button */
#liveCallBtn {
  color: inherit;
}

#liveCallBtn.is-live {
  color: #1f8a5a;
}

body.desktop-chat #liveCallBtn .ico,
body.mobile-chat #liveCallBtn .ico {
  width: 1.25rem;
  height: 1.25rem;
}

@media (max-width: 640px) {
  .live-call-panel {
    width: min(100%, 420px);
    border-radius: 20px;
    padding: 1rem 0.85rem 0.9rem;
    max-height: min(94dvh, 820px);
  }

  .live-call-ctrl {
    width: 3.9rem;
  }

  .live-call-ctrl-ico {
    width: 3rem;
    height: 3rem;
  }

  .live-call-preview {
    max-height: min(38dvh, 240px);
  }
}

@media (max-height: 560px) {
  .live-call-mic {
    width: 104px;
    height: 104px;
  }
  .live-call-mic-core {
    width: 76px;
    height: 76px;
  }
  .live-call-preview {
    max-height: 32dvh;
  }
}

.live-call-stage:fullscreen,
.live-call-stage:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  background: #05080d;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.85rem max(0.85rem, env(safe-area-inset-bottom));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.live-call-stage:fullscreen .live-call-preview,
.live-call-stage:-webkit-full-screen .live-call-preview {
  flex: 1 1 auto;
  max-height: none;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 12px;
}

.live-call-stage:fullscreen .live-call-captions--on-video,
.live-call-stage:-webkit-full-screen .live-call-captions--on-video {
  max-height: min(45%, 18rem);
  bottom: 4.5rem;
  display: flex !important;
}

.live-call-stage:fullscreen .live-call-pip-label,
.live-call-stage:-webkit-full-screen .live-call-pip-label {
  display: block;
}

.live-call-stage:fullscreen .live-call-pip-bar,
.live-call-stage:-webkit-full-screen .live-call-pip-bar {
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  gap: 1.2rem;
}

.live-call-stage:fullscreen .live-call-pip,
.live-call-stage:-webkit-full-screen .live-call-pip {
  width: 2.85rem;
  height: 2.85rem;
}

.live-call-preview:fullscreen,
.live-call-preview:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  aspect-ratio: auto;
  border-radius: 0;
  background: #000;
}

.live-call-preview:fullscreen .live-call-captions--on-video,
.live-call-preview:-webkit-full-screen .live-call-captions--on-video {
  display: flex !important;
  max-height: min(45%, 18rem);
  bottom: 4.5rem;
}

.live-call-preview:fullscreen .live-call-pip-label,
.live-call-preview:-webkit-full-screen .live-call-pip-label {
  display: block;
}

.live-call-preview:fullscreen .live-call-pip-bar,
.live-call-preview:-webkit-full-screen .live-call-pip-bar {
  bottom: max(1rem, env(safe-area-inset-bottom));
}

/* Teaching annotate layer (Kami / Explain Everything style) */
.live-call-annotate-canvas {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.live-call-annotate-canvas[hidden] {
  display: none !important;
}

.live-call-annotate-bar {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 3.35rem;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  max-width: calc(100% - 1rem);
  padding: 0.35rem 0.45rem;
  border-radius: 14px;
  background: rgba(8, 12, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.live-call-annotate-bar[hidden] {
  display: none !important;
}

.live-call-panel[data-view="full"] .live-call-annotate-bar,
.live-call-panel:fullscreen .live-call-annotate-bar,
.live-call-panel:-webkit-full-screen .live-call-annotate-bar {
  bottom: 4.6rem;
}

.live-ann-tool,
.live-ann-action {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #eef3f8;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.live-ann-tool.is-on,
.live-ann-action:active {
  border-color: rgba(79, 140, 255, 0.65);
  background: rgba(79, 140, 255, 0.28);
}

.live-ann-color {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: var(--ann-c, #fff);
  padding: 0;
  cursor: pointer;
}

.live-ann-color.is-on {
  box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.85);
  border-color: #fff;
}

.live-ann-sep {
  width: 1px;
  height: 1.1rem;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 0.1rem;
}

.live-call-teach-badge {
  position: absolute;
  z-index: 5;
  top: 2.55rem;
  inset-inline-start: 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: calc(100% - 1.2rem);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(20, 90, 70, 0.72);
  border: 1px solid rgba(109, 206, 162, 0.45);
  color: #d8ffe8;
  font-size: 0.68rem;
  font-weight: 700;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.live-call-teach-badge[hidden] {
  display: none !important;
}

.live-call-preview.is-teach {
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(109, 206, 162, 0.55);
}

.live-call-preview.is-teach .live-call-captions--on-video {
  bottom: 5.6rem;
}

.live-call-panel[data-view="full"] .live-call-preview.is-teach .live-call-captions--on-video,
.live-call-panel:fullscreen .live-call-preview.is-teach .live-call-captions--on-video {
  bottom: 6.4rem;
}

/* ── Teach desk (PDF/board only) — immersive CSS full, never browser FS ── */
#liveCallOverlay:has(.live-call-panel[data-desk="teach"]) {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  background: #070b10;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.live-call-panel[data-desk="teach"] {
  width: 100%;
  max-width: none;
  max-height: none;
  height: 100%;
  min-height: 100dvh;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  padding:
    max(0.2rem, env(safe-area-inset-top))
    max(0.35rem, env(safe-area-inset-right))
    max(0.3rem, env(safe-area-inset-bottom))
    max(0.35rem, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 70% at 50% -20%, rgba(56, 120, 200, 0.14), transparent 55%),
    linear-gradient(180deg, #121820 0%, #0a0e14 100%);
}

.live-call-panel[data-desk="teach"] .live-call-top {
  margin-bottom: 0.15rem;
  gap: 0.25rem;
  flex: 0 0 auto;
  padding-inline-end: 2.6rem;
}

.live-call-panel[data-desk="teach"] .live-call-title {
  font-size: 0.86rem;
}

.live-call-panel[data-desk="teach"] .live-call-status {
  font-size: 0.68rem;
}

.live-call-panel[data-desk="teach"] .live-call-layout-bar,
.live-call-panel[data-desk="teach"] .live-call-view-dock,
.live-call-panel[data-desk="teach"] .live-call-pip-bar,
.live-call-panel[data-desk="teach"] .live-call-brand-bug,
.live-call-panel[data-desk="teach"] .live-call-seen,
.live-call-panel[data-desk="teach"] .live-call-hint,
.live-call-panel[data-desk="teach"] #liveCallTrayToggle {
  display: none !important;
}

.live-call-panel[data-desk="teach"] .live-call-secondary {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.live-call-panel[data-desk="teach"] .live-call-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0.15rem;
}

.live-call-panel[data-desk="teach"] .live-call-stage.has-video {
  min-height: 0;
}

.live-call-panel[data-desk="teach"] .live-call-preview,
.live-call-panel[data-desk="teach"][data-view="full"] .live-call-preview,
.live-call-panel[data-desk="teach"]:fullscreen .live-call-preview,
.live-call-panel[data-desk="teach"]:-webkit-full-screen .live-call-preview {
  flex: 1 1 auto;
  height: auto !important;
  min-height: min(78dvh, 920px);
  max-height: none;
  border-radius: 14px;
  background: #ece7dc;
  /* visible so caption box can sit partly outside the page frame */
  overflow: visible;
  touch-action: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 12px 32px rgba(0, 0, 0, 0.4);
}

.live-call-panel[data-desk="teach"] .live-teach-zoom {
  overflow: hidden;
  border-radius: inherit;
}

.live-call-panel[data-desk="teach"]:fullscreen,
.live-call-panel[data-desk="teach"]:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  padding:
    max(0.35rem, env(safe-area-inset-top))
    max(0.35rem, env(safe-area-inset-right))
    max(0.45rem, env(safe-area-inset-bottom))
    max(0.35rem, env(safe-area-inset-left)) !important;
}

.live-call-panel[data-desk="teach"]:fullscreen .live-call-preview,
.live-call-panel[data-desk="teach"]:-webkit-full-screen .live-call-preview {
  height: calc(100dvh - 7.2rem) !important;
}

.live-teach-zoom {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.live-call-panel[data-desk="teach"] .live-call-still-img {
  object-fit: contain;
  object-position: top center;
  width: 100%;
  height: 100%;
  background: #f4f1ea;
}

.live-call-panel[data-desk="teach"] .live-call-annotate-canvas {
  inset: 0;
}

.live-call-panel[data-desk="teach"] .live-call-teach-badge {
  top: 0.35rem;
  inset-inline-start: 0.35rem;
  font-size: 0.6rem;
  padding: 0.14rem 0.4rem;
  opacity: 0.8;
}

.live-call-panel[data-desk="teach"] .live-call-captions--on-video {
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0.55rem;
  top: auto;
  z-index: 12;
  max-height: min(42%, 14rem);
  gap: 0.35rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  padding: 0.4rem 0.5rem 0.5rem;
  border-radius: 14px;
  /* Nearly clear — page stays readable underneath */
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.live-call-panel[data-desk="teach"] .live-call-captions--on-video.is-dragging {
  cursor: grabbing;
  background: rgba(0, 0, 0, 0.1);
}

.live-call-panel[data-desk="teach"] .live-call-captions--on-video.is-cap-dragged {
  right: auto;
  width: min(92%, 22rem);
}

.live-call-panel[data-desk="teach"] .live-call-captions--on-video.is-cap-resized {
  max-height: none;
}

.live-call-panel[data-desk="teach"] .live-call-captions--on-video[data-cap-size="s"] {
  max-height: min(28%, 9rem);
}
.live-call-panel[data-desk="teach"] .live-call-captions--on-video[data-cap-size="m"] {
  max-height: min(42%, 14rem);
}
.live-call-panel[data-desk="teach"] .live-call-captions--on-video[data-cap-size="l"] {
  max-height: min(58%, 22rem);
}
.live-call-panel[data-desk="teach"] .live-call-captions--on-video[data-cap-size="xl"] {
  max-height: min(72%, 32rem);
}

.live-cap-resize {
  display: none;
  align-self: center;
  width: 2.6rem;
  height: 0.55rem;
  margin: 0.1rem 0 0.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  cursor: ns-resize;
  touch-action: none;
  pointer-events: auto;
}

.live-call-panel[data-desk="teach"] .live-cap-resize:not([hidden]) {
  display: block;
}

.live-call-panel[data-desk="teach"] .live-call-captions--on-video.is-caps-hidden .live-cap {
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.live-call-panel[data-desk="teach"] .live-call-captions--on-video.is-caps-hidden {
  max-height: none;
  overflow: visible;
  pointer-events: none;
}

.live-call-panel[data-desk="teach"] .live-call-captions--on-video.is-caps-hidden .live-cap-chrome {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.live-call-panel[data-desk="teach"] .live-cap-chrome:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  pointer-events: auto;
  margin-bottom: 0.15rem;
}

.live-cap-chrome {
  display: none;
}

.live-cap-chrome-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border-radius: 999px;
  min-height: 1.7rem;
  padding: 0.12rem 0.55rem;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: grab;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.live-cap-chrome-btn:active {
  cursor: grabbing;
}

#liveCapHideBtn {
  cursor: pointer;
}

.live-call-panel[data-desk="teach"] .live-call-captions--on-video .live-cap {
  padding: 0;
  border-radius: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.live-call-panel[data-desk="teach"] .live-cap-label {
  font-size: 0.72rem;
  margin-bottom: 0.1rem;
  color: #fff;
  font-weight: 800;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 8px rgba(0, 0, 0, 0.85),
    0 0 2px rgba(0, 0, 0, 1);
}

.live-call-panel[data-desk="teach"] .live-cap-text {
  font-size: 0.95rem;
  line-height: 1.55;
  max-height: min(12rem, 36dvh);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  pointer-events: auto;
  cursor: grab;
  white-space: pre-wrap;
  word-break: break-word;
  color: #fff !important;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 10px rgba(0, 0, 0, 0.8),
    0 0 2px rgba(0, 0, 0, 1);
  padding-inline-end: 0.15rem;
  background: transparent;
}

.live-call-panel[data-desk="teach"] .live-call-captions--on-video[data-cap-size="s"] .live-cap-text {
  font-size: 0.82rem;
  max-height: min(7rem, 22dvh);
}
.live-call-panel[data-desk="teach"] .live-call-captions--on-video[data-cap-size="l"] .live-cap-text {
  font-size: 1.05rem;
  max-height: min(18rem, 48dvh);
}
.live-call-panel[data-desk="teach"] .live-call-captions--on-video[data-cap-size="xl"] .live-cap-text {
  font-size: 1.15rem;
  max-height: min(26rem, 60dvh);
}

.live-call-panel[data-desk="teach"] .live-cap.live-cap-model,
.live-call-panel[data-desk="teach"] .live-cap.live-cap-user {
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.live-teach-chrome {
  display: none;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
  margin-top: 0.3rem;
  position: relative;
  z-index: 8;
}

.live-call-panel[data-desk="teach"] .live-teach-chrome:not([hidden]) {
  display: flex;
}

.live-teach-diag {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.55rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(125, 211, 252, 0.28);
  font-size: 0.7rem;
  font-weight: 700;
  color: #dbeafe;
  line-height: 1.35;
}

.live-call-panel[data-desk="teach"] .live-teach-diag:not([hidden]) {
  display: flex;
}

.live-teach-diag.is-warn {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

.live-teach-diag.is-bad {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.live-teach-diag-ico {
  flex: 0 0 auto;
  opacity: 0.85;
}

.live-teach-diag-text {
  flex: 1 1 auto;
  min-width: 0;
}

.live-teach-mic {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.55rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(8, 14, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  --mic-level: 0;
}

.live-teach-mic[hidden] {
  display: none !important;
}

.live-teach-mic-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #64748b;
  flex: 0 0 auto;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.live-teach-mic.is-hot .live-teach-mic-dot {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
}

.live-teach-mic-wave {
  flex: 1 1 auto;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.15), rgba(52, 211, 153, 0.95));
  transform-origin: right center;
  transform: scaleX(calc(0.08 + var(--mic-level) * 0.92));
  transition: transform 50ms linear;
  min-width: 2rem;
}

.live-teach-mic-label {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  color: #9fb2c7;
}

.live-call-panel[data-desk="teach"] .live-cap {
  padding: 0;
  font-size: inherit;
  background: transparent !important;
  border: none !important;
}

.live-call-panel[data-desk="teach"] .live-call-actions {
  display: none !important;
}

.live-call-panel[data-desk="teach"] .live-call-ctrl-label {
  font-size: 0.62rem;
}

/* Edge page turn — light chevrons, no heavy side fades */
.live-teach-edge {
  position: absolute;
  z-index: 7;
  top: 40%;
  width: 2.4rem;
  height: 2.4rem;
  margin-top: -1.2rem;
  border: 1px solid rgba(20, 40, 70, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #1a2b3c;
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(20, 40, 70, 0.16);
}

.live-call-panel[data-desk="teach"] .live-teach-edge:not([hidden]) {
  display: flex;
}

/* Tools live under the book now — edge page turns stay usable while drawing */

.live-teach-edge:active {
  background: #fff;
  transform: scale(0.96);
}

.live-teach-edge--next {
  left: 0.35rem;
  right: auto;
}

.live-teach-edge--prev {
  right: 0.35rem;
  left: auto;
}

/* Pager lives in teach chrome under the page */
.live-call-pdf-bar {
  position: relative;
  z-index: 1;
  top: auto;
  bottom: auto;
  left: auto;
  transform: none;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  max-width: none;
  padding: 0.4rem 0.45rem;
    border-radius: 16px;
  background: rgba(8, 12, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.live-call-pdf-bar[hidden] {
  display: none !important;
}

.live-call-panel[data-desk="teach"] .live-call-pdf-bar {
  gap: 0.32rem;
  padding: 0.42rem 0.5rem;
  flex-wrap: wrap;
}

.live-call-panel[data-desk="teach"] .live-teach-nav {
  min-width: 3.4rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  padding: 0.42rem 0.7rem;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
}

.live-call-panel[data-desk="teach"] .live-teach-skip {
  min-width: 3rem;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.42rem 0.55rem;
  border-color: rgba(125, 211, 252, 0.4);
  background: rgba(14, 70, 110, 0.5);
}

.live-call-panel[data-desk="teach"] .live-teach-skip:disabled,
.live-call-panel[data-desk="teach"] .live-teach-nav:disabled {
  opacity: 0.32;
  cursor: default;
}

.live-call-pdf-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #eef3f8;
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 2.2rem;
}

.live-call-pdf-meta {
  font-size: 0.84rem;
  font-weight: 800;
  color: #e8f1fa;
  font-variant-numeric: tabular-nums;
  min-width: 3.6rem;
  text-align: center;
}

.live-call-pdf-jump {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  background: rgba(0, 0, 0, 0.34);
  border-radius: 999px;
  padding: 0.16rem 0.45rem 0.16rem 0.28rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.live-call-pdf-jump-label {
  display: none;
}

.live-call-pdf-jump input {
  width: 3rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #eef3f8;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  padding: 0.28rem 0.25rem;
  min-height: 2rem;
}

.live-call-pdf-pick {
  border-color: rgba(109, 206, 162, 0.45);
  background: rgba(20, 90, 70, 0.35);
}

.live-teach-rail-close {
  display: none;
}

.live-call-panel[data-desk="teach"] .live-teach-rail-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #e8eef7;
  font-size: 0.72rem;
  font-weight: 800;
}

.live-teach-help-btn {
  appearance: none;
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.live-call-panel[data-desk="teach"] .live-teach-help-btn:not([hidden]) {
  display: inline-flex;
}

/* Corner-only teach chrome: left stack + top-right surface — page center always free */
.live-teach-draw-dock {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 16;
  pointer-events: none;
  margin: 0;
  width: auto;
  flex: none;
  background: transparent !important;
}

.live-call-panel[data-desk="teach"] .live-teach-draw-dock:not([hidden]) {
  display: block;
  background: transparent !important;
}

.live-teach-corner-btn--help,
.live-call-panel[data-desk="teach"] .live-teach-corner-btn--help:not([hidden]) {
  position: absolute;
  top: 0.55rem;
  left: 3.15rem;
  z-index: 35;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
  text-shadow: 0 0 4px #fff, 0 0 8px #fff;
  box-shadow: none;
}

/* Top-right: camera leave + book/board surface (source menu lives top-left) */
.live-teach-mode-switch,
.live-call-panel[data-desk="teach"] .live-teach-mode-switch:not([hidden]) {
  position: absolute;
  top: 0.3rem;
  right: 0.25rem;
  z-index: 34;
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.28rem;
  max-width: min(78vw, 16rem);
}

.live-teach-mode-switch[hidden] {
  display: none !important;
}

/* Teach source switch — top-left FAB (opens menu downward into free space) */
.live-teach-more-src,
.live-call-panel[data-desk="teach"] .live-teach-more-src {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  z-index: 36;
  pointer-events: auto;
  display: inline-flex;
}

.live-teach-more-src.is-open {
  z-index: 60;
}

.live-teach-more-src-trig {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  min-height: 2.55rem;
  padding: 0;
  border-radius: 14px;
  border: 1.5px solid rgba(56, 189, 248, 0.7);
  background: rgba(8, 47, 73, 0.88);
  color: #e0f2fe;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.live-teach-more-src-trig:hover,
.live-teach-more-src-trig:focus-visible {
  background: rgba(3, 105, 161, 0.95);
  outline: none;
}

.live-teach-more-src .live-ann-pop-menu,
.live-teach-more-src-menu {
  top: calc(100% + 0.4rem);
  bottom: auto;
  left: 0;
  right: auto;
  min-width: 10rem;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.2rem;
  transform: none;
}

.live-teach-more-src-menu button {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  text-align: right;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #f8fafc;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  min-height: 2.2rem;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.live-teach-more-src-menu button:hover,
.live-teach-more-src-menu button:focus-visible {
  background: rgba(56, 189, 248, 0.22);
  outline: none;
}

.live-teach-leave-btn,
.live-call-panel[data-desk="teach"] .live-teach-leave-btn {
  position: static;
  appearance: none;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-height: 2.45rem;
  min-width: 2.8rem;
  max-width: min(42vw, 9.5rem);
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  border: 1.5px solid rgba(14, 165, 233, 0.85);
  background: rgba(8, 47, 73, 0.78);
  color: #e0f2fe;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  line-height: 1.15;
  text-align: center;
  text-shadow: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.live-teach-leave-ico {
  display: inline-flex;
  width: 0.95rem;
  height: 0.95rem;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.live-teach-leave-ico svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}

.live-teach-surface-btn,
.live-call-panel[data-desk="teach"] .live-teach-surface-btn:not([hidden]) {
  position: static;
  appearance: none;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-height: 2.45rem;
  max-width: min(46vw, 11rem);
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  border: 1.5px solid rgba(16, 185, 129, 0.55);
  background: rgba(6, 78, 59, 0.72);
  color: #ecfdf5;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(6, 78, 59, 0.28);
  line-height: 1.15;
  text-align: center;
  text-shadow: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.live-call-panel[data-desk="teach"] .live-teach-surface-btn.is-return-book {
  min-height: 2.65rem;
  max-width: min(58vw, 13.5rem);
  padding: 0.4rem 0.9rem;
  font-size: 0.88rem;
  border-color: rgba(52, 211, 153, 0.95);
  background: rgba(4, 120, 87, 0.92);
  color: #fff;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
  animation: live-return-pulse 1.1s ease-out 2;
}

@keyframes live-return-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 6px 18px rgba(6, 78, 59, 0.42);
  }
  40% {
    transform: scale(1.05);
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.55);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 6px 18px rgba(6, 78, 59, 0.42);
  }
}

/* Desk tray: تخته is the corner surface btn — hide duplicate */
.live-call-panel[data-desk="teach"] #liveCallSrcBoard {
  display: none !important;
}

.live-teach-surface-ico {
  font-size: 0.95rem;
  line-height: 1;
}

/* Top of PDF: color + width only (menus open downward) */
.live-teach-top-inks,
.live-call-panel[data-desk="teach"] .live-teach-top-inks:not([hidden]) {
  position: absolute;
  top: 0.35rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 32;
  pointer-events: auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  max-width: min(70vw, 16rem);
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.live-teach-top-inks[hidden] {
  display: none !important;
}

.live-teach-top-inks .live-ann-pop--down .live-ann-pop-menu {
  top: calc(100% + 0.35rem);
  bottom: auto;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.live-call-panel[data-desk="teach"] .live-teach-toolstrip .live-ann-ico--svg {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
}

.live-call-panel[data-desk="teach"] .live-teach-toolstrip .live-ann-ico--svg svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

/* On-PDF bottom: clear mini controls, no strip kader — menus must not be clipped (never matte the whole page) */
.live-call-panel[data-desk="teach"] .live-call-preview {
  overflow: visible;
}
.live-call-panel[data-desk="teach"] .live-teach-zoom {
  overflow: hidden;
}
.live-call-panel[data-desk="teach"] .live-teach-draw-dock {
  overflow: visible;
  z-index: 28;
}

.live-teach-onpage-tools,
.live-call-panel[data-desk="teach"] .live-teach-onpage-tools:not([hidden]) {
  position: absolute;
  left: 0.25rem;
  right: 0.25rem;
  bottom: 0.2rem;
  z-index: 30;
  pointer-events: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.28rem;
  max-width: 100%;
  padding: 0;
  margin: 0;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-sizing: border-box;
}

.live-teach-onpage-tools[hidden] {
  display: none !important;
}

.live-teach-onpage-tools > *,
.live-teach-onpage-tools .live-teach-toolstrip,
.live-teach-onpage-tools .live-ann-pop,
.live-teach-onpage-tools .live-ann-pop-menu,
.live-teach-onpage-tools .live-ann-tool,
.live-teach-onpage-tools .live-ann-action,
.live-teach-onpage-tools .live-ann-pop-trig,
.live-teach-onpage-tools .live-teach-tools-fab,
.live-teach-top-inks .live-ann-pop,
.live-teach-top-inks .live-ann-pop-menu,
.live-teach-top-inks .live-ann-pop-trig {
  pointer-events: auto;
}

.live-teach-tools-fab {
  position: static;
  appearance: none;
  border: 2px solid rgba(100, 116, 139, 0.95) !important;
  background: rgba(15, 23, 42, 0.82) !important;
  color: #f8fafc !important;
  border-radius: 999px;
  width: auto;
  min-width: 7.6rem;
  height: auto;
  min-height: 2.55rem;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35) !important;
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-shadow: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  filter: none !important;
  opacity: 1 !important;
  letter-spacing: 0.01em;
}

.live-teach-tools-fab-ico {
  font-size: 1.05rem;
  line-height: 1;
}

.live-teach-tools-fab-txt {
  display: inline !important;
  font-size: 0.78rem;
  line-height: 1.15;
  white-space: nowrap;
}

.live-call-panel[data-desk="teach"] .live-teach-tools-fab:not([hidden]) {
  display: inline-flex;
}

.live-call-panel[data-desk="teach"] .live-teach-tools-fab.is-open {
  border-color: rgba(52, 211, 153, 0.95) !important;
  background: rgba(4, 120, 87, 0.95) !important;
  color: #fff !important;
  filter: none !important;
  opacity: 1 !important;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.45) !important;
  text-shadow: none;
}

.live-call-panel[data-desk="teach"] .live-call-annotate-bar.live-teach-toolstrip,
.live-call-annotate-bar.live-teach-toolstrip {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  display: none;
  flex: 1 1 auto;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.22rem;
  width: auto;
  max-width: 100%;
  padding: 0 !important;
  margin: 0;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: auto;
  overflow: visible !important;
}

.live-call-panel[data-desk="teach"] .live-call-annotate-bar.live-teach-toolstrip.is-open,
.live-call-annotate-bar.live-teach-toolstrip.is-open,
.live-call-panel[data-desk="teach"] .live-call-annotate-bar.live-teach-toolstrip:not([hidden]) {
  display: flex !important;
}

.live-ann-title--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.live-call-panel[data-desk="teach"] .live-teach-toolstrip .live-ann-tool,
.live-call-panel[data-desk="teach"] .live-teach-toolstrip .live-ann-action.live-ann-ghost {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  width: auto;
  min-width: 2.35rem;
  height: auto;
  min-height: 2.35rem;
  padding: 0.15rem 0.28rem;
  border-radius: 10px;
  border: none !important;
  background: transparent !important;
  color: #0f172a;
  font: inherit;
  font-size: 0.58rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none !important;
  text-shadow: 0 0 3px #fff, 0 0 6px #fff, 0 1px 2px rgba(255, 255, 255, 0.95);
  transition: color 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

/* Pen OFF (Photoshop-like idle): grayed tools — still tappable to turn pen on */
.live-call-panel[data-desk="teach"]:not(.is-tools-open) .live-teach-toolstrip .live-ann-tool,
.live-call-panel[data-desk="teach"]:not(.is-tools-open) .live-teach-toolstrip .live-ann-action.live-ann-ghost,
.live-call-panel[data-desk="teach"]:not(.is-tools-open) .live-teach-top-inks .live-ann-pop-trig {
  color: #94a3b8 !important;
  filter: grayscale(1);
  opacity: 0.72;
  text-shadow: 0 0 2px #fff, 0 0 4px #fff;
}

.live-call-panel[data-desk="teach"]:not(.is-tools-open) .live-teach-top-inks .live-ann-pop-swatch {
  filter: grayscale(1);
  opacity: 0.55;
}

/* Master pen toggle stays vivid even when tools are idle (never looks «disabled») */
.live-call-panel[data-desk="teach"]:not(.is-tools-open) .live-teach-tools-fab {
  color: #f8fafc !important;
  filter: none !important;
  opacity: 1 !important;
  border-color: rgba(148, 163, 184, 0.95) !important;
  background: rgba(30, 41, 59, 0.9) !important;
}

/* Pen ON: vivid distinct tool colors */
.live-call-panel[data-desk="teach"].is-tools-open .live-teach-toolstrip .live-ann-tool[data-tool='pen'] {
  color: #0369a1 !important;
}
.live-call-panel[data-desk="teach"].is-tools-open .live-teach-toolstrip .live-ann-tool[data-tool='highlight'] {
  color: #ca8a04 !important;
}
.live-call-panel[data-desk="teach"].is-tools-open .live-teach-toolstrip .live-ann-tool[data-tool='laser'] {
  color: #dc2626 !important;
}
.live-call-panel[data-desk="teach"].is-tools-open .live-teach-toolstrip .live-ann-tool[data-tool='rect'] {
  color: #7c3aed !important;
}
.live-call-panel[data-desk="teach"].is-tools-open .live-teach-toolstrip .live-ann-tool[data-tool='oval'] {
  color: #0d9488 !important;
}
.live-call-panel[data-desk="teach"].is-tools-open .live-teach-toolstrip .live-ann-tool[data-tool='eraser'] {
  color: #ea580c !important;
}
.live-call-panel[data-desk="teach"].is-tools-open .live-teach-toolstrip .live-ann-action#liveCallAnnUndo {
  color: #475569 !important;
}
.live-call-panel[data-desk="teach"].is-tools-open .live-teach-toolstrip .live-ann-action#liveCallAnnClear {
  color: #b91c1c !important;
}
.live-call-panel[data-desk="teach"].is-tools-open .live-teach-top-inks .live-ann-pop-trig {
  color: #0f172a !important;
  filter: none;
  opacity: 1;
}
.live-call-panel[data-desk="teach"].is-tools-open .live-teach-top-inks .live-ann-pop-swatch {
  filter: none;
  opacity: 1;
}

.live-call-panel[data-desk="teach"] .live-teach-toolstrip .live-ann-tool.is-on {
  color: inherit;
  background: transparent !important;
  box-shadow: none !important;
  text-shadow: 0 0 3px #fff, 0 0 8px #e0f2fe, 0 0 6px #fff;
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.live-call-panel[data-desk="teach"] .live-teach-toolstrip .live-ann-ico {
  font-size: 0.95rem;
  line-height: 1;
}

.live-call-panel[data-desk="teach"] .live-teach-toolstrip .live-ann-lbl {
  display: inline !important;
  font-size: 0.56rem;
  line-height: 1;
  white-space: nowrap;
}

.live-ann-pop {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  z-index: 40;
}

.live-ann-pop.is-open {
  z-index: 50;
}

.live-ann-pop-trig {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  width: auto;
  min-width: 3.4rem;
  height: 2.35rem;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  border: none !important;
  background: transparent !important;
  color: #0f172a;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none !important;
  text-shadow: 0 0 3px #fff, 0 0 6px #fff, 0 1px 2px rgba(255, 255, 255, 0.95);
}

.live-ann-pop-trig .live-ann-pop-txt {
  display: inline !important;
  white-space: nowrap;
}

.live-ann-pop-swatch {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  background: var(--ann-c, #ff4d4f);
  border: 1px solid rgba(15, 23, 42, 0.35);
  box-shadow: 0 0 0 1px #fff;
}

.live-ann-pop-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.35rem);
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  min-width: 8rem;
  max-width: min(80vw, 13rem);
  padding: 0.45rem;
  border-radius: 12px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}

.live-ann-pop-menu[hidden] {
  display: none !important;
}

.live-ann-pop-menu--width {
  flex-direction: column;
  min-width: 5.2rem;
  max-width: 6.5rem;
}

.live-ann-color {
  width: 1.55rem;
  height: 1.55rem;
  min-width: 1.55rem;
  min-height: 1.55rem;
  padding: 0;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: var(--ann-swatch, #ff4d4f) !important;
  cursor: pointer;
  box-shadow: none;
}

.live-ann-color.is-on {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
  border-color: #fff;
}

.live-ann-color[data-color="white"] {
  border-color: rgba(15, 23, 42, 0.45);
}

.live-ann-width {
  min-height: 1.7rem;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}

.live-ann-width.is-on {
  background: rgba(16, 185, 129, 0.4);
  border-color: rgba(110, 231, 183, 0.7);
  color: #ecfdf5;
}

.live-call-panel[data-desk="teach"] .live-teach-toolstrip .live-ann-danger {
  color: #b91c1c;
}
.live-call-panel[data-desk="teach"] .live-teach-chrome {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.35rem;
}

.live-call-panel[data-desk="teach"] .live-teach-pager {
  flex: 0 0 auto;
  width: 100%;
}
.live-ann-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.live-ann-row--tools {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.28rem;
}

.live-call-panel[data-desk="teach"] .live-teach-rail:not(.live-teach-ps) .live-ann-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.22rem 0.12rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
  font-size: 0.58rem;
  font-weight: 800;
}

.live-call-panel[data-desk="teach"] .live-teach-rail .live-ann-tool.is-on {
  border-color: rgba(56, 189, 248, 0.75);
  background: rgba(14, 165, 233, 0.22);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.25);
}

.live-ann-ico {
  font-size: 1.05rem;
  line-height: 1;
}

.live-ann-lbl {
  line-height: 1.1;
}

.live-ann-row--style {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.live-ann-widths,
.live-ann-colors {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.live-ann-mini-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: #94a3b8;
  margin-inline-end: 0.1rem;
}

.live-ann-width {
  appearance: none;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.live-ann-width i {
  display: block;
  width: 70%;
  height: 2px;
  border-radius: 999px;
  background: #e2e8f0;
}

.live-ann-width[data-width="s"] i { height: 1.5px; width: 55%; }
.live-ann-width[data-width="m"] i { height: 2.5px; width: 68%; }
.live-ann-width[data-width="l"] i { height: 4px; width: 78%; }

.live-ann-width.is-on {
  border-color: rgba(56, 189, 248, 0.8);
  background: rgba(14, 165, 233, 0.2);
}

.live-call-panel[data-desk="teach"] .live-teach-rail .live-ann-color {
  width: 1.35rem;
  height: 1.35rem;
}

.live-ann-pill {
  min-height: 2.1rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.live-ann-danger {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.35);
}

.live-ann-row--acts {
  justify-content: flex-start;
}

/* Coach marks tour */
.live-teach-coach {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.live-teach-coach:not([hidden]) {
  pointer-events: auto;
}

.live-teach-coach-dim {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
}

.live-teach-coach-spot {
  position: fixed;
  z-index: 81;
  border-radius: 16px;
  box-shadow:
    0 0 0 9999px rgba(2, 6, 23, 0.58),
    0 0 0 2px rgba(125, 211, 252, 0.95),
    0 8px 28px rgba(14, 165, 233, 0.35);
  pointer-events: none;
  transition: left 0.2s ease, top 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.live-teach-coach-card {
  position: fixed;
  z-index: 82;
  width: min(340px, calc(100vw - 24px));
  padding: 0.85rem 0.9rem 0.75rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #0f172a, #020617);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f8fafc;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

/* RTL: close control sits on the visual top-right of the card */
.live-teach-coach-close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  appearance: none;
  width: 2.1rem;
  height: 2.1rem;
  border: none;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: #f8fafc;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.live-teach-coach-close:hover,
.live-teach-coach-close:focus-visible {
  background: rgba(248, 113, 113, 0.35);
  outline: none;
}

.live-teach-coach-card .live-teach-coach-step {
  padding-left: 2.2rem;
}

.live-teach-coach-arrow {
  position: absolute;
  left: 50%;
  width: 12px;
  height: 12px;
  background: #0f172a;
  border-left: 1px solid rgba(148, 163, 184, 0.35);
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  transform: translateX(-50%) rotate(45deg);
}

.live-teach-coach-arrow[data-dir="up"] {
  top: -6px;
}

.live-teach-coach-arrow[data-dir="down"] {
  bottom: -6px;
  transform: translateX(-50%) rotate(225deg);
}

.live-teach-coach-step {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #7dd3fc;
}

.live-teach-coach-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.25;
}

.live-teach-coach-body {
  margin: 0 0 0.75rem;
  font-size: 0.86rem;
  line-height: 1.65;
  color: #e2e8f0;
}

.live-teach-coach-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.live-teach-coach-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  border-radius: 999px;
  min-height: 2.05rem;
  padding: 0.25rem 0.75rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.live-teach-coach-btn--primary {
  background: linear-gradient(145deg, #0284c7, #0f766e);
  border-color: rgba(125, 211, 252, 0.45);
}

.live-teach-coach-btn--ghost {
  opacity: 0.88;
}

.live-teach-coach-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.live-call-panel[data-desk="teach"] .live-call-actions {
  display: none !important;
}

.live-call-preview.is-board {
  background: #f7f4ec;
}

.live-call-panel[data-desk="teach"] .live-call-preview.is-board {
  background: #efeae0;
}

@media (max-width: 480px) {
  .live-call-panel[data-desk="teach"] .live-call-preview,
  .live-call-panel[data-desk="teach"][data-view="full"] .live-call-preview {
    min-height: min(62dvh, 640px);
  }
  .live-call-panel[data-desk="teach"] .live-call-annotate-bar.live-teach-toolstrip.is-open {
    max-height: none !important;
  }
  .live-call-panel[data-desk="teach"] .live-teach-surface-btn.is-return-book {
    max-width: calc(100% - 0.5rem);
  }
  .live-call-panel[data-desk="teach"] .live-teach-mode-switch:not([hidden]) {
    max-width: calc(100% - 2.6rem);
    gap: 0.22rem;
  }
  .live-call-panel[data-desk="teach"] .live-teach-leave-btn,
  .live-call-panel[data-desk="teach"] .live-teach-surface-btn:not([hidden]),
  .live-call-panel[data-desk="teach"] .live-teach-more-src-trig,
  .live-call-panel[data-desk="teach"] .live-teach-tools-fab:not([hidden]) {
    min-height: 2.7rem;
  }
  .live-call-panel[data-desk="teach"] .live-teach-tools-fab:not([hidden]) {
    min-width: 8.2rem;
    font-size: 0.82rem;
  }
  .live-teach-edge {
    width: 2.15rem;
    height: 2.15rem;
    font-size: 1.2rem;
  }
  .live-teach-coach-actions {
    justify-content: stretch;
  }
  .live-teach-coach-btn {
    flex: 1 1 auto;
  }
}



