/* human-approved chat, overview and review polish; the library stays unchanged */
.chat-workspace,
#teacher-overview-panel,
.teacher-review-wizard {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.professor-header .view-title {
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  letter-spacing: -.025em;
  line-height: 1.3;
}
.professor-header .eyebrow {
  font-size: .75rem;
  letter-spacing: .06em;
  color: var(--color-text-muted);
}
.chat-answer-heading { padding-bottom: 12px; }
.chat-answer-heading h2 { font-size: 1.05rem; font-weight: 650; }
.chat-answer-content { line-height: 1.85; }
.chat-answer-content :is(h3, h4) { margin-block: 1.5em .6em; letter-spacing: 0; }
.student-question { border-radius: 14px; line-height: 1.7; }
.answer-selection-summary { margin-block: 12px 20px; }
.professor-composer {
  border: var(--border-control);
  border-radius: 20px;
  box-shadow: 0 1px 3px rgb(16 24 32 / 4%), 0 6px 20px rgb(16 24 32 / 3%);
  transition: none;
}
.professor-composer[data-interaction="active"] {
  transform: none;
  box-shadow: 0 1px 3px rgb(16 24 32 / 4%), 0 6px 20px rgb(16 24 32 / 3%);
}
.professor-composer:has(textarea:focus-visible) {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  box-shadow: none;
}
.composer-input-row { border-radius: 14px; background: transparent; }
.composer-chip, .composer-utility-button { border-radius: 8px; }
.composer-send {
  border-radius: 12px;
  transition: transform 120ms cubic-bezier(.23, 1, .32, 1), opacity 120ms ease;
}
body[data-input-method="pointer"] .composer-send:not(:disabled):active { transform: scale(.97); }
.answer-suggestion-list { gap: 6px 12px; }
.answer-suggestion-list button {
  background: transparent;
  border-color: var(--color-border-subtle);
  border-radius: 8px;
  font-size: .9rem;
}
.chat-boundary-notices summary { font-size: .8rem; color: var(--color-text-secondary); }
.chat-sources {
  border: 0;
  border-top: 1px solid var(--color-border-subtle);
  border-radius: 0;
  background: transparent;
  padding-inline: 0;
}
body:has([data-view="chat"]:not([hidden])) .app-navigation {
  background: var(--color-surface-muted);
  box-shadow: none;
}

.teacher-card:has(#teacher-workspace-overview:not([hidden]) #teacher-overview-panel:not([hidden])) .teacher-navigation {
  background: var(--color-surface-muted);
  box-shadow: none;
}
.teacher-card:has(#teacher-workspace-overview:not([hidden]) #teacher-overview-panel:not([hidden])) .teacher-shell-heading {
  padding-bottom: 16px;
  margin-bottom: 32px;
}
.teacher-card:has(#teacher-workspace-overview:not([hidden]) #teacher-overview-panel:not([hidden])) .teacher-shell-heading .view-title {
  font-size: .95rem;
  font-weight: 550;
}
#teacher-overview-panel .teacher-panel-heading h2 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  letter-spacing: -.025em;
  line-height: 1.3;
}
#teacher-overview-panel .teacher-panel-heading p { color: var(--color-text-secondary); max-width: 48rem; }
#teacher-overview-panel .teacher-overview-metrics dd { font-variant-numeric: tabular-nums; font-weight: 550; letter-spacing: -.04em; }
#teacher-overview-panel .teacher-overview-metrics dt { font-size: .8rem; color: var(--color-text-secondary); }
#teacher-overview-panel .teacher-next-step {
  padding-block: 28px;
  margin-block: 32px;
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}
#teacher-overview-panel .teacher-next-step h3 { font-weight: 600; line-height: 1.4; }
#teacher-overview-panel .primary-button,
.teacher-review-wizard .primary-button {
  background: var(--color-text-primary);
  color: var(--color-surface);
  border-color: transparent;
  box-shadow: none;
}

