:root {
  --ink: #17202a;
  --muted: #68717c;
  --line: #e6e8eb;
  --paper: #f7f8fa;
  --card: #ffffff;
  --accent: #5b4bdb;
  --accent-light: #eeebff;
  --dark: #20252b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell { max-width: 1180px; margin: auto; padding: 28px 28px 20px; }

header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 28px; border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 13px; }
.logo {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center; background: var(--dark);
  color: white; font-weight: 800; letter-spacing: -1px;
}
h1 { margin: 0; font-size: 19px; letter-spacing: -.4px; }
header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.model-pill {
  background: var(--accent-light); color: var(--accent);
  padding: 8px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
}

.hero { padding: 60px 4px 42px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 2px; margin: 0 0 14px; }
.hero h2 { font-size: clamp(42px, 6vw, 72px); line-height: .98; letter-spacing: -4px; margin: 0; }
.hero h2 span { color: var(--accent); }
.hero-copy { max-width: 560px; color: var(--muted); font-size: 16px; line-height: 1.6; margin-top: 22px; }

.grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; box-shadow: 0 5px 25px rgba(25,30,40,.035);
}
.card-title, .answer-header { display:flex; justify-content:space-between; align-items:flex-start; gap:15px; }
.card-title h3, .answer-header h3 { margin: 4px 0 18px; font-size: 17px; }
.step { font-size: 10px; color: var(--accent); font-weight: 800; letter-spacing: 1.5px; }

