:root {
  --primary: #4F46E5;
  --primary-gradient: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  --accent: #F59E0B;
  --card-bg: rgba(255, 255, 255, 0.98);
  --card-border: rgba(255, 255, 255, 0.9);
  --text-main: #0F172A;
  --text-muted: #475569;
  --shadow-soft: 0 20px 40px -15px rgba(0, 0, 0, 0.25);
  --shadow-bubble: 0 4px 12px rgba(0, 0, 0, 0.04);
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', sans-serif; }

body {
  color: var(--text-main);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  /* user-select bỏ đi: học sinh cần bôi đen chép từ tiếng Anh để tra nghĩa */
  font-size: 15px;
}

.bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  display: block;
}

.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: -1;
}

.click-sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 1.2rem;
  animation: sparkleAnim 0.7s ease-out forwards;
}

@keyframes sparkleAnim {
  0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2) rotate(180deg); }
}

.container {
  width: 100%;
  max-width: 1200px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
}

header {
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 24px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
}

.brand-logo h1 {
  font-size: 2rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.header-logo {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 3px 6px rgba(99, 102, 241, 0.3));
}

.btn-nav {
  position: absolute;
  right: 24px;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
  transition: all 0.2s var(--transition-smooth);
}
.btn-nav:hover { transform: translateY(-1px); }

.scroll-content {
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow-y: auto;
}

.screen-view {
  animation: fadeInSlide 0.3s var(--transition-smooth) forwards;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@keyframes fadeInSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-banner {
  display: flex;
  align-items: center;
  background: var(--primary-gradient);
  padding: 14px 22px;
  border-radius: 14px;
  gap: 16px;
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.18);
}
.hero-mascot {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  filter: drop-shadow(0px 3px 6px rgba(0, 0, 0, 0.2));
  animation: float 3.5s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}
.hero-text h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 2px; }
.hero-text p { font-size: 0.95rem; opacity: 0.98; font-weight: 500; line-height: 1.3; }

.info-card {
  background: #F8FAFC;
  border-radius: 14px;
  padding: 14px 20px;
  border: 1px solid #CBD5E1;
}
.info-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}
.info-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 6px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 10px;
}
.step-item {
  background: #FFFFFF;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.step-num {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  margin: 0 auto 6px auto;
}
.step-item h4 { font-size: 0.95rem; font-weight: 800; color: #1E1B4B; margin-bottom: 2px; }
.step-item p { font-size: 0.85rem; color: var(--text-muted); margin: 0; line-height: 1.3; }

.screen-title { font-size: 1.1rem; font-weight: 800; color: var(--text-main); margin-bottom: 10px; }

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 768px) {
  .topic-grid, .steps-grid, .features-grid { grid-template-columns: 1fr; }
  .btn-nav { position: static; }
  header { justify-content: space-between; }
}

.topic-card {
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  border-radius: 14px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  gap: 14px;
  align-items: center;
  transition: all 0.2s var(--transition-smooth);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.03);
}
.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -4px rgba(79, 70, 229, 0.2);
  border-color: #818CF8;
}

