.teacher-analytics-entry {
  display: grid;
  gap: 8px;
  min-height: 108px;
  padding: 14px;
  border: 1px solid #eadcff;
  border-radius: 18px;
  background: #fff;
}

.teacher-analytics-entry > button:first-child {
  border: 0;
  background: transparent;
  color: #3b236d;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  text-align: left;
}

.teacher-learning-analytics-panel {
  display: grid;
  gap: 22px;
  width: 100%;
  min-width: 0;
  padding: clamp(16px, 3vw, 28px);
  box-sizing: border-box;
  border: 1px solid #dfd4ef;
  border-radius: 20px;
  background: #fff;
  color: #2f2440;
  box-shadow: 0 14px 34px rgba(73, 45, 139, .09);
}

.teacher-learning-analytics-panel[hidden] { display: none; }

.teacher-learning-analytics-panel > *,
.teacher-learning-analytics-panel section {
  min-width: 0;
}

.teacher-analytics-header,
.teacher-analytics-section-heading,
.teacher-analytics-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.teacher-analytics-header h3,
.teacher-learning-analytics-panel h4,
.teacher-learning-analytics-panel h5 {
  margin: 0;
  color: #2f1f4c;
}

.teacher-analytics-header p,
.teacher-analytics-section-heading p,
.teacher-learning-analytics-panel section > p {
  max-width: 72ch;
  color: #6d627b;
}

.teacher-analytics-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(2, minmax(140px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #f8f5fb;
}

.teacher-analytics-filters label {
  display: grid;
  gap: 6px;
  color: #4f4260;
  font-size: 13px;
  font-weight: 800;
}

.teacher-analytics-filters select {
  min-height: 42px;
  border: 1px solid #d8cce8;
  border-radius: 10px;
  background: #fff;
  color: #352844;
  padding: 0 10px;
}

.teacher-analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.teacher-analytics-bounded {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid #d8c9e8;
  border-radius: 16px;
  background: #f7f3fb;
  color: #4f4260;
}

.teacher-analytics-bounded h4,
.teacher-analytics-bounded p {
  margin: 0;
}

.teacher-analytics-bounded p {
  max-width: 65ch;
  margin-top: 5px;
}

.teacher-analytics-bounded ul {
  flex: 0 1 340px;
  margin: 0;
  padding-left: 20px;
}

.teacher-analytics-bounded li + li {
  margin-top: 4px;
}

.teacher-analytics-summary-grid section,
.teacher-analytics-session-list article,
.teacher-analytics-quality {
  padding: 16px;
  border: 1px solid #e4dceb;
  border-radius: 16px;
  background: #fcfbfd;
}

.teacher-analytics-summary-grid ul {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.teacher-analytics-summary-grid li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #5e5369;
}

.teacher-analytics-table-scroll {
  width: 100%;
  max-width: 100%;
  margin-top: 12px;
  overflow-x: auto;
  box-sizing: border-box;
  border: 1px solid #e4dceb;
  border-radius: 14px;
}

.teacher-analytics-table-scroll table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

.teacher-analytics-table-scroll th,
.teacher-analytics-table-scroll td {
  padding: 12px;
  border-bottom: 1px solid #eee8f3;
  text-align: left;
  vertical-align: top;
}

.teacher-analytics-table-scroll thead th {
  background: #f8f5fb;
  color: #5d506e;
  font-size: 12px;
  letter-spacing: .02em;
}

.teacher-analytics-table-scroll tbody th small {
  display: block;
  margin-top: 4px;
  color: #786c84;
  font-weight: 500;
}

.teacher-analytics-word-link {
  border: 0;
  background: transparent;
  color: #5f32a8;
  font: inherit;
  font-weight: 850;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.teacher-analytics-status {
  display: inline-block;
  max-width: 240px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #f0ebf6;
  color: #4b3c5b;
  font-size: 12px;
  font-weight: 800;
}

.teacher-analytics-status.status-friction_recurring,
.teacher-analytics-status.status-friction_observed {
  background: #fff3db;
  color: #744b00;
}

.teacher-analytics-status.status-improving_evidence {
  background: #e8f5ee;
  color: #1f6743;
}

.teacher-analytics-session-list,
.teacher-analytics-pronunciation-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.teacher-analytics-session-list dl,
.teacher-analytics-quality dl,
.teacher-analytics-detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.teacher-analytics-session-list dl div,
.teacher-analytics-quality dl div,
.teacher-analytics-detail-metrics div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.teacher-analytics-pronunciation-list article {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid #e4dceb;
  border-radius: 14px;
}

.teacher-analytics-quality {
  border-left: 4px solid #7c5aa8;
}

.teacher-analytics-loading,
.teacher-analytics-error,
.teacher-analytics-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 140px;
  padding: 20px;
}

.teacher-analytics-loading > span {
  width: 24px;
  height: 24px;
  border: 3px solid #ddd2ec;
  border-top-color: #6d3fd9;
  border-radius: 50%;
  animation: teacher-analytics-spin .8s linear infinite;
}

.teacher-analytics-detail {
  width: min(680px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 48px));
  padding: 22px;
  border: 0;
  border-radius: 18px;
  color: #2f2440;
  box-shadow: 0 24px 70px rgba(38, 24, 55, .25);
}

.teacher-analytics-detail::backdrop { background: rgba(30, 20, 42, .48); }

.teacher-learning-analytics-panel button:focus-visible,
.teacher-learning-analytics-panel select:focus-visible,
.teacher-learning-analytics-panel [tabindex="0"]:focus-visible {
  outline: 3px solid #8c5dcc !important;
  outline-offset: 3px;
  box-shadow: none !important;
}

@keyframes teacher-analytics-spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .teacher-analytics-filters,
  .teacher-analytics-summary-grid,
  .teacher-analytics-session-list,
  .teacher-analytics-pronunciation-list { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .teacher-analytics-header,
  .teacher-analytics-bounded,
  .teacher-analytics-section-heading,
  .teacher-analytics-detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-learning-analytics-panel {
    padding: 14px;
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .teacher-learning-analytics-panel *,
  .teacher-analytics-loading > span {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
