/* app-homework.css — the fix-it / writing conversation.
   Sugar Paper: Mirai speaks in white bubbles beside a sunflower sticker, the
   student's own attempts sit right in powder blue. See STYLE.md. */

.hw-chat-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 0;
  scrollbar-width: none;
}

.hw-chat-panel::-webkit-scrollbar {
  display: none;
}

.hw-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hw-chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.hw-chat-row.user {
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

/* The sunflower sticker that stands in for Mirai. */
.hw-chat-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-feather);
}

.hw-bubble {
  position: relative;
  max-width: 84%;
  padding: 13px 16px;
  border-radius: 20px;
  font-size: 15.5px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-feather);
}

.hw-bubble-question {
  border-bottom-left-radius: 8px;
}

.hw-chat-eyebrow {
  margin: 0 0 7px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* The quoted lesson line — the thing being fixed, set apart in powder. */
.hw-chat-quote {
  margin: 0 0 9px;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 15.5px;
  font-weight: 600;
  background: var(--powder);
}

.hw-chat-ask {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.hw-bubble-question .pill {
  margin-top: 9px;
}

.hw-chat-hint {
  display: flex;
  gap: 7px;
  margin: 9px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.hw-bubble-user {
  align-self: flex-end;
  border-bottom-right-radius: 8px;
  font-weight: 600;
  background: var(--powder);
  box-shadow: none;
}

.hw-chat-reaction {
  position: absolute;
  right: -6px;
  bottom: -10px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 12px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-feather);
}

.hw-chat-receipt {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-soft);
  opacity: 0.7;
}

.hw-chat-receipt.is-seen {
  color: var(--success);
  opacity: 1;
}

.hw-verdict-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.hw-bubble-reply,
.hw-bubble-coach {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-weight: 600;
}

.hw-bubble-reply.is-success { background: var(--mint); box-shadow: none; }
.hw-bubble-reply.is-miss { background: var(--pink); box-shadow: none; }
.hw-bubble-coach { background: var(--butter); box-shadow: none; }

.hw-chat-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  margin-top: 1px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
}

.hw-chat-mark.is-success { background: var(--success); }
.hw-chat-mark.is-miss { background: var(--danger); }
.hw-chat-mark.is-coach { background: transparent; font-size: 15px; }

.hw-chat-text {
  min-width: 0;
}

.hw-bubble-info {
  font-size: 14.5px;
  color: var(--ink-soft);
}

.hw-bubble-info.is-error {
  color: var(--danger);
  background: var(--pink);
  box-shadow: none;
}

/* Typing dots while Mirai reads the attempt. */
.hw-bubble-typing {
  display: flex;
  gap: 5px;
  padding: 15px 17px;
}

.hw-bubble-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.25;
  animation: hwTypingDot 1.1s ease-in-out infinite;
}

.hw-bubble-typing span:nth-child(2) { animation-delay: 0.15s; }
.hw-bubble-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes hwTypingDot {
  0%, 100% { opacity: 0.2; transform: translateY(0); }
  50% { opacity: 0.7; transform: translateY(-3px); }
}

/* The dim "?" affordance: an explanation is one tap away, never on screen
   until it is asked for. */
.hw-why {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 6px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  background: var(--wash);
}

.hw-why > span:first-child {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  color: var(--ink-soft);
  background: var(--surface);
}

.hw-why[disabled] {
  opacity: 0.45;
}

.hw-why.is-answered {
  display: none;
}

.hw-why .btn-spinner {
  width: 12px;
  height: 12px;
}

.hw-chat-checking {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  border-radius: 26px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--surface);
  box-shadow: var(--shadow-feather);
}
