/*
 * V7.3 private engineering coach
 * Action-first AI mentor: coach status, ability diagnosis, today's plan.
 */

html body[data-active-panel="ai-coach"] .shell .main.main > section.panel.active.private-coach-workbench {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 22px clamp(18px, 2.4vw, 34px) 40px !important;
}

html body[data-active-panel="ai-coach"] .private-coach-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px !important;
  width: 100% !important;
  max-width: 1120px !important;
  margin: 0 auto !important;
}

html:not(.react-student-embedded) body[data-active-panel="ai-coach"] #companionAvatarDock.companion-avatar-dock {
  display: none !important;
}

html body[data-active-panel="ai-coach"] .private-coach-workbench :is(h2, h3, p, dl, dd) {
  margin: 0;
}

html body[data-active-panel="ai-coach"] .private-coach-workbench .eyebrow {
  color: var(--hw-ai, #7c3aed) !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  letter-spacing: 0.12em !important;
  line-height: 1.3 !important;
}

html body[data-active-panel="ai-coach"] .private-coach-hero {
  position: relative !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 22px !important;
  min-height: 116px !important;
  padding: 16px 24px !important;
  overflow: hidden !important;
  color: var(--v51-text, #0f172a) !important;
  background:
    radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--hw-ai, #7c3aed) 17%, transparent), transparent 34%),
    linear-gradient(118deg, color-mix(in srgb, var(--hw-primary, #1677ff) 8%, var(--v51-card, #fff)), var(--v51-card, #fff) 48%) !important;
  border: 1px solid color-mix(in srgb, var(--hw-ai, #7c3aed) 25%, var(--v51-border, #dbe4f0)) !important;
  border-radius: 20px !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07) !important;
}

html body[data-active-panel="ai-coach"] .private-coach-hero::after {
  position: absolute;
  right: 76px;
  bottom: -74px;
  width: 210px;
  height: 210px;
  border: 1px solid color-mix(in srgb, var(--hw-ai, #7c3aed) 16%, transparent);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

html body[data-active-panel="ai-coach"] .private-coach-avatar {
  position: relative;
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--hw-ai, #7c3aed) 38%, var(--v51-border, #dbe4f0));
  border-radius: 24px;
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.65), transparent 26%),
    linear-gradient(145deg, var(--hw-primary, #1677ff), var(--hw-ai, #7c3aed));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--hw-ai, #7c3aed) 24%, transparent);
}

html body[data-active-panel="ai-coach"] .private-coach-avatar::before,
html body[data-active-panel="ai-coach"] .private-coach-avatar::after {
  position: absolute;
  top: 33px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.92);
  content: "";
}

html body[data-active-panel="ai-coach"] .private-coach-avatar::before {
  left: 19px;
}

html body[data-active-panel="ai-coach"] .private-coach-avatar::after {
  right: 19px;
}

html body[data-active-panel="ai-coach"] .private-coach-avatar span {
  position: absolute;
  top: 9px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

html body[data-active-panel="ai-coach"] .private-coach-hero-copy {
  display: grid !important;
  align-content: center !important;
  gap: 7px !important;
  min-width: 0 !important;
}

html body[data-active-panel="ai-coach"] .private-coach-kicker {
  color: var(--v51-muted, #64748b) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
}

html body[data-active-panel="ai-coach"] .private-coach-hero h2 {
  color: var(--v51-text, #0f172a) !important;
  font-size: clamp(28px, 3vw, 38px) !important;
  font-weight: 880 !important;
  line-height: 1.16 !important;
  letter-spacing: -0.035em !important;
}

html body[data-active-panel="ai-coach"] .private-coach-status {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  color: #168a57;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  background: color-mix(in srgb, #22c55e 10%, var(--v51-card, #fff));
  border: 1px solid color-mix(in srgb, #22c55e 24%, var(--v51-border, #dbe4f0));
  border-radius: 999px;
}

html body[data-active-panel="ai-coach"] .private-coach-status i {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, #22c55e 15%, transparent);
}

html body[data-active-panel="ai-coach"] .private-coach-content-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.08fr) minmax(350px, 0.92fr) !important;
  gap: 18px !important;
  align-items: stretch !important;
}

html body[data-active-panel="ai-coach"] :is(.private-coach-diagnosis, .private-coach-plan) {
  display: flex !important;
  min-width: 0 !important;
  min-height: 414px !important;
  flex-direction: column !important;
  padding: 22px !important;
  color: var(--v51-text, #0f172a) !important;
  background: var(--v51-card, #fff) !important;
  border: 1px solid var(--v51-border, #dbe4f0) !important;
  border-radius: 20px !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.055) !important;
}

html body[data-active-panel="ai-coach"] .private-coach-plan {
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--hw-ai, #7c3aed) 13%, transparent), transparent 36%),
    var(--v51-card, #fff) !important;
  border-color: color-mix(in srgb, var(--hw-ai, #7c3aed) 26%, var(--v51-border, #dbe4f0)) !important;
}

html body[data-active-panel="ai-coach"] .private-coach-section-head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 18px !important;
  padding-bottom: 16px !important;
  border-bottom: 1px solid var(--v51-border, #dbe4f0) !important;
}

html body[data-active-panel="ai-coach"] .private-coach-section-head > div {
  display: grid;
  gap: 5px;
}

html body[data-active-panel="ai-coach"] .private-coach-section-head h3 {
  color: var(--v51-text, #0f172a) !important;
  font-size: 22px !important;
  font-weight: 850 !important;
  line-height: 1.28 !important;
  letter-spacing: -0.02em !important;
}

html body[data-active-panel="ai-coach"] .private-coach-section-head > span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  color: var(--v51-muted, #64748b);
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
  background: var(--v51-card-soft, #f8fafc);
  border: 1px solid var(--v51-border, #dbe4f0);
  border-radius: 999px;
}

html body[data-active-panel="ai-coach"] .private-coach-ability-list {
  display: grid !important;
  gap: 0 !important;
  flex: 1 !important;
  padding-top: 7px !important;
}

html body[data-active-panel="ai-coach"] .private-coach-ability-row {
  display: grid;
  align-content: center;
  gap: 9px;
  min-height: 60px;
  padding: 7px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--v51-border, #dbe4f0) 72%, transparent);
}

html body[data-active-panel="ai-coach"] .private-coach-ability-row:last-child {
  border-bottom: 0;
}

html body[data-active-panel="ai-coach"] .private-coach-ability-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

html body[data-active-panel="ai-coach"] .private-coach-ability-meta > span {
  color: var(--v51-text, #0f172a);
  font-size: 14px;
  font-weight: 760;
}

html body[data-active-panel="ai-coach"] .private-coach-ability-meta strong {
  color: var(--hw-primary, #1677ff);
  font-size: 20px;
  font-weight: 880;
  line-height: 1;
}

html body[data-active-panel="ai-coach"] .private-coach-ability-meta small {
  margin-left: 2px;
  color: var(--v51-muted, #64748b);
  font-size: 11px;
  font-weight: 700;
}

html body[data-active-panel="ai-coach"] .private-coach-meter {
  width: 100%;
  height: 7px;
  overflow: hidden;
  background: color-mix(in srgb, var(--v51-text, #0f172a) 8%, transparent);
  border-radius: 999px;
}

html body[data-active-panel="ai-coach"] .private-coach-meter i {
  display: block;
  width: var(--score);
  height: 100%;
  background: linear-gradient(90deg, var(--hw-primary, #1677ff), #32b9ef);
  border-radius: inherit;
}

html body[data-active-panel="ai-coach"] .private-coach-ability-row--focus .private-coach-ability-meta strong {
  color: var(--hw-ai, #7c3aed);
}

html body[data-active-panel="ai-coach"] .private-coach-ability-row--focus .private-coach-meter i {
  background: linear-gradient(90deg, var(--hw-ai, #7c3aed), #a855f7);
}

html body[data-active-panel="ai-coach"] .private-coach-priority {
  display: grid !important;
  gap: 7px !important;
  margin: 16px 0 10px !important;
  padding: 15px 18px !important;
  background: color-mix(in srgb, var(--hw-ai, #7c3aed) 8%, var(--v51-card, #fff)) !important;
  border: 1px solid color-mix(in srgb, var(--hw-ai, #7c3aed) 20%, var(--v51-border, #dbe4f0)) !important;
  border-radius: 15px !important;
}

html body[data-active-panel="ai-coach"] .private-coach-priority span {
  color: var(--hw-ai, #7c3aed);
  font-size: 12px;
  font-weight: 800;
}

html body[data-active-panel="ai-coach"] .private-coach-priority strong {
  color: var(--v51-text, #0f172a);
  font-size: clamp(20px, 2vw, 25px);
  font-weight: 880;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

html body[data-active-panel="ai-coach"] .private-coach-plan-details {
  display: grid !important;
  gap: 0 !important;
  margin: 0 !important;
}

html body[data-active-panel="ai-coach"] .private-coach-plan-details > div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 61px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--v51-border, #dbe4f0);
}

html body[data-active-panel="ai-coach"] .private-coach-plan-details dt {
  color: var(--v51-muted, #64748b);
  font-size: 12px;
  font-weight: 760;
}

html body[data-active-panel="ai-coach"] .private-coach-plan-details dd {
  color: var(--v51-text, #0f172a);
  font-size: 14px;
  font-weight: 680;
  line-height: 1.6;
}

html body[data-active-panel="ai-coach"] .private-coach-plan-details dd > strong {
  color: var(--hw-ai, #7c3aed);
  font-size: 18px;
  font-weight: 900;
}

html body[data-active-panel="ai-coach"] .private-coach-growth {
  display: flex;
  align-items: center;
  gap: 10px;
}

html body[data-active-panel="ai-coach"] .private-coach-growth span {
  color: var(--v51-muted, #64748b);
  font-size: 20px;
  font-weight: 800;
}

html body[data-active-panel="ai-coach"] .private-coach-growth i {
  color: var(--v51-muted, #64748b);
  font-style: normal;
}

html body[data-active-panel="ai-coach"] .private-coach-growth strong {
  color: var(--hw-ai, #7c3aed) !important;
  font-size: 25px !important;
  font-weight: 900 !important;
}

html body[data-active-panel="ai-coach"] .private-coach-primary-action {
  display: flex !important;
  width: 100% !important;
  min-height: 50px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  margin-top: auto !important;
  padding: 0 22px !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 850 !important;
  background: linear-gradient(108deg, var(--hw-primary, #1677ff), var(--hw-ai, #7c3aed)) !important;
  border: 0 !important;
  border-radius: 13px !important;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--hw-ai, #7c3aed) 27%, transparent) !important;
  cursor: pointer !important;
  transition: transform 160ms ease, box-shadow 160ms ease !important;
}

html body[data-active-panel="ai-coach"] .private-coach-primary-action:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 16px 32px color-mix(in srgb, var(--hw-ai, #7c3aed) 33%, transparent) !important;
}

html body[data-active-panel="ai-coach"] .private-coach-primary-action:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--hw-primary, #1677ff) 30%, transparent) !important;
  outline-offset: 3px !important;
}

@media (max-width: 980px) {
  html body[data-active-panel="ai-coach"] .private-coach-content-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html body[data-active-panel="ai-coach"] :is(.private-coach-diagnosis, .private-coach-plan) {
    min-height: 0 !important;
  }

  html body[data-active-panel="ai-coach"] .private-coach-primary-action {
    margin-top: 22px !important;
  }
}

@media (max-width: 640px) {
  html body[data-active-panel="ai-coach"] .shell .main.main > section.panel.active.private-coach-workbench {
    padding: 14px 12px 28px !important;
  }

  html body[data-active-panel="ai-coach"] .private-coach-hero {
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 15px !important;
    min-height: 142px !important;
    padding: 20px !important;
  }

  html body[data-active-panel="ai-coach"] .private-coach-avatar {
    width: 60px;
    height: 60px;
    border-radius: 19px;
  }

  html body[data-active-panel="ai-coach"] .private-coach-avatar::before,
  html body[data-active-panel="ai-coach"] .private-coach-avatar::after {
    top: 30px;
    width: 6px;
    height: 6px;
  }

  html body[data-active-panel="ai-coach"] .private-coach-avatar::before {
    left: 17px;
  }

  html body[data-active-panel="ai-coach"] .private-coach-avatar::after {
    right: 17px;
  }

  html body[data-active-panel="ai-coach"] .private-coach-avatar span {
    top: 6px;
  }

  html body[data-active-panel="ai-coach"] .private-coach-status {
    grid-column: 1 / -1;
    width: max-content;
  }

  html body[data-active-panel="ai-coach"] :is(.private-coach-diagnosis, .private-coach-plan) {
    padding: 20px !important;
  }

  html body[data-active-panel="ai-coach"] .private-coach-section-head {
    gap: 10px !important;
  }

  html body[data-active-panel="ai-coach"] .private-coach-plan-details > div {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body[data-active-panel="ai-coach"] .private-coach-primary-action {
    transition: none !important;
  }
}
