﻿:root {
  --ink: #17324d;
  --muted: #678097;
  --paper: #fffdf8;
  --sky: #e9f6ff;
  --blue: #4089ff;
  --blue-dark: #2368dc;
  --yellow: #ffd76a;
  --coral: #ff8e82;
  --shadow:
    0 18px 55px rgba(46, 99, 145, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 9% 8%,
      rgba(255, 215, 106, 0.28),
      transparent 18rem
    ),
    radial-gradient(
      circle at 92% 18%,
      rgba(111, 210, 255, 0.2),
      transparent 21rem
    ),
    var(--paper);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-shell {
  min-height: 100vh;
}

/* Top navigation */

.topbar {
  width: min(1240px, calc(100% - 40px));
  min-height: 78px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.watch-back-nav {
  display: flex;
  align-items: center;
  gap: 7px;
}

.watch-back-button,
.watch-home-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  color: #45647e;
  border: 1px solid rgba(64, 137, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  transition:
    color 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.watch-back-button:hover,
.watch-home-button:hover {
  color: var(--blue-dark);
  border-color: rgba(64, 137, 255, 0.35);
  background: #edf6ff;
  transform: translateY(-1px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px 14px 18px 18px;
  color: #fff;
  background:
    linear-gradient(
      145deg,
      #65a2ff,
      #3476ec
    );
  box-shadow:
    0 8px 18px rgba(52, 118, 236, 0.25);
  transform: rotate(-4deg);
}

.top-nav {
  display: flex;
  gap: 8px;
  padding: 6px;
  border:
    1px solid rgba(64, 137, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.nav-item.active {
  color: #fff;
  background: var(--blue);
}

.parent-link {
  display: inline-flex;
  align-items: center;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

/* Main page */

.main-grid {
  width: min(1240px, calc(100% - 40px));
  margin: 18px auto 0;
  display: grid;
  grid-template-columns:
    minmax(0, 1.65fr)
    minmax(330px, 0.75fr);
  gap: 24px;
}

.lesson-column,
.buddy-column {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow:
    0 0 0 5px rgba(255, 142, 130, 0.17);
}

.lesson-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.lesson-lead {
  max-width: 700px;
  margin: 14px 0 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

/* Video */

.video-card {
  position: relative;
  overflow: hidden;
  min-height: 490px;
  border: 8px solid #fff;
  border-radius: 30px;
  background: #12253d;
  box-shadow: var(--shadow);
}

.lesson-video {
  width: 100%;
  height: 474px;
  min-height: 474px;
  display: block;
  object-fit: contain;
  background: #12253d;
}

.parent-video-lock {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 34px;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(
      circle at 50% 24%,
      rgba(93, 189, 172, 0.24),
      transparent 18rem
    ),
    rgba(16, 35, 56, 0.96);
  backdrop-filter: blur(12px);
}

.parent-video-lock[hidden] {
  display: none;
}

.parent-video-lock-icon {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 27px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 43px;
}

.parent-video-lock strong {
  margin-top: 20px;
  font-size: clamp(25px, 4vw, 37px);
}

.parent-video-lock p {
  max-width: 520px;
  margin: 13px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.7;
}

.parent-video-lock small {
  margin-top: 11px;
  color: #ffd76a;
  font-size: 11px;
  font-weight: 900;
}

.parent-video-lock a {
  margin-top: 22px;
  padding: 11px 18px;
  color: #17324d;
  border-radius: 13px;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}
.video-badge,
.video-buffer-status {
  position: absolute;
  top: 18px;
  z-index: 2;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.video-badge {
  left: 20px;
  padding: 8px 13px;
  color: #153c62;
  background: var(--yellow);
}

.video-buffer-status {
  right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  color: #fff;
  background: rgba(17, 37, 61, 0.76);
  backdrop-filter: blur(8px);
}

.video-buffer-status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  animation:
    pulse 0.9s ease-in-out infinite alternate;
}

.video-buffer-status[hidden] {
  display: none;
}

.video-credit {
  margin: 10px 4px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.video-credit a {
  color: var(--blue-dark);
}

@keyframes pulse {
  to {
    opacity: 0.35;
    transform: scale(0.72);
  }
}

/* Chapters */

.chapter-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.chapter-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  text-align: left;
  border:
    1px solid rgba(42, 104, 161, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.chapter-card:hover,
.chapter-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(64, 137, 255, 0.35);
  box-shadow:
    0 10px 24px rgba(46, 99, 145, 0.12);
}

.chapter-number {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--blue-dark);
  background: var(--sky);
  font-weight: 900;
}

.chapter-copy,
.chapter-copy strong,
.chapter-copy span {
  display: block;
}

.chapter-copy strong {
  font-size: 14px;
}

.chapter-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

/* AI companion */

.buddy-card {
  position: sticky;
  top: 18px;
  overflow: hidden;
  border:
    1px solid rgba(64, 137, 255, 0.13);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.buddy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 12px;
}

.buddy-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.buddy-name strong,
.buddy-name span {
  display: block;
}

.buddy-name span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #43c98e;
  box-shadow:
    0 0 0 5px rgba(67, 201, 142, 0.14);
}

.stage-pill {
  padding: 7px 11px;
  color: #7c5a00;
  border-radius: 999px;
  background: #fff2bd;
  font-size: 11px;
  font-weight: 900;
}

.human-stage {
  position: relative;
  height: 430px;
  margin: 0 14px;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(
      circle at 50% 78%,
      rgba(64, 137, 255, 0.18),
      transparent 36%
    ),
    linear-gradient(
      180deg,
      #eef9ff,
      #f9fdff 62%,
      #e7f3f8
    );
}

.human-stage::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: 18px;
  width: 190px;
  height: 36px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(39, 88, 124, 0.11);
  filter: blur(7px);
}

.digital-human-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.digital-human-canvas,
.digital-human-canvas canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.digital-human-wrap.is-speaking
.human-status {
  color: #fff;
  background: var(--blue);
}

.human-status {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 12px;
  min-width: 150px;
  padding: 8px 13px;
  transform: translateX(-50%);
  color: #34536f;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 6px 18px rgba(45, 91, 130, 0.13);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.human-retry {
  position: absolute;
  z-index: 4;
  right: 12px;
  top: 12px;
  padding: 8px 11px;
  color: var(--blue-dark);
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 800;
}

/* Conversation */

.chat-preview {
  padding: 16px 18px 20px;
}

.conversation-panel {
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid rgba(64, 137, 255, 0.16);
  border-radius: 18px;
  background: #fbfdff;
}

.conversation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(64, 137, 255, 0.12);
  background: #fff;
}

.conversation-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.conversation-head strong {
  color: var(--ink);
  font-size: 13px;
}

.conversation-head span {
  color: var(--muted);
  font-size: 10px;
}

.conversation-clear {
  flex: 0 0 auto;
  padding: 7px 9px;
  color: #b54d49;
  border: 1px solid rgba(240, 110, 102, 0.22);
  border-radius: 10px;
  background: #fff6f5;
  font-size: 10px;
  font-weight: 800;
}

.conversation-clear:hover:not(:disabled) {
  color: #963a36;
  background: #ffebe9;
}

.conversation-clear:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.conversation-history {
  min-height: 150px;
  max-height: min(340px, 42vh);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  scroll-behavior: smooth;
  scrollbar-color: rgba(64, 137, 255, 0.3) transparent;
}

.conversation-message {
  width: fit-content;
  max-width: 88%;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 15px;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.conversation-message.is-user {
  align-self: flex-end;
  color: #fff;
  border-bottom-right-radius: 5px;
  background: linear-gradient(135deg, #4c94ff, #2f7be7);
}

.conversation-message.is-assistant {
  align-self: flex-start;
  color: #36556f;
  border-bottom-left-radius: 5px;
  background: var(--sky);
}

.conversation-speaker {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.03em;
  opacity: 0.76;
  text-transform: uppercase;
}

.conversation-content {
  white-space: pre-wrap;
}

.conversation-empty {
  margin: auto;
  padding: 18px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.speech-bubble {
  min-height: 0;
  margin-bottom: 10px;
  padding: 9px 12px;
  color: #536f87;
  border-radius: 12px;
  background: #f4f8fc;
  font-size: 11px;
  line-height: 1.5;
}

.chat-note {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.ai-call-panel {
  margin-bottom: 11px;
  padding: 11px;
  border:
    1px solid rgba(64, 137, 255, 0.16);
  border-radius: 17px;
  background: #fbfdff;
}

.parent-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 9px;
  color: #536f87;
  font-size: 11px;
  line-height: 1.45;
}

.parent-consent input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--blue);
}

.call-actions {
  display: flex;
  gap: 7px;
}

.call-start-button {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--blue-dark);
  border:
    1px solid rgba(64, 137, 255, 0.22);
  border-radius: 14px;
  background: #f2f8ff;
  font-size: 13px;
  font-weight: 900;
}

.call-start-button:hover:not(:disabled) {
  background: #e7f2ff;
}

.call-start-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.call-control-button,
.call-end-button {
  min-height: 39px;
  flex: 1;
  padding: 7px 8px;
  border: 0;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 900;
}

.call-control-button {
  color: var(--blue-dark);
  background: #eaf3ff;
}

.call-end-button {
  color: #fff;
  background: #f06e66;
}

.call-live-row {
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #36556f;
  font-size: 12px;
}

.call-live-row > span:last-child {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.call-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #43c98e;
  box-shadow:
    0 0 0 4px rgba(67, 201, 142, 0.14);
  animation:
    pulse 0.9s ease-in-out infinite alternate;
}

.call-live-hint {
  margin: -2px 0 9px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.call-privacy-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.question-form {
  display: flex;
  gap: 8px;
  padding: 7px;
  border:
    1px solid rgba(64, 137, 255, 0.18);
  border-radius: 18px;
  background: #fff;
}

.question-form input {
  min-width: 0;
  flex: 1;
  padding: 8px 9px;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
}

.question-form button {
  width: 44px;
  height: 44px;
  color: #fff;
  border: 0;
  border-radius: 14px;
  background: var(--blue);
  font-size: 18px;
  font-weight: 900;
}

.question-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.footer-note {
  width: min(1240px, calc(100% - 40px));
  margin: 32px auto 26px;
  color: #7890a5;
  font-size: 12px;
  text-align: center;
}

[hidden] {
  display: none !important;
}

/* Responsive */

@media (max-width: 1180px) {
  .watch-button-text {
    display: none;
  }

  .watch-back-button,
  .watch-home-button {
    width: 38px;
    padding: 0;
  }
}

@media (max-width: 980px) {
  .top-nav {
    display: none;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .buddy-card {
    position: static;
    display: grid;
    grid-template-columns:
      minmax(280px, 0.9fr)
      1fr;
  }

  .buddy-head {
    grid-column: 1 / -1;
  }

  .human-stage {
    height: 390px;
    margin-bottom: 14px;
  }

  .chat-preview {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

@media (max-width: 760px) {
  .parent-link {
    display: none;
  }

  .topbar-left {
    gap: 8px;
  }

  .watch-back-nav {
    gap: 5px;
  }

  .watch-back-button,
  .watch-home-button {
    width: 34px;
    min-height: 34px;
  }

  .topbar-left .brand {
    gap: 7px;
    font-size: 18px;
  }

  .topbar-left .brand-mark {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 680px) {
  .topbar,
  .main-grid,
  .footer-note {
    width: min(100% - 24px, 1240px);
  }

  .topbar {
    min-height: 66px;
  }

  .lesson-title {
    font-size: 34px;
  }

  .video-card,
  .lesson-video {
    min-height: 360px;
  }

  .lesson-video {
    height: 360px;
  }

  .chapter-row {
    grid-template-columns: 1fr;
  }

  .buddy-card {
    display: block;
  }

  .human-stage {
    height: 440px;
  }

  .call-actions {
    flex-wrap: wrap;
  }

  .call-control-button,
  .call-end-button {
    min-width: 30%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* Compact borderless tutor rail */
.topbar,
.footer-note {
  width: min(1480px, calc(100% - 40px));
}

.main-grid {
  width: min(1480px, calc(100% - 40px));
  grid-template-columns:
    minmax(0, 1.8fr)
    minmax(360px, 0.72fr);
  gap: 30px;
  align-items: start;
}

.buddy-column {
  align-self: start;
}

.buddy-card {
  position: sticky;
  top: 12px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.buddy-head {
  padding: 2px 4px 9px;
}

.human-stage {
  height: clamp(190px, 26vh, 285px);
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
}

.human-stage::after {
  bottom: 8px;
  width: 160px;
  height: 25px;
  background: rgba(39, 88, 124, 0.09);
}

.human-status {
  bottom: 6px;
  padding: 6px 11px;
  font-size: 10px;
}

.chat-preview {
  display: flex;
  flex-direction: column;
  padding: 9px 0 0;
}

.conversation-panel {
  height: clamp(260px, 32vh, 360px);
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: rgba(251, 253, 255, 0.96);
  box-shadow: 0 12px 30px rgba(46, 99, 145, 0.08);
}

.conversation-history {
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
}

.conversation-panel .question-form {
  flex: 0 0 auto;
  gap: 7px;
  padding: 7px 8px;
  border: 0;
  border-top: 1px solid rgba(64, 137, 255, 0.14);
  border-radius: 0;
  background: #fff;
}

.conversation-panel .question-form button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.speech-bubble {
  margin: 8px 0 0;
}

.ai-call-panel {
  margin: 8px 0 0;
  padding: 10px;
}

.chat-note {
  margin: 7px 0 0;
  font-size: 9px;
}

@media (max-width: 1100px) and (min-width: 981px) {
  .main-grid {
    grid-template-columns:
      minmax(0, 1.55fr)
      minmax(330px, 0.72fr);
    gap: 20px;
  }

  .stage-pill {
    display: none;
  }
}

@media (max-width: 980px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .buddy-card {
    position: static;
    display: grid;
    grid-template-columns:
      minmax(250px, 0.75fr)
      minmax(0, 1.25fr);
    gap: 16px;
  }

  .buddy-head {
    grid-column: 1 / -1;
  }

  .human-stage {
    height: clamp(280px, 42vw, 380px);
    margin: 0;
  }

  .chat-preview {
    justify-content: flex-start;
    padding: 0;
  }

  .conversation-panel {
    height: clamp(320px, 48vh, 420px);
  }
}

@media (max-width: 680px) {
  .topbar,
  .main-grid,
  .footer-note {
    width: min(100% - 24px, 1480px);
  }

  .buddy-card {
    display: block;
  }

  .buddy-head {
    padding: 4px 2px 8px;
  }

  .human-stage {
    height: 300px;
    margin-bottom: 8px;
  }

  .conversation-panel {
    height: min(390px, 54vh);
  }
}
/* Expandable tutor drawer layout */
.topbar,
.footer-note {
  width: min(1480px, calc(100% - 40px));
}

.main-grid {
  width: min(1480px, calc(100% - 40px));
  grid-template-columns:
    minmax(640px, 960px)
    minmax(350px, 1fr);
  justify-content: center;
  gap: 30px;
}

.main-grid.is-tutor-chat-open {
  width: min(1760px, calc(100% - 40px));
  grid-template-columns:
    minmax(700px, 920px)
    minmax(700px, 1fr);
  gap: 26px;
}

.lesson-column {
  width: 100%;
  max-width: 960px;
}

.video-card {
  min-height: 0;
  aspect-ratio: 16 / 9;
}

.lesson-video {
  height: 100%;
  min-height: 0;
}

.buddy-column,
.buddy-card,
.tutor-avatar-pane {
  min-width: 0;
}

.buddy-card {
  position: sticky;
  top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0;
  overflow: visible;
}

.main-grid.is-tutor-chat-open .buddy-card {
  grid-template-columns:
    minmax(280px, 330px)
    minmax(370px, 1fr);
  gap: 18px;
}

.tutor-avatar-pane {
  display: flex;
  flex-direction: column;
}

.buddy-head {
  min-height: 56px;
  padding: 3px 5px 8px;
}

.human-stage {
  height: clamp(390px, 50vh, 520px);
  overflow: hidden;
  background: transparent;
}

.main-grid.is-tutor-chat-open .human-stage {
  height: clamp(390px, 47vh, 480px);
}

.human-status {
  bottom: 10px;
  min-width: 165px;
  padding: 7px 12px;
  font-size: 11px;
}

.tutor-chat-launcher {
  width: calc(100% - 20px);
  min-height: 58px;
  margin: 10px auto 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #fff;
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(135deg, #4f96ff, #2676e9 58%, #2869d2);
  box-shadow: 0 13px 30px rgba(47, 123, 231, 0.27);
  text-align: left;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.tutor-chat-launcher:hover,
.tutor-chat-launcher:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 17px 34px rgba(47, 123, 231, 0.32);
}

.tutor-chat-launcher > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.17);
  font-size: 17px;
}

.tutor-chat-launcher strong {
  font-size: 11px;
  letter-spacing: 0.035em;
}

.tutor-chat-launcher small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 9px;
  font-weight: 800;
}

.tutor-chat-launcher.is-open {
  background: linear-gradient(135deg, #307bdc, #1f62bf);
}

.tutor-chat-drawer {
  height: min(680px, calc(100vh - 104px));
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(64, 137, 255, 0.18);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgba(108, 178, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 255, 0.98));
  box-shadow: 0 24px 60px rgba(40, 83, 122, 0.18);
  backdrop-filter: blur(18px);
}

.tutor-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tutor-drawer-head > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tutor-drawer-head > div > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tutor-drawer-head strong,
.tutor-drawer-head span {
  display: block;
}

.tutor-drawer-head strong {
  font-size: 18px;
}

.tutor-drawer-head div div span {
  color: var(--muted);
  font-size: 10px;
}

.tutor-chat-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #5f7890;
  border: 0;
  border-radius: 13px;
  background: #edf4fa;
  font-size: 24px;
  line-height: 1;
}

.tutor-chat-close:hover,
.tutor-chat-close:focus-visible {
  color: #255f9f;
  background: #e1effd;
}

.tutor-chat-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 5px;
  border-radius: 15px;
  background: #eaf1f7;
}

.tutor-chat-modes button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #678097;
  border: 0;
  border-radius: 11px;
  background: transparent;
  font-size: 11px;
  font-weight: 900;
}

.tutor-chat-modes button.is-active {
  color: var(--blue-dark);
  background: #fff;
  box-shadow: 0 5px 15px rgba(46, 99, 145, 0.1);
}

.tutor-chat-drawer .conversation-panel {
  min-height: 0;
  flex: 1 1 auto;
  height: auto;
  margin: 0;
  border-color: rgba(64, 137, 255, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

.tutor-chat-drawer .conversation-head {
  min-height: 49px;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.92);
}

.tutor-chat-drawer .conversation-head > strong {
  font-size: 13px;
}

.tutor-chat-drawer .conversation-history {
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(240, 248, 255, 0.62), rgba(251, 253, 255, 0.92));
}

.tutor-chat-drawer .conversation-message {
  max-width: 90%;
  padding: 10px 12px;
  box-shadow: 0 5px 14px rgba(46, 99, 145, 0.07);
}

.tutor-chat-drawer .question-form {
  margin: 0;
  padding: 8px;
  border-top: 1px solid rgba(64, 137, 255, 0.13);
  background: #fff;
}

.tutor-chat-drawer .question-form input {
  font-size: 13px;
}

.tutor-chat-drawer .question-form button {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.tutor-screen-reader-status {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.tutor-chat-drawer .ai-call-panel {
  min-height: 0;
  flex: 1 1 auto;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: clamp(20px, 4vw, 32px);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(78, 150, 255, 0.17), transparent 42%),
    rgba(255, 255, 255, 0.84);
}

.tutor-voice-intro {
  display: grid;
  justify-items: center;
  gap: 9px;
  text-align: center;
}

.tutor-voice-intro > span {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 23px;
  background: linear-gradient(145deg, #e6f2ff, #d7eaff);
  font-size: 31px;
  box-shadow: 0 12px 28px rgba(55, 125, 218, 0.16);
}

.tutor-voice-intro strong {
  font-size: 19px;
}

.tutor-voice-intro p {
  max-width: 330px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.tutor-chat-drawer .parent-consent {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(64, 137, 255, 0.14);
  border-radius: 14px;
  background: #f6faff;
}

@media (max-width: 1500px) {
  .main-grid,
  .main-grid.is-tutor-chat-open {
    width: min(1320px, calc(100% - 40px));
    grid-template-columns:
      minmax(0, 1fr)
      minmax(300px, 360px);
    gap: 24px;
  }

  .main-grid.is-tutor-chat-open .buddy-card {
    grid-template-columns: 1fr;
  }

  .tutor-chat-drawer {
    position: fixed;
    z-index: 40;
    top: 88px;
    right: 18px;
    width: min(430px, calc(100vw - 36px));
  }
}

@media (max-width: 980px) {
  .main-grid,
  .main-grid.is-tutor-chat-open {
    width: min(100% - 30px, 960px);
    grid-template-columns: 1fr;
  }

  .lesson-column {
    max-width: none;
  }

  .buddy-card,
  .main-grid.is-tutor-chat-open .buddy-card {
    display: block;
  }

  .human-stage,
  .main-grid.is-tutor-chat-open .human-stage {
    height: clamp(390px, 58vw, 520px);
  }

  .tutor-chat-launcher {
    width: min(460px, calc(100% - 20px));
  }
}

@media (max-width: 680px) {
  .topbar,
  .main-grid,
  .main-grid.is-tutor-chat-open,
  .footer-note {
    width: min(100% - 24px, 960px);
  }

  .video-card {
    min-height: 0;
    border-width: 5px;
    border-radius: 22px;
  }

  .lesson-video {
    height: 100%;
    min-height: 0;
  }

  .human-stage,
  .main-grid.is-tutor-chat-open .human-stage {
    height: 380px;
  }

  .tutor-chat-drawer {
    top: auto;
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    height: min(680px, calc(100vh - 20px));
    min-height: 0;
    border-radius: 24px;
  }
}
/* Video-aligned tutor and shared conversation */
@media (min-width: 981px) {
  .tutor-avatar-pane .human-stage {
    margin-top: var(--tutor-stage-offset, 140px);
    transition: margin-top 0.24s ease;
  }
}

.tutor-chat-drawer {
  gap: 10px;
}

.tutor-chat-modes {
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(64, 137, 255, 0.1);
  background: #eaf2f9;
}

.tutor-chat-modes button {
  min-height: 39px;
  border-radius: 10px;
}

.tutor-chat-modes button.is-active {
  box-shadow: 0 4px 14px rgba(46, 99, 145, 0.12);
}

.tutor-chat-drawer .conversation-panel {
  height: auto;
  min-height: 270px;
  flex: 1 1 320px;
  margin: 0;
}

.tutor-chat-drawer .conversation-history {
  flex: 1 1 auto;
  min-height: 210px;
}

.tutor-text-composer {
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(64, 137, 255, 0.17);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(46, 99, 145, 0.08);
}

.tutor-text-composer .question-form {
  margin: 0;
  padding: 8px;
  border: 0;
  background: transparent;
}

.tutor-chat-drawer .ai-call-panel {
  min-height: 0;
  flex: 0 0 auto;
  margin: 0;
  display: grid;
  justify-content: stretch;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(64, 137, 255, 0.17);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(241, 248, 255, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow: 0 10px 24px rgba(46, 99, 145, 0.08);
}

.tutor-chat-drawer .tutor-voice-intro {
  grid-template-columns: 42px minmax(0, 1fr);
  justify-items: start;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.tutor-chat-drawer .tutor-voice-intro > span {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 20px;
  box-shadow: 0 8px 18px rgba(55, 125, 218, 0.13);
}

.tutor-chat-drawer .tutor-voice-intro strong {
  font-size: 14px;
}

.tutor-chat-drawer .parent-consent {
  padding: 10px;
  border-radius: 12px;
  font-size: 10px;
}

.tutor-chat-drawer .call-actions {
  flex-wrap: wrap;
}

.tutor-chat-drawer .call-start-button {
  min-height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, #eef6ff, #e4f0ff);
}

@media (max-width: 980px) {
  .tutor-avatar-pane .human-stage {
    margin-top: 0;
  }

  .tutor-chat-drawer .conversation-panel {
    min-height: 250px;
  }
}

