/* organic-101-lab.css — CSS riêng cho tools/hoa-11-chuong-3.php.
   Khối .theory-* giữ nguyên quy ước như nitrogen-sulfur-lab.css (Chương 2)
   để đồng bộ giao diện giữa các chương. */

.theory-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.theory-toc-item {
  font-size: 13px; padding: 6px 12px; border-radius: 20px; background: #eef0fa;
  color: var(--blue-dark); text-decoration: none; font-weight: 600;
}
.theory-toc-item:hover { background: var(--blue); color: #fff; }
.theory-lesson { margin-bottom: 36px; scroll-margin-top: 16px; }
.theory-lesson-title { font-size: 19px; font-weight: 700; margin-bottom: 12px; border-bottom: 2px solid var(--line); padding-bottom: 8px; }
.theory-body p { line-height: 1.7; margin: 0 0 12px; font-size: 15px; }
.theory-body ul { margin: 0 0 14px; padding-left: 20px; line-height: 1.7; font-size: 15px; }
.theory-body li { margin-bottom: 6px; }
.theory-callout { background: #eef0fa; border-radius: var(--radius); padding: 16px 18px; margin: 16px 0; }
.theory-callout-title { font-weight: 700; margin-bottom: 8px; color: var(--blue-dark); }
.theory-callout ul { margin: 0; padding-left: 20px; }
.theory-callout p:last-child { margin-bottom: 0; }
.theory-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13.5px; }
.theory-table th, .theory-table td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.theory-table th { background: #f5f6fb; font-weight: 700; }
.theory-note { font-size: 13px; color: var(--ink-soft); font-style: italic; }
.theory-link-tab { color: var(--blue); font-weight: 600; text-decoration: none; }
.theory-link-tab:hover { text-decoration: underline; }

/* ===== Quy trình giải bài tập (dạng luồng các bước, tái dùng ý tưởng
   chain-diagram của Chương 2 nhưng đổi ngữ nghĩa: mỗi ô là 1 BƯỚC thay
   vì 1 chất) ===== */
.flow-title { font-size: 16px; font-weight: 700; margin: 28px 0 12px; color: var(--ink); }
.flow-title:first-child { margin-top: 0; }
.flow-diagram {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  background: #f8f9fd; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; margin-bottom: 22px;
}
.flow-step {
  background: var(--blue); color: #fff; font-weight: 700; font-size: 13.5px;
  padding: 8px 14px; border-radius: 10px; white-space: nowrap;
}
.flow-step.alt { background: #64748b; }
.flow-arrow { font-size: 18px; color: var(--blue-dark); padding: 0 4px; }
@media (max-width: 640px) {
  .flow-diagram { flex-direction: column; align-items: stretch; }
  .flow-step { text-align: center; }
  .flow-arrow { transform: rotate(90deg); text-align: center; padding: 2px 0; }
}

/* ===== Bảng tra cứu nhanh ===== */
.formula-box {
  font-family: 'IBM Plex Mono', monospace; font-size: 16px; font-weight: 700;
  color: var(--blue-dark); background: #eef0fa; border-radius: var(--radius);
  padding: 14px 16px; margin: 10px 0 20px; text-align: center;
}
.mistake-item {
  background: #fff7ed; border-left: 4px solid #f59e0b; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 10px; font-size: 14px; line-height: 1.6;
}
.mistake-item strong { color: #9a3412; }

/* ===== Poster ảnh minh họa (dùng ở tab Bảng tra cứu nhanh) ===== */
.poster-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 12px;
}
.poster-link {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
  min-width: 0; /* tránh lặp lại bug CSS Grid min-width:auto đã gặp */
}
.poster-link img {
  display: block;
  width: 100%;
  height: auto;
}
.poster-link .poster-zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(20,20,30,0.65);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
}
.poster-caption {
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 6px;
}

/* ===== Mini-lab tương tác chèn trong Lý thuyết (mạch carbon, công thức,
   đồng phân, gọi tên) — thêm theo yêu cầu người dùng, dựa trên phần
   "Phòng trực quan" của 1 file chuyên đề Bài 13 người dùng cung cấp.
   Dùng class riêng .mini-lab-btn (không chọn theo <button> trần) và
   !important cho color/background/width để không bị 1 rule <button>
   toàn cục nào đó đè mất chữ — bài học rút ra từ lỗi tương tự ở phần
   Luyện tập Chương 6. ===== */
.mini-lab {
  background: #f8fafc; border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin: 16px 0;
}
.mini-lab-title { font-weight: 700; font-size: 14px; color: var(--blue-dark); margin-bottom: 10px; }
.mini-lab-display {
  font-family: 'IBM Plex Mono', monospace; font-size: 20px; font-weight: 700;
  text-align: center; background: #eef0fa; border-radius: 10px; padding: 14px;
  color: var(--ink, #1b2130); margin-bottom: 10px; white-space: pre-line;
}
.mini-lab-feedback { font-size: 13.5px; color: var(--ink-soft); text-align: center; min-height: 20px; margin-bottom: 12px; }
.mini-lab-controls { display: flex !important; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mini-lab-btn {
  display: inline-flex !important; width: auto !important; flex: 0 0 auto !important;
  border: 1.5px solid var(--line) !important; background: #fff !important;
  color: var(--ink, #1b2130) !important;
  border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.mini-lab-btn.active, .mini-lab-btn:hover {
  background: var(--blue) !important; border-color: var(--blue) !important; color: #fff !important;
}