textarea {
  width: 100%; min-height: 290px; resize: vertical; border: 1px solid var(--line);
  border-radius: 12px; padding: 15px; font: inherit; line-height: 1.55;
  color: var(--ink); outline: none; background: #fbfbfc;
}
textarea:focus { border-color: #b9b1ff; box-shadow: 0 0 0 3px var(--accent-light); }
.question-box { min-height: 130px; }

.hint { font-size: 11px; color: var(--muted); margin-top: 9px; }
.text-btn { border:0; background:none; color:var(--accent); font-weight:700; cursor:pointer; padding: 2px; }

.modes { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:14px 0; }
.mode {
  border:1px solid var(--line); background:white; border-radius:10px;
  padding:10px; cursor:pointer; font-size:12px; font-weight:650; color:#4f5862;
}
.mode.active { border-color:#b8b0ff; background:var(--accent-light); color:var(--accent); }

.ask-btn {
  width:100%; border:0; border-radius:11px; padding:13px;
  background:var(--dark); color:white; font-weight:750; cursor:pointer;
  font-size:14px;
}
.ask-btn:hover { transform: translateY(-1px); }
.ask-btn:disabled { opacity:.6; cursor:wait; }

.answer-card { margin-top:18px; min-height:300px; }
.status { font-size:11px; background:#f0f2f4; padding:6px 9px; border-radius:999px; color:var(--muted); }
.answer { border-top:1px solid var(--line); padding-top:22px; line-height:1.7; font-size:15px; white-space:pre-wrap; }
.empty-state { min-height:220px; display:grid; place-items:center; align-content:center; color:var(--muted); text-align:center; }
.empty-icon { font-size:28px; color:var(--accent); margin-bottom:8px; }

footer { display:flex; justify-content:space-between; color:var(--muted); font-size:11px; padding:22px 3px 0; }

@media(max-width:800px) {
  .grid { grid-template-columns:1fr; }
  .hero { padding:40px 2px 30px; }
  .hero h2 { letter-spacing:-2px; }
}

.drop-zone {
  border: 1.5px dashed #c8cbd1;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fafafd;
  cursor: pointer;
  transition: 0.2s;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: #8c80ee;
  background: #f4f2ff;
}

.upload-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
}

.drop-zone strong {
  display: block;
  font-size: 13px;
}

.drop-zone span {
  color: var(--muted);
  font-size: 12px;
}

.drop-zone button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.drop-zone small {
  display: block;
  color: #9aa0a8;
  font-size: 10px;
  margin-top: 5px;
}

.file-status {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #dcd8ff;
  background: #f7f6ff;
  border-radius: 11px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-status strong {
  display: block;
  font-size: 12px;
}

.file-status small {
  color: var(--muted);
  font-size: 10px;
}

.file-status button {
  border: 0;
  background: none;
  color: #777;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.divider {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #a0a5ac;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 15px 0 9px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}

/* =========================
   INTERACTIVE ANSWER CARD
   ========================= */

.answer-card {
  margin-top: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(30, 35, 45, 0.06);
  animation: answerIn 0.35s ease;
}

.answer-card.hidden {
  display: none;
}

@keyframes answerIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.answer-header {
  padding: 15px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fcfcfe;
}

.answer-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-light);
}

.answer-title strong {
  display: block;
  font-size: 13px;
}

.answer-title small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.answer-actions {
  display: flex;
  gap: 6px;
}

.answer-actions button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  cursor: pointer;
  transition: 0.2s;
}

.answer-actions button:hover {
  background: var(--accent-light);
  border-color: #d8d2ff;
  transform: translateY(-1px);
}

.answer-body {
  padding: 20px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}

.answer-body p {
  margin: 0 0 12px;
}

.answer-body p:last-child {
  margin-bottom: 0;
}

.answer-body strong {
  color: var(--accent);
}

.answer-body ul,
.answer-body ol {
  padding-left: 22px;
  margin: 10px 0;
}

.answer-body li {
  margin-bottom: 7px;
}

.answer-footer {
  padding: 11px 17px;
  border-top: 1px solid var(--line);
  background: #fafafd;

  display: flex;
  align-items: center;
  justify-content: space-between;

  color: #9a9da5;
  font-size: 10px;
}

.answer-footer button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.answer-footer button:hover {
  text-decoration: underline;
}

/* =========================
   INTERACTIVE QUIZ
   ========================= */

.quiz-card {
  margin-top: 18px;
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(30, 35, 45, 0.06);
  animation: answerIn 0.35s ease;
}

.quiz-card.hidden {
  display: none;
}

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-label {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

.quiz-top h3 {
  margin: 4px 0 0;
  font-size: 16px;
}

.quiz-score {
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.quiz-progress {
  height: 5px;
  background: #eeeef2;
  border-radius: 10px;
  margin: 18px 0 22px;
  overflow: hidden;
}

.quiz-progress div {
  height: 100%;
  width: 20%;
  background: var(--accent);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.quiz-question {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 16px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.quiz-option {
  width: 100%;
  padding: 13px 14px;

  border: 1px solid var(--line);
  border-radius: 11px;

  background: white;
  text-align: left;

  font-size: 13px;
  color: var(--ink);

  cursor: pointer;
  transition: 0.2s;

  display: flex;
  align-items: center;
  gap: 11px;
}

.quiz-option:hover {
  border-color: #c8c2ff;
  background: #faf9ff;
  transform: translateY(-1px);
}

.option-letter {
  width: 27px;
  height: 27px;
  flex-shrink: 0;

  display: grid;
  place-items: center;

  border-radius: 8px;
  background: #f1f1f4;

  font-size: 11px;
  font-weight: 800;
  color: #666;
}

.quiz-option.correct {
  border-color: #9bd5ad;
  background: #f0fbf3;
}

.quiz-option.correct .option-letter {
  background: #c9efd4;
  color: #24733c;
}

.quiz-option.wrong {
  border-color: #e6aaaa;
  background: #fff3f3;
}

.quiz-option.wrong .option-letter {
  background: #f4cccc;
  color: #a33b3b;
}

.quiz-option.disabled {
  cursor: default;
  transform: none;
}

.quiz-feedback {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 11px;
  background: #f7f6ff;
  border: 1px solid #dfdcff;
}

.quiz-feedback.hidden {
  display: none;
}

.quiz-feedback strong {
  font-size: 12px;
  color: var(--accent);
}

.quiz-feedback p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.next-question {
  width: 100%;
  margin-top: 13px;
  padding: 12px;

  border: 0;
  border-radius: 10px;

  background: var(--dark);
  color: white;

  font-size: 12px;
  font-weight: 700;

  cursor: pointer;
}

.next-question:hover {
  opacity: 0.9;
}

.hidden {
  display: none !important;
}