/*
 * V9.8 AI mentor focus.
 * Xiaowen has one role: the user's engineering coach.
 */
html:not(.react-student-embedded) body[data-active-panel="ai-coach"] .xiaowen-coach-workbench.is-coach-focused > :not(.xiaowen-private-coach) {
  display: none !important;
}

:is(#hw-v6-home, html):not(.react-student-embedded) body[data-active-panel="ai-coach"] .shell .main.main > section.panel.active.xiaowen-coach-workbench.is-coach-focused {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach {
  position: relative !important;
  display: grid !important;
  grid-template-columns: minmax(290px, .74fr) minmax(520px, 1.26fr) !important;
  gap: 26px !important;
  width: 100% !important;
  min-height: 520px !important;
  padding: 28px !important;
  overflow: hidden !important;
  border: 1px solid rgba(99, 102, 241, .16) !important;
  border-radius: 26px !important;
  background:
    radial-gradient(circle at 10% 15%, rgba(59, 130, 246, .18), transparent 34%),
    radial-gradient(circle at 36% 100%, rgba(124, 58, 237, .12), transparent 40%),
    linear-gradient(135deg, #f8fbff 0%, #f6f5ff 47%, #fff 100%) !important;
  box-shadow: 0 22px 52px rgba(51, 65, 85, .09) !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach::after {
  content: "" !important;
  position: absolute !important;
  top: -120px !important;
  right: -90px !important;
  width: 330px !important;
  height: 330px !important;
  border-radius: 999px !important;
  background: rgba(99, 102, 241, .08) !important;
  pointer-events: none !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__identity {
  position: relative !important;
  z-index: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  min-width: 0 !important;
  padding: 18px 12px !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__brand {
  display: flex !important;
  align-items: center !important;
  gap: 15px !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__brand > span {
  display: grid !important;
  place-items: center !important;
  width: 62px !important;
  height: 62px !important;
  color: #fff !important;
  border: 4px solid rgba(255, 255, 255, .9) !important;
  border-radius: 20px !important;
  background: linear-gradient(135deg, #3b82f6, #7c3aed) !important;
  box-shadow: 0 14px 30px rgba(79, 70, 229, .22) !important;
  font-size: 24px !important;
  font-weight: 900 !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__brand p,
html:not(.react-student-embedded) body .xiaowen-private-coach__plan header p {
  margin: 0 0 4px !important;
  color: #6366f1 !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  letter-spacing: .14em !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__brand h2 {
  margin: 0 !important;
  color: #111827 !important;
  font-size: clamp(30px, 3vw, 42px) !important;
  font-weight: 900 !important;
  letter-spacing: -.04em !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__target {
  display: grid !important;
  gap: 8px !important;
  margin-top: 42px !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__target > span {
  color: #64748b !important;
  font-size: 13px !important;
  font-weight: 750 !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__target > strong {
  color: #172033 !important;
  font-size: clamp(23px, 2.4vw, 34px) !important;
  font-weight: 900 !important;
  line-height: 1.18 !important;
  letter-spacing: -.035em !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__target > p {
  max-width: 330px !important;
  margin: 0 !important;
  color: #64748b !important;
  font-size: 13px !important;
  line-height: 1.75 !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__promise {
  display: grid !important;
  gap: 4px !important;
  margin-top: 54px !important;
  padding: 14px 16px !important;
  border-left: 3px solid #6366f1 !important;
  border-radius: 0 12px 12px 0 !important;
  background: rgba(255, 255, 255, .56) !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__promise span {
  color: #111827 !important;
  font-size: 15px !important;
  font-weight: 850 !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__promise strong {
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 650 !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__plan {
  position: relative !important;
  z-index: 2 !important;
  display: grid !important;
  grid-template-rows: auto 1fr auto !important;
  gap: 16px !important;
  min-width: 0 !important;
  padding: 24px !important;
  border: 1px solid rgba(148, 163, 184, .18) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, .9) !important;
  box-shadow: 0 16px 38px rgba(51, 65, 85, .08) !important;
  backdrop-filter: blur(18px) !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__plan > header,
html:not(.react-student-embedded) body .xiaowen-private-coach__plan > footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__plan header h3 {
  margin: 0 !important;
  color: #111827 !important;
  font-size: 24px !important;
  font-weight: 900 !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__plan header > span {
  padding: 7px 11px !important;
  color: #64748b !important;
  border-radius: 999px !important;
  background: #f1f5f9 !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  white-space: nowrap !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__tasks {
  display: grid !important;
  align-content: center !important;
  gap: 10px !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__task {
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 13px !important;
  width: 100% !important;
  min-height: 72px !important;
  padding: 11px 14px !important;
  color: #334155 !important;
  border: 1px solid rgba(148, 163, 184, .2) !important;
  border-radius: 15px !important;
  background: #fff !important;
  text-align: left !important;
  cursor: pointer !important;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__task:is(:hover, :focus-visible) {
  border-color: rgba(79, 70, 229, .4) !important;
  box-shadow: 0 10px 24px rgba(79, 70, 229, .09) !important;
  outline: none !important;
  transform: translateY(-1px) !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__task.is-primary {
  border-color: rgba(79, 70, 229, .28) !important;
  background: linear-gradient(90deg, rgba(238, 242, 255, .94), #fff) !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__task > span {
  display: grid !important;
  place-items: center !important;
  width: 36px !important;
  height: 36px !important;
  color: #64748b !important;
  border-radius: 11px !important;
  background: #f1f5f9 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__task.is-primary > span {
  color: #fff !important;
  background: linear-gradient(135deg, #3b82f6, #7c3aed) !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__task > div {
  display: grid !important;
  gap: 4px !important;
  min-width: 0 !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__task strong {
  color: #172033 !important;
  font-size: 15px !important;
  font-weight: 850 !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__task small {
  overflow: hidden !important;
  color: #7c8799 !important;
  font-size: 11px !important;
  font-weight: 620 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__task em {
  color: #6366f1 !important;
  font-size: 12px !important;
  font-style: normal !important;
  font-weight: 850 !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__plan > footer {
  padding-top: 16px !important;
  border-top: 1px solid rgba(148, 163, 184, .18) !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__plan footer > div {
  display: grid !important;
  gap: 3px !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__plan footer span {
  color: #7c8799 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

html:not(.react-student-embedded) body .xiaowen-private-coach__plan footer strong {
  color: #059669 !important;
  font-size: 16px !important;
  font-weight: 900 !important;
}

:is(#hw-v6-home, html):not(.react-student-embedded) body[data-active-panel="ai-coach"] .xiaowen-private-coach__plan > footer > #xiaowenCoachStartBtn {
  position: static !important;
  inset: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 150px !important;
  max-width: none !important;
  min-height: 46px !important;
  margin: 0 68px 0 0 !important;
  padding: 0 22px !important;
  border-radius: 13px !important;
  background: linear-gradient(135deg, #3b82f6, #6d4aff) !important;
  box-shadow: 0 11px 25px rgba(79, 70, 229, .2) !important;
}

html[data-theme="dark"]:not(.react-student-embedded) body .xiaowen-private-coach {
  border-color: rgba(129, 140, 248, .2) !important;
  background:
    radial-gradient(circle at 10% 15%, rgba(59, 130, 246, .18), transparent 34%),
    radial-gradient(circle at 36% 100%, rgba(124, 58, 237, .16), transparent 40%),
    linear-gradient(135deg, #101827 0%, #15172b 48%, #0f172a 100%) !important;
}

html[data-theme="dark"]:not(.react-student-embedded) body .xiaowen-private-coach__brand h2,
html[data-theme="dark"]:not(.react-student-embedded) body .xiaowen-private-coach__target > strong,
html[data-theme="dark"]:not(.react-student-embedded) body .xiaowen-private-coach__promise span,
html[data-theme="dark"]:not(.react-student-embedded) body .xiaowen-private-coach__plan header h3,
html[data-theme="dark"]:not(.react-student-embedded) body .xiaowen-private-coach__task strong {
  color: #f8fafc !important;
}

html[data-theme="dark"]:not(.react-student-embedded) body .xiaowen-private-coach__target > p,
html[data-theme="dark"]:not(.react-student-embedded) body .xiaowen-private-coach__target > span,
html[data-theme="dark"]:not(.react-student-embedded) body .xiaowen-private-coach__promise strong,
html[data-theme="dark"]:not(.react-student-embedded) body .xiaowen-private-coach__task small {
  color: #9fb0c6 !important;
}

html[data-theme="dark"]:not(.react-student-embedded) body .xiaowen-private-coach__plan,
html[data-theme="dark"]:not(.react-student-embedded) body .xiaowen-private-coach__task,
html[data-theme="dark"]:not(.react-student-embedded) body .xiaowen-private-coach__promise {
  background: rgba(15, 23, 42, .76) !important;
}

html:not(.react-student-embedded) body #companionPanel #companionOpenCoachBtn.companion-open-coach-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 38px !important;
  margin: 4px 0 0 !important;
  color: #4f46e5 !important;
  border-color: rgba(79, 70, 229, .22) !important;
  background: rgba(238, 242, 255, .82) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

@media (max-width: 1040px) {
  html:not(.react-student-embedded) body .xiaowen-private-coach {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
  }

  html:not(.react-student-embedded) body .xiaowen-private-coach__target {
    margin-top: 28px !important;
  }

  html:not(.react-student-embedded) body .xiaowen-private-coach__promise {
    margin-top: 28px !important;
  }
}

@media (max-width: 680px) {
  html:not(.react-student-embedded) body .xiaowen-private-coach {
    padding: 16px !important;
    border-radius: 18px !important;
  }

  html:not(.react-student-embedded) body .xiaowen-private-coach__identity,
  html:not(.react-student-embedded) body .xiaowen-private-coach__plan {
    padding: 16px !important;
  }

  html:not(.react-student-embedded) body .xiaowen-private-coach__plan > footer {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  html:not(.react-student-embedded) body #xiaowenCoachStartBtn {
    width: 100% !important;
    margin: 0 !important;
  }
}