.teacher-review-wizard {
  width: min(48rem, calc(100% - 2rem));
  padding: 28px;
  border-radius: 16px;
  border-color: var(--color-border-subtle);
  box-shadow: 0 24px 80px #0003;
}
.teacher-review-wizard h2 { font-size: 1.4rem; line-height: 1.4; letter-spacing: -.02em; }
.teacher-review-wizard > p { font-size: .9rem; color: var(--color-text-secondary); }
.teacher-review-wizard .teacher-wizard-summary { line-height: 1.9; max-width: 40rem; }
.teacher-review-wizard .teacher-wizard-item { margin-top: 20px; padding-top: 20px; }
.teacher-review-wizard .teacher-wizard-item textarea {
  min-height: 110px;
  line-height: 1.8;
  border-radius: 8px;
  padding: 14px;
  background: var(--color-surface);
  color: var(--color-text-primary);
}
.teacher-review-wizard > .teacher-detail-actions {
  bottom: -28px;
  padding: 20px 0 4px;
  margin-top: 24px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-subtle);
}
.teacher-review-wizard::backdrop { background: rgb(12 24 22 / 32%); }
body:has(.teacher-review-wizard[open]) { overflow: hidden; }
.teacher-review-wizard .primary-button:hover:not(:disabled) { background: var(--color-text-secondary); color: var(--color-surface); }

/* placement is set by the existing portal after previous motion is cancelled */
.composer-menu.composer-popover { animation: none; }
.composer-popover[data-placement="top"] { transform-origin: bottom left; }
.composer-popover[data-placement="bottom"] { transform-origin: top left; }
.composer-popover.is-bottom-sheet { transform-origin: bottom center; }
body[data-input-method="pointer"] .teacher-review-wizard[open],
body[data-input-method="pointer"] .composer-popover:not([hidden]):is([data-placement], .is-bottom-sheet) {
  animation: approved-panel-enter 180ms cubic-bezier(.23, 1, .32, 1);
}
@keyframes approved-panel-enter {
  from { opacity: 0; transform: translateY(4px) scale(.99); }
  to { opacity: 1; transform: none; }
}
body[data-input-method="keyboard"] .composer-popover:not([hidden]),
body[data-input-method="keyboard"] .teacher-review-wizard[open] { animation: none; transition: none; }
body[data-input-method="keyboard"] .composer-send { transition: none; transform: none; }
body[data-input-method="keyboard"] .composer-send:is(:hover, :active) { transform: none !important; }

@media (max-width: 640px) {
  .teacher-review-wizard { padding: 20px; }
  .teacher-review-wizard > .teacher-detail-actions { bottom: -20px; }
  .professor-composer { border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-input-method] .teacher-review-wizard[open],
  body[data-input-method] .composer-popover:not([hidden]):is([data-placement], .is-bottom-sheet) { animation: none; transition: none; }
  body .composer-send { transition: none; transform: none !important; }
}
@media (forced-colors: active) {
  .professor-composer, .teacher-review-wizard { border: 1px solid CanvasText; }
  .professor-composer:has(textarea:focus-visible) { outline-color: Highlight; }
  #teacher-overview-panel .primary-button,
  .teacher-review-wizard .primary-button,
  .teacher-review-wizard .primary-button:hover:not(:disabled) { background: ButtonFace; color: ButtonText; border-color: ButtonText; }
}

/* --- 2026-09-11 UX report follow-up -------------------------------------- */

/* Teacher sidebar: keep the theme choices inside the navigation flow instead of
   letting the legacy floating .theme-switcher popover cover the language row. */
.teacher-navigation .theme-switcher > div {
  position: static;
  z-index: auto;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.teacher-navigation .teacher-nav-choices button {
  min-height: 2rem;
  font-size: 0.76rem;
}

/* Keep the floating composer from covering the end of a long answer. */
#chat-conversation {
  padding-bottom: 8rem;
}

@media (max-width: 48rem) {
  #chat-conversation {
    padding-bottom: 10rem;
  }
}

/* A completion notice that stays visible from every teacher section. */
.teacher-shell-status {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
  border: 1px solid var(--color-border-strong, var(--border));
  border-inline-start-width: 3px;
  border-radius: var(--radius-surface, 12px);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-elevated, var(--surface));
}

.teacher-shell-status[hidden] { display: none; }
.teacher-shell-status p { margin: 0; color: var(--color-text-primary); }
.teacher-shell-status[data-kind="success"] { border-inline-start-color: var(--color-accent, #1f6f5c); }
.teacher-shell-status[data-kind="failure"] { border-inline-start-color: var(--color-danger, #b3261e); }
.teacher-shell-status .quiet-button { flex: 0 0 auto; }

/* Restore asks which state the document should come back in. */
.teacher-restore-dialog { max-width: 32rem; }
.teacher-restore-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-2);
  font-weight: var(--weight-semibold, 600);
}
.teacher-restore-choice input { flex: 0 0 auto; margin-top: 0.2rem; }
.teacher-restore-dialog .field-help { margin: 0 0 var(--space-4); color: var(--color-text-muted); }
