.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-status {
  padding: 6px 9px;
  color: #9a6a2d;
  background: #fff1df;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
}

.ai-status.ready {
  color: #126b5a;
  background: #dcf2eb;
}

.video-maker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding: 16px;
  background: #153f38;
  color: #fff;
  border-radius: 10px;
}

.video-maker b,
.video-maker span {
  display: block;
}

.video-maker span {
  margin-top: 4px;
  color: #b9d4ce;
  font-size: 12px;
}

.video-maker button {
  flex: none;
  padding: 10px 15px;
  border: 0;
  border-radius: 8px;
  color: #153f38;
  background: #cceee4;
  font-weight: 700;
  cursor: pointer;
}

.video-maker button:disabled {
  opacity: .55;
}

.video-state {
  margin-top: 12px;
  color: #60716d;
  font-size: 12px;
}

.progress {
  height: 7px;
  margin-bottom: 7px;
  overflow: hidden;
  background: #e4ece9;
  border-radius: 10px;
}

.progress i {
  display: block;
  width: 0;
  height: 100%;
  background: #16816a;
  transition: width .2s ease;
}

.video-output {
  margin-top: 14px;
}

.video-output video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #102823;
  border-radius: 9px;
}

.video-output a {
  display: inline-block;
  margin-top: 9px;
  color: #126b5a;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 520px) {
  .ai-status {
    display: none;
  }

  .video-maker {
    align-items: flex-start;
    flex-direction: column;
  }

  .video-maker button {
    width: 100%;
  }
}

mjx-container {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: middle;
}

mjx-container[display="true"] {
  margin: 12px 0 !important;
  padding: 8px 0 10px;
}

.answer mjx-container {
  color: #126b5a;
}

.step mjx-container,
.info-grid mjx-container,
.explanation mjx-container {
  font-size: 1.04em;
}

.result svg {
  max-width: 100%;
}

.followup-section {
  margin-top: 24px;
  padding-top: 2px;
  border-top: 1px solid #e4ece9;
}

.followup-thread {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.followup-message {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.followup-message.student {
  grid-template-columns: minmax(0, 1fr) 32px;
}

.followup-message.student .followup-author {
  grid-column: 2;
}

.followup-message.student .followup-bubble {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  color: #ffffff;
  background: #126b5a;
}

.followup-author {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #126b5a;
  background: #dff2ec;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.followup-message.student .followup-author {
  color: #80541e;
  background: #fff0dc;
}

.followup-bubble {
  width: fit-content;
  max-width: min(88%, 590px);
  margin: 0;
  padding: 10px 13px;
  color: #334a46;
  background: #edf6f3;
  border-radius: 4px 8px 8px 8px;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.followup-message.student .followup-bubble {
  border-radius: 8px 4px 8px 8px;
}

.followup-message.loading .followup-bubble {
  color: #71827e;
}

.followup-message.error .followup-bubble {
  color: #9a4d43;
  background: #fff0ed;
}

.followup-thread mjx-container {
  color: inherit;
}

.followup-section .followup {
  margin-top: 14px;
  padding-top: 0;
  border-top: 0;
}

.followup input:focus {
  border-color: #16816a;
  outline: 3px solid #16816a1f;
}

.followup button {
  min-width: 72px;
  font-weight: 700;
  cursor: pointer;
}

.followup button:disabled,
.followup input:disabled {
  cursor: wait;
  opacity: .6;
}

@media (max-width: 520px) {
  .followup-bubble {
    max-width: 94%;
  }

  .followup {
    align-items: stretch;
  }

  .followup button {
    padding: 0 13px;
  }
}