.topic-emoji {
  font-size: 1.6rem;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topic-card h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 2px; color: #0F172A; }
.topic-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.3; margin-bottom: 4px; font-weight: 500; }
.stars { font-size: 0.82rem; color: #D97706; font-weight: 700; }

.features-section {
  background: #F8FAFC;
  border-radius: 14px;
  padding: 14px 20px;
  border: 1px solid #CBD5E1;
}
.features-title {
  font-size: 1rem;
  font-weight: 800;
  color: #3730A3;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.feature-item {
  background: #FFFFFF;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.feature-icon { font-size: 1.3rem; line-height: 1; }
.feature-item h4 { font-size: 0.9rem; font-weight: 800; color: #1E1B4B; margin-bottom: 2px; }
.feature-item p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.3; }

#screen-convo { display: none; }
.chat-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid #CBD5E1;
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
  gap: 10px;
  flex-wrap: wrap;
}

.chat-header-actions { display: flex; gap: 8px; }
.btn-tool {
  border: 1px solid #C7D2FE;
  background: #EEF2FF;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s var(--transition-smooth);
}
.btn-tool:hover { background: #E0E7FF; transform: translateY(-1px); }
.btn-tool:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.transcript {
  min-height: 260px;
  max-height: 340px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #F8FAFC;
  border-radius: 14px;
  border: 1px solid #CBD5E1;
  scroll-behavior: smooth;
}
.row { display: flex; gap: 10px; align-items: flex-end; }
.row.user { flex-direction: row-reverse; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar.ai { background: #EEF2FF; border: 2px solid #C7D2FE; }
.avatar.user { background: var(--primary); color: #FFF; font-size: 0.95rem; border: 2px solid #A5B4FC; }

.bubble {
  max-width: 78%;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
  font-weight: 600;
  box-shadow: var(--shadow-bubble);
  min-height: 1.4em;
}
.bubble.ai { background: #FFFFFF; color: #1E293B; border-bottom-left-radius: 4px; border: 1px solid #CBD5E1; }
.bubble.user { background: var(--primary-gradient); color: #FFFFFF; border-bottom-right-radius: 4px; }
.bubble.hint { background: #FEF3C7; color: #92400E; font-size: 0.88rem; text-align: center; width: 100%; border-radius: 10px; font-weight: 700; }

.bubble.ai .typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--primary);
  margin-left: 2px;
  vertical-align: middle;
  animation: blinkCursor 0.8s step-end infinite;
}
@keyframes blinkCursor { 50% { opacity: 0; } }

.controls { display: flex; flex-direction: column; gap: 8px; }
.status-box { text-align: center; }
#status-line { font-size: 1rem; font-weight: 800; color: var(--primary); }
#status-sub { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }

.hint-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.hint-chip {
  border: 1px dashed #A5B4FC;
  background: #F5F5FF;
  color: #3730A3;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s var(--transition-smooth);
}
.hint-chip:hover { background: #E0E7FF; transform: translateY(-1px); }

.input-area { display: flex; gap: 10px; align-items: center; }
.mic-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--primary-gradient);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  position: relative;
}
.mic-btn.listening {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  animation: micPulse 1.3s ease-out infinite;
}
@keyframes micPulse {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55), 0 4px 12px rgba(220, 38, 38, 0.3); }
  70%  { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0), 0 4px 12px rgba(220, 38, 38, 0.3); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 4px 12px rgba(220, 38, 38, 0.3); }
}

.text-input-wrapper {
  flex: 1;
  display: flex;
  background: #FFFFFF;
  border-radius: 24px;
  padding: 4px 6px 4px 16px;
  border: 2px solid #CBD5E1;
}
.text-input-wrapper input { border: none; background: transparent; width: 100%; outline: none; font-size: 0.95rem; color: var(--text-main); font-weight: 600; }

.btn-send-plane {
  border: none;
  background: var(--primary-gradient);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-send-plane svg { width: 15px; height: 15px; fill: currentColor; }

#screen-summary { display: none; padding: 18px; text-align: center; }
.summary-mascot { width: 70px; height: 70px; margin: 0 auto 8px; }
.summary-title { font-size: 1.4rem; font-weight: 800; color: #0F172A; }
.summary-stars { font-size: 2rem; color: #F59E0B; margin: 6px 0; }
.summary-card { background: #FFFFFF; padding: 16px; border-radius: 14px; margin: 10px auto; max-width: 420px; font-size: 0.95rem; border: 1px solid #CBD5E1; font-weight: 600; }

.author-footer {
  margin-top: 10px;
  text-align: center;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.author-text {
  font-size: 0.85rem;
  font-weight: 800;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
/* ---- Dropdown Dịch Tiếng Việt ---- */
.bubble.ai details.translation-dropdown {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #CBD5E1;
  font-size: 0.85rem;
}

.bubble.ai details.translation-dropdown summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
  /* user-select bỏ đi: học sinh cần bôi đen chép từ tiếng Anh để tra nghĩa */
  outline: none;
  transition: color 0.2s ease;
}

.bubble.ai details.translation-dropdown summary:hover {
  color: #3730A3;
}

.bubble.ai details.translation-dropdown .vi-text {
  margin-top: 6px;
  padding: 8px 12px;
  background: #F1F5F9;
  border-radius: 8px;
  color: #334155;
  font-weight: 500;
  line-height: 1.4;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}
/* ==================================================================
   BẢN NÂNG CẤP — các thành phần mới
   Đặt ở cuối file nên tự động ghi đè quy tắc cũ khi trùng tên.
================================================================== */

/* --- thanh tiêu đề --- */
.brand-logo { background: none; border: none; padding: 0; font: inherit; }
.brand-logo:focus-visible,
.btn-icon:focus-visible,
.topic-card:focus-visible,
.level-btn:focus-visible,
.hint-chip:focus-visible,
.mood-btn:focus-visible,
.flcas-opt:focus-visible,
.btn-primary:focus-visible { outline: 3px solid #4F46E5; outline-offset: 2px; }

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

.header-progress { display: flex; gap: 8px; flex-wrap: wrap; }
.hp-item {
  font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
  background: #EEF2FF; border: 1px solid #C7D2FE;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}

.btn-icon {
  background: #EEF2FF; border: 1px solid #C7D2FE; border-radius: 10px;
  width: 36px; height: 36px; font-size: 1rem; cursor: pointer; line-height: 1;
}
.btn-icon:hover { background: #E0E7FF; }

/* --- dải trấn an (nguyên lý 1: môi trường an toàn) --- */
.safe-strip {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  background: #ECFDF5; border: 1px solid #A7F3D0; border-radius: 12px; padding: 8px 12px;
}
.safe-strip span { font-size: 0.82rem; font-weight: 700; color: #047857; }

/* --- chọn mức độ --- */
.level-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.level-btn {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  background: #FFFFFF; border: 2px solid #E2E8F0; border-radius: 12px;
  padding: 10px 12px; cursor: pointer; text-align: left;
  transition: all 0.15s var(--transition-smooth);
}
.level-btn span { font-weight: 800; font-size: 0.92rem; color: #1E1B4B; }
.level-btn small { font-size: 0.76rem; color: var(--text-muted); font-weight: 600; }
.level-btn:hover { border-color: #C7D2FE; transform: translateY(-1px); }
.level-btn.sel { border-color: var(--primary); background: #EEF2FF; }

/* --- thẻ hòn đảo --- */
.topic-card { text-align: left; align-items: flex-start; }
.topic-info { flex: 1; min-width: 0; }
.topic-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.topic-meta .lv { font-size: 0.7rem; color: var(--primary); letter-spacing: 1px; }
.topic-done { font-size: 0.76rem; font-weight: 700; color: var(--text-muted); }
.topic-card.visited .topic-done { color: #059669; }
.topic-card.visited { border-color: #A7F3D0; }

.load-error {
  grid-column: 1 / -1; text-align: center; padding: 20px;
  color: var(--text-muted); font-weight: 700; font-size: 0.9rem;
}

/* --- chấm tiến độ trong hội thoại --- */
.progress-dots { display: flex; gap: 5px; align-items: center; }
.pdot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #CBD5E1; transition: all 0.25s var(--transition-smooth);
}
.pdot.on { background: var(--accent); transform: scale(1.25); }

/* --- bong bóng của Ollie --- */
.bubble.ai .en-text { font-weight: 700; line-height: 1.45; }

.bubble.ai details.translation-dropdown,
.bubble.ai details.tip-dropdown {
  margin-top: 8px; border-top: 1px dashed #CBD5E1; padding-top: 6px;
}
.bubble.ai details summary {
  cursor: pointer; font-size: 0.8rem; font-weight: 800;
  color: var(--primary); list-style: none; user-select: none;
}
.bubble.ai details summary::-webkit-details-marker { display: none; }
.bubble.ai details summary:hover { text-decoration: underline; }
.bubble.ai .vi-text {
  margin-top: 5px; font-size: 0.88rem; font-weight: 600;
  color: var(--text-muted); line-height: 1.45;
}

/* Gợi ý cách nói khác — nguyên lý 2.
   Cố ý dùng XANH LÁ chứ không phải đỏ, và chữ "một cách nói khác"
   chứ không phải "lỗi sai": học sinh không được cảm thấy bị chấm. */
.bubble.ai details.tip-dropdown { border-top-color: #A7F3D0; }
.bubble.ai details.tip-dropdown summary { color: #059669; }
.bubble.ai .tip-text {
  margin-top: 5px; font-size: 0.88rem; font-weight: 600;
  color: #047857; background: #ECFDF5; border-radius: 8px;
  padding: 7px 10px; line-height: 1.45;
}

.bubble.typing::after {
  content: ''; display: inline-block; width: 2px; height: 1em;
  background: var(--primary); margin-left: 2px; vertical-align: text-bottom;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.mic-warning {
  color: #B45309; background: #FEF3C7; border: 1px solid #FCD34D;
  border-radius: 10px; padding: 7px 10px; display: none;
  text-align: center; font-size: 0.82rem; font-weight: 700;
}

/* --- hộp thoại nổi --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: #FFFFFF; border-radius: 18px; padding: 22px;
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.4);
  text-align: center; animation: popIn 0.25s var(--transition-smooth);
}
@keyframes popIn { from { opacity: 0; transform: scale(0.94) translateY(10px); } }

.modal-box h2 { font-size: 1.2rem; font-weight: 800; color: #0F172A; margin-bottom: 6px; }
.modal-box > p { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; line-height: 1.5; margin-bottom: 14px; }

.modal-input {
  width: 100%; padding: 11px 14px; margin-bottom: 10px;
  border: 2px solid #E2E8F0; border-radius: 12px;
  font-size: 0.95rem; font-weight: 600; outline: none;
}
.modal-input:focus { border-color: var(--primary); }

.btn-primary {
  background: var(--primary-gradient); color: #FFFFFF; border: none;
  border-radius: 12px; padding: 11px 22px; font-size: 0.95rem;
  font-weight: 800; cursor: pointer; width: 100%;
  transition: transform 0.15s var(--transition-smooth);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.link-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 0.85rem; font-weight: 700; cursor: pointer;
  text-decoration: underline; margin-top: 10px;
}

/* --- bài đo lo âu (FLCAS) --- */
.flcas-box { max-width: 560px; text-align: left; }
.flcas-head { text-align: center; margin-bottom: 14px; }
.flcas-emoji { font-size: 2.2rem; line-height: 1; margin-bottom: 6px; }
.flcas-emoji.big { font-size: 3rem; }

.flcas-list { display: flex; flex-direction: column; gap: 14px; }
.flcas-item { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px; padding: 12px; }
.flcas-item.answered { border-color: #A7F3D0; background: #F0FDF4; }
.flcas-q { font-size: 0.9rem; font-weight: 700; color: #1E293B; margin-bottom: 9px; line-height: 1.4; }

.flcas-opts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.flcas-opt {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #FFFFFF; border: 2px solid #E2E8F0; border-radius: 10px;
  padding: 7px 3px; cursor: pointer; transition: all 0.15s var(--transition-smooth);
}
.flcas-opt:hover { border-color: #C7D2FE; }
.flcas-opt.sel { border-color: var(--primary); background: #EEF2FF; }
.flcas-num { font-weight: 800; font-size: 0.9rem; color: var(--primary); }
.flcas-lab { font-size: 0.62rem; font-weight: 700; color: var(--text-muted); text-align: center; line-height: 1.15; }

.flcas-foot {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid #E2E8F0;
}
.flcas-count { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.flcas-foot .btn-primary { width: auto; flex: 1; }
.flcas-result { text-align: center; }
.flcas-result p { font-size: 0.92rem; color: var(--text-muted); font-weight: 600; line-height: 1.55; margin-bottom: 16px; }
.flcas-great { color: #047857 !important; }

/* --- tâm trạng trước/sau buổi --- */
.mood-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 4px; }
.mood-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #F8FAFC; border: 2px solid #E2E8F0; border-radius: 14px;
  padding: 12px 4px; cursor: pointer; transition: all 0.15s var(--transition-smooth);
}
.mood-btn:hover { border-color: var(--primary); background: #EEF2FF; transform: translateY(-2px); }
.mood-emoji { font-size: 1.7rem; line-height: 1; }
.mood-label { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); text-align: center; line-height: 1.2; }

/* --- màn hình tổng kết --- */
.summary-mood { margin-top: 8px; color: #047857 !important; font-weight: 700; }
.summary-stats { display: flex; justify-content: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.summary-stat {
  background: #FFFFFF; border: 1px solid #CBD5E1; border-radius: 12px;
  padding: 10px 16px; min-width: 92px;
  display: flex; flex-direction: column; gap: 1px;
}
.summary-stat .v { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.summary-stat .k { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.summary-note { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; margin: 8px 0 14px; }
#screen-summary .btn-primary { max-width: 300px; margin: 0 auto; }

/* --- khối giới thiệu gập lại --- */
.info-card summary {
  cursor: pointer; font-size: 0.95rem; color: var(--primary);
  list-style: none; user-select: none;
}
.info-card summary::-webkit-details-marker { display: none; }
.info-card summary::after { content: ' ▾'; }
.info-card[open] summary::after { content: ' ▴'; }
.info-card[open] summary { margin-bottom: 8px; }

/* --- màn hình hẹp --- */
@media (max-width: 768px) {
  .level-picker { grid-template-columns: 1fr; }
  .header-progress { display: none; }
  .chat-header-bar { flex-wrap: wrap; gap: 8px; }
  .flcas-opts { grid-template-columns: repeat(5, 1fr); gap: 3px; }
  .flcas-lab { font-size: 0.55rem; }
  .flcas-foot { flex-direction: column; align-items: stretch; }
  .flcas-foot .btn-primary { width: 100%; }
  .summary-stat { min-width: 78px; padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
