/* LANG0036 AI-assisted Review prototype */

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f6f8;
  color: #1f2937;
  min-height: 100vh;
}
header {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  padding: 28px 20px;
  text-align: center;
}
header h1 { font-size: 1.6rem; margin-bottom: 4px; }
header p { opacity: .85; font-size: .9rem; }
main { max-width: 760px; margin: 24px auto; padding: 0 16px; }
.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  margin-bottom: 16px;
}
.card h2 { font-size: 1.15rem; margin-bottom: 16px; color: #059669; }
.hidden { display: none; }
label { display: block; margin-bottom: 14px; font-size: .85rem; font-weight: 600; color: #4b5563; }
textarea, select {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
}
textarea { resize: vertical; }
button {
  background: #059669;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: #047857; }
button.secondary { background: #e5e7eb; color: #374151; }
button.secondary:hover { background: #d1d5db; }
button:disabled { opacity: .5; cursor: not-allowed; }
.error { color: #dc2626; font-size: .85rem; margin-top: 10px; }
.note { color: #6b7280; font-size: .8rem; margin-top: 10px; }
.access-box { margin-top: 14px; padding: 14px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; }
.access-box label { margin-bottom: 10px; }

.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.row textarea { flex: 1; }
.badge {
  background: #059669; color: #fff; font-size: .75rem;
  padding: 4px 10px; border-radius: 9999px; font-weight: 600;
}
.chat {
  height: 320px; overflow-y: auto;
  border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 12px; margin-bottom: 12px; background: #fafafa;
  display: flex; flex-direction: column; gap: 10px;
}
.msg { max-width: 85%; padding: 10px 12px; border-radius: 10px; font-size: .88rem; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: #059669; color: #fff; }
.msg.ai { align-self: flex-start; background: #fff; border: 1px solid #e5e7eb; }
.msg.thinking { align-self: flex-start; color: #6b7280; font-style: italic; }

#report { font-size: .9rem; line-height: 1.6; }
#report h3 { margin: 14px 0 6px; color: #059669; font-size: 1rem; }
#report pre, #report div.report-block {
  background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; white-space: pre-wrap;
}
.link-box {
  margin-top: 16px; padding: 14px; background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.link-box code { flex: 1; font-size: .8rem; word-break: break-all; color: #047857; }

/* ---- Onboarding tour ---- */
.tour-btn {
  margin-top: 12px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.4);
  font-size: .8rem;
  padding: 6px 14px;
}
.tour-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
/* .hidden must beat .tour-overlay's `display:flex` (defined above) */
.tour-overlay.hidden { display: none; }
.tour-card {
  background: #fff; border-radius: 14px; max-width: 520px;
  padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.tour-card h2 { color: #059669; margin-bottom: 14px; }
.tour-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: .9rem; }
.tour-steps li::marker { color: #059669; font-weight: 700; }
.tour-note {
  margin: 16px 0; padding: 12px; background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 8px; font-size: .85rem; color: #065f46;
}

/* ---- Stepper ---- */
.stepper {
  display: flex; gap: 6px; margin-bottom: 18px;
  background: #fff; border-radius: 10px; padding: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow-x: auto;
}
.step {
  flex: 1; text-align: center; font-size: .78rem; font-weight: 600;
  color: #9ca3af; padding: 8px 6px; border-radius: 8px; white-space: nowrap;
  border: 1px solid transparent;
}
.step.active { background: #059669; color: #fff; }
.step.reached { cursor: pointer; }
.step.reached:not(.active):hover { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.back-btn { margin: 0 0 12px; }

/* ---- Focus aspects ---- */
.sub { color: #6b7280; font-size: .85rem; margin-bottom: 14px; }
.aspects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.aspect {
  border: 1px solid #d1d5db; border-radius: 10px; padding: 12px;
  cursor: pointer; margin: 0; transition: border-color .15s, background .15s;
}
.aspect:hover { border-color: #059669; }
.aspect:has(input:checked) { border-color: #059669; background: #f0fdf4; }
.aspect input { margin-right: 8px; }
.aspect small { color: #6b7280; }
@media (max-width: 560px) { .aspects { grid-template-columns: 1fr; } }

/* ---- Writing Lab (Weeks 2 & 4) ---- */
.timer-box {
  margin: 16px 0; padding: 18px; background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 10px; text-align: center;
}
#timer-display {
  font-size: 3rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: #047857; margin: 10px 0;
}
.timer-box .row { justify-content: center; }
.photo-preview {
  max-width: 100%; max-height: 320px; border-radius: 10px;
  border: 1px solid #e5e7eb; margin: 10px 0; display: block;
}
input[type="file"] {
  margin-top: 6px; font-size: .85rem; font-family: inherit;
}

/* ---- Paragraph Lab (Weeks 5 & 7) ---- */
.essay-question {
  margin-bottom: 16px; padding: 14px; background: #f0fdf4;
  border: 1px solid #bbf7d0; border-radius: 10px;
}
.guide-box {
  margin-bottom: 16px; padding: 14px; background: #f8fafc;
  border: 1px solid #e5e7eb; border-radius: 10px; font-size: .88rem;
}
.guide-what { font-weight: 700; color: #047857; margin-bottom: 8px; }
.guide-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; color: #374151; }
.guide-steps li::marker { color: #059669; font-weight: 700; }
.guide-starter { color: #6b7280; margin-bottom: 10px; }
.guide-starter strong { color: #374151; }
.guide-check-title { font-weight: 600; font-size: .8rem; color: #4b5563; margin-bottom: 4px; }
.guide-checklist { padding-left: 20px; display: flex; flex-direction: column; gap: 3px; color: #6b7280; font-size: .82rem; }
.guide-checklist li::marker { color: #059669; }

/* ---- Site footer (repo provenance note) ---- */
.site-footer {
  max-width: 760px; margin: 8px auto 32px; padding: 0 16px;
  text-align: center; font-size: .72rem; color: #9ca3af;
}
.site-footer a { color: #6b7280; }
.site-footer code { font-size: .68rem; }

/* ---- Version line + changelog (release metadata, not student content) ---- */
.version-line { margin: 0 0 6px; font-size: .7rem; letter-spacing: .04em; color: #9ca3af; }
.changelog { max-width: 640px; margin: 0 auto 8px; font-size: .72rem; color: #9ca3af; text-align: left; }
.changelog summary { cursor: pointer; text-align: center; color: #6b7280; }
.changelog summary:hover { color: #374151; }
.changelog ul { margin: 8px 0 4px; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.changelog li strong { color: #6b7280; }
.dev-link { color: #9ca3af; text-decoration: dotted underline; }
.dev-link:hover { color: #6b7280; }

/* ---- v1.3: decision chips, outputs, prompt link ---- */
.prompt-link { margin-top: 12px; font-size: .82rem; }
.prompt-link a { color: #fff; text-decoration: underline; text-underline-offset: 3px; opacity: .92; }
.prompt-link a:hover { opacity: 1; }

.decision-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; padding: 10px; background: #f0fdf4;
  border: 1px solid #bbf7d0; border-radius: 8px;
}
.decision-label { font-size: .8rem; font-weight: 700; color: #047857; }
.decision-hint { font-size: .75rem; color: #6b7280; }
.chip {
  background: #fff; color: #047857; border: 1px solid #059669;
  padding: 6px 12px; font-size: .8rem; border-radius: 999px;
}
.chip:hover { background: #ecfdf5; }
.chip.active { background: #059669; color: #fff; }

.report-title { font-size: 1rem; color: #059669; }
.copy-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.copy-btns button { font-size: .8rem; padding: 8px 14px; }
#report-actions { margin-bottom: 6px; align-items: center; }

.chat-history { max-width: none; margin: 12px 0 0; font-size: .82rem; color: #374151; text-align: left; }
.chat-history summary { cursor: pointer; color: #047857; font-weight: 600; text-align: left; }
.chat-history summary:hover { color: #059669; }
.chat-history .report-block { margin-top: 8px; white-space: pre-wrap; }
