/* ═══════════════════════════════════════════════════════════════
   LIFESTYLE ATELIER — Custom CSS (v3 — Typography & Readability)
   Bảng màu: Warm Cream #FAF6EF · Terracotta #C1694F ·
             Muted Sage #9CAF88 · Charcoal #2E2A26 · Gold #C9A86A
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════ NỀN TẢNG CHỮ TOÀN CỤC (UI đợt 3) ═══════════ */
/* Trước đây chỉ index.html có antialias — đưa lên toàn web cho chữ mượt & sắc
   đều nhau. KHÔNG đổi cỡ chữ từng chỗ (scale ngầm giữ nguyên), chỉ nâng chất render. */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* Tiêu đề tự cân dòng — hết chữ "mồ côi" lửng cuối dòng, ragging đẹp hơn */
h1, h2, h3, h4 { text-wrap: balance; }
/* Đoạn văn: tránh một từ trơ trọi rơi xuống dòng cuối */
p { text-wrap: pretty; }

/* ═══════════ TRANG CHỦ (index.html) ═══════════ */
.home-hero {
  background:
    radial-gradient(ellipse 70% 60% at 50% -10%, rgba(201, 168, 106, 0.18), transparent 70%),
    linear-gradient(180deg, #FAF6EF, #F5EEE1);
}
.home-card {
  display: block;
  position: relative;
  background: #fff;
  border: 1.5px solid #F1E9DB;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 4px 16px rgba(46, 42, 38, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
a.home-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 34px rgba(46, 42, 38, 0.12);
  border-color: rgba(201, 168, 106, 0.6);
}
.home-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 999px;
}
.home-card-soon .home-badge { position: static; display: inline-block; }
.home-badge-live { background: rgba(117, 144, 98, 0.15); color: #4f6a3c; }
.home-badge-new  { background: rgba(193, 105, 79, 0.14); color: #9E4F38; }
.home-badge-soon { background: rgba(201, 168, 106, 0.2); color: #8a6d2f; }
.home-feats { list-style: none; margin-bottom: 18px; }
.home-feats li {
  position: relative;
  padding-left: 22px;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(46, 42, 38, 0.7);
  margin-bottom: 5px;
}
.home-feats li::before { content: "✓"; position: absolute; left: 2px; color: #759062; font-weight: 800; }
.home-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 800;
  color: #9E4F38;
}
a.home-card:hover .home-cta { gap: 11px; }
.home-cta { transition: gap 0.2s ease; }
.home-card-soon { opacity: 0.85; background: rgba(255, 255, 255, 0.7); }

/* ═══════════ MODULE MBTI ═══════════ */
.mbti-part {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9E4F38;
  margin: 26px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(193, 105, 79, 0.25);
}
.mbti-part:first-child { margin-top: 0; }
.mbti-q {
  background: #fff;
  border: 1.5px solid #F1E9DB;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.mbti-q-missing { border-color: #C1694F; box-shadow: 0 0 0 3px rgba(193, 105, 79, 0.2); }
.mbti-q-num { font-size: 11px; font-weight: 800; color: rgba(46, 42, 38, 0.4); letter-spacing: 0.05em; margin-bottom: 8px; }
.mbti-opt { display: block; cursor: pointer; margin-bottom: 8px; }
.mbti-opt:last-child { margin-bottom: 0; }
.mbti-opt-face {
  display: block;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1.5px solid rgba(46, 42, 38, 0.15);
  background: rgba(250, 246, 239, 0.5);
  font-size: 13.5px;
  line-height: 1.45;
  color: #2E2A26;
  transition: all 0.15s ease;
}
.mbti-opt-face:hover { border-color: rgba(117, 144, 98, 0.6); background: rgba(156, 175, 136, 0.08); }
.mbti-opt input:checked + .mbti-opt-face {
  background: rgba(156, 175, 136, 0.2);
  border-color: #759062;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(117, 144, 98, 0.18);
}

/* Kết quả MBTI */
.mbti-result { background: #FAF6EF; border-radius: 22px; padding: 8px; }
.mbti-hero {
  text-align: center;
  padding: 38px 24px 32px;
  border-radius: 18px;
  border: 2px solid rgba(201, 168, 106, 0.5);
  margin-bottom: 14px;
  /* màu nền/viền theo nhóm được set inline từ mbti.js (hex-alpha, tương thích html2canvas) */
}
.mbti-hero-brand { font-size: 12px; letter-spacing: 0.4em; font-weight: 700; color: #B08D3E; margin-bottom: 14px; }
.mbti-hero-code {
  font-family: "Playfair Display", serif;
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.06em;
}
.mbti-hero-nick { font-family: "Playfair Display", serif; font-size: 26px; font-weight: 700; font-style: italic; color: #2E2A26; margin: 10px 0 12px; }
.mbti-hero-group {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
}
.mbti-block {
  background: #fff;
  border: 1.5px solid #F1E9DB;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.mbti-block-title { font-size: 14px; font-weight: 800; color: #9E4F38; margin-bottom: 10px; }
.mbti-text { font-size: 13.5px; line-height: 1.65; color: #33302B; }
.mbti-list { list-style: none; }
.mbti-list li { position: relative; padding-left: 20px; font-size: 13px; line-height: 1.55; color: #33302B; margin-bottom: 6px; }
.mbti-list li::before { content: "•"; position: absolute; left: 5px; color: #C1694F; font-weight: 700; }
.mbti-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 640px) { .mbti-two-col { grid-template-columns: 1fr; } }
.mbti-two-col .mbti-block { margin-bottom: 0; }
.mbti-block-good { border-left: 5px solid #9CAF88; }
.mbti-block-warn { border-left: 5px solid #C1694F; }
.mbti-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mbti-chip {
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(156, 175, 136, 0.14);
  border: 1.5px solid rgba(117, 144, 98, 0.35);
  color: #4f6a3c;
}
.mbti-chip-gold { background: rgba(201, 168, 106, 0.16); border-color: rgba(176, 141, 62, 0.4); color: #8a6d2f; }
.mbti-fun-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(201, 168, 106, 0.2);
  color: #8a6d2f;
  vertical-align: middle;
  margin-left: 6px;
}
.mbti-block-lucky { background: linear-gradient(160deg, rgba(201, 168, 106, 0.08), #fff); }
.mbti-lucky-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mbti-lucky-color { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mbti-lucky-chip {
  width: 52px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid rgba(46, 42, 38, 0.15);
}
.mbti-lucky-name { font-size: 11px; font-weight: 700; color: #4A443E; }
.mbti-lucky-nums { display: flex; gap: 8px; margin-left: auto; }
.mbti-lucky-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #8a6d2f;
  background: rgba(201, 168, 106, 0.16);
  border: 2px solid rgba(176, 141, 62, 0.4);
}
.mbti-lucky-note { font-size: 11px; font-style: italic; color: rgba(46, 42, 38, 0.5); margin-top: 10px; }

.mbti-pair {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 10px;
}
.mbti-pair-best { background: rgba(156, 175, 136, 0.1); border: 1.5px solid rgba(117, 144, 98, 0.3); }
.mbti-pair-hard { background: rgba(193, 105, 79, 0.07); border: 1.5px solid rgba(193, 105, 79, 0.25); }
.mbti-pair-code {
  flex-shrink: 0;
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid;
}
.mbti-pair-name { font-size: 13px; font-weight: 800; color: #2E2A26; margin-bottom: 3px; }
.mbti-pair-why { font-size: 12.5px; line-height: 1.55; color: rgba(46, 42, 38, 0.75); }

.mbti-axis { margin-bottom: 16px; }
.mbti-axis:last-child { margin-bottom: 0; }
.mbti-axis-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(46, 42, 38, 0.55);
  margin-bottom: 5px;
}
.mbti-axis-labels .mbti-axis-win { color: #9E4F38; font-weight: 800; }
.mbti-axis-bar { height: 10px; border-radius: 999px; background: rgba(156, 175, 136, 0.25); overflow: hidden; }
.mbti-axis-fill { height: 100%; border-radius: 999px 0 0 999px; background: linear-gradient(90deg, #C1694F, #B05335); }
.mbti-axis-desc { font-size: 12px; font-style: italic; color: rgba(46, 42, 38, 0.55); margin-top: 5px; }
.mbti-source {
  font-size: 11px;
  font-style: italic;
  line-height: 1.55;
  color: rgba(46, 42, 38, 0.5);
  text-align: center;
  padding: 14px 18px 8px;
}

/* ═══════════════════════════════════════════════════════════════
   LUX MOTION — ngôn ngữ chuyển động đồng bộ toàn hệ sinh thái
   (reveal, glassmorphism, viền gradient, border glow)
   ═══════════════════════════════════════════════════════════════ */
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

@keyframes lux-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes lux-pop {
  0%   { opacity: 0; transform: translateY(18px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes lux-ring { to { --ang: 360deg; } }
@keyframes lux-drift-a { from { transform: translate(0,0) scale(1); } to { transform: translate(5vw,4vh) scale(1.12); } }
@keyframes lux-drift-b { from { transform: translate(0,0) scale(1.08); } to { transform: translate(-4vw,-5vh) scale(0.95); } }

/* Blob nền ambient dùng chung */
.lux-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  /* KHÔNG will-change: ép blob mờ 85px thành lớp compositor riêng khiến các phần tử
     backdrop-filter (VD .login-card atelier) phải lấy mẫu lại mỗi khung → chớp cả màn
     trên nhiều GPU. Bỏ đi để trình duyệt tự tối ưu, hết nhấp nháy. */
}
.lux-blob-a {
  width: 48vw; height: 48vw; top: -16vw; left: -10vw;
  background: radial-gradient(circle, rgba(216, 168, 91, 0.3), transparent 65%);
  animation: lux-drift-a 28s ease-in-out infinite alternate;
}
.lux-blob-b {
  width: 42vw; height: 42vw; bottom: -14vw; right: -9vw;
  background: radial-gradient(circle, rgba(193, 105, 79, 0.2), transparent 65%);
  animation: lux-drift-b 34s ease-in-out infinite alternate;
}

/* Viền 1px gradient sáng (kỹ thuật mask) — thêm class lux-border cho phần tử position:relative */
.lux-border { position: relative; }
.lux-border::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(216, 168, 91, 0.65), rgba(255, 255, 255, 0.35) 38%, rgba(193, 105, 79, 0.35));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ---------- Màn đăng nhập Atelier: glass + reveal + glow ---------- */
#login-overlay {
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(201, 168, 106, 0.2), transparent 70%),
    rgba(38, 33, 29, 0.94);
  overflow: hidden;
}
.login-card {
  position: relative;
  background: rgba(250, 246, 239, 0.88) !important;
  /* Bỏ backdrop-filter: nền đã 88% đục nên blur gần như không thấy, nhưng nó phủ lên
     blob trôi → backdrop lấy mẫu lại mỗi khung gây chớp màn login. Bỏ = hết chớp, hầu như không đổi hình. */
  border: none !important;
  border-radius: 26px !important;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55) !important;
  animation: lux-pop 0.7s cubic-bezier(0.25, 1, 0.5, 1) both;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 26px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(216, 168, 91, 0.8), rgba(255, 255, 255, 0.25) 40%, rgba(193, 105, 79, 0.5));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
/* Reveal lần lượt các phần tử con của thẻ đăng nhập */
.login-card > * { animation: lux-up 0.7s cubic-bezier(0.25, 1, 0.5, 1) both; }
.login-card > *:nth-child(1) { animation-delay: 0.12s; }
.login-card > *:nth-child(2) { animation-delay: 0.2s; }
.login-card > *:nth-child(3) { animation-delay: 0.28s; }
.login-card > *:nth-child(4) { animation-delay: 0.36s; }
.login-card > *:nth-child(5) { animation-delay: 0.42s; }
.login-card > *:nth-child(6) { animation-delay: 0.48s; }
.login-card > *:nth-child(7) { animation-delay: 0.54s; }
/* Nút đăng nhập: dải glow chạy quanh viền khi hover */
#login-btn { position: relative; overflow: visible; }
#login-btn::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  padding: 1.5px;
  background: conic-gradient(from var(--ang, 0deg), transparent 0 68%, rgba(216, 168, 91, 0.95) 82%, rgba(255, 235, 200, 0.9) 88%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
#login-btn:hover::after { opacity: 1; animation: lux-ring 2.4s linear infinite; }
/* Logo khóa nảy nhẹ */
#login-overlay .login-card .rounded-full { transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.login-card:hover .rounded-full { transform: translateY(-4px) rotate(-6deg) scale(1.06); }

/* Giữ tương thích code cũ */
@keyframes la-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Kết quả MBTI: reveal + glass + glow ---------- */
.mbti-result .mbti-hero {
  animation: lux-pop 0.75s cubic-bezier(0.25, 1, 0.5, 1) both;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.mbti-result .mbti-block,
.mbti-result .mbti-two-col {
  animation: lux-up 0.8s cubic-bezier(0.25, 1, 0.5, 1) both;
}
.mbti-result > .mbti-hero { animation-delay: 0.05s; }
.mbti-result > *:nth-child(2) { animation-delay: 0.16s; }
.mbti-result > *:nth-child(3) { animation-delay: 0.26s; }
.mbti-result > *:nth-child(4) { animation-delay: 0.36s; }
.mbti-result > *:nth-child(5) { animation-delay: 0.46s; }
.mbti-result > *:nth-child(6) { animation-delay: 0.54s; }
.mbti-result > *:nth-child(7) { animation-delay: 0.62s; }
.mbti-result > *:nth-child(8) { animation-delay: 0.7s; }
.mbti-result > *:nth-child(n+9) { animation-delay: 0.78s; }
/* Khối kết quả: glass nhẹ + viền gradient + nổi lên khi hover */
.mbti-result .mbti-block {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 10px 30px -14px rgba(46, 42, 38, 0.12);
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}
.mbti-result .mbti-block:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 44px -16px rgba(46, 42, 38, 0.2);
}

/* Đóng băng animation khi chụp ảnh kết quả (html2canvas) */
.mbti-result.no-anim, .mbti-result.no-anim * { animation: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  .lux-blob, .login-card, .login-card > *, .mbti-result .mbti-hero,
  .mbti-result .mbti-block, .mbti-result .mbti-two-col { animation: none !important; }
  .mbti-result .mbti-block, #login-btn::after { transition: none !important; }
}

/* ---------- Đánh bóng giao diện dashboard ---------- */
/* Màn hình đăng nhập giờ dùng .login-card (LUX MOTION ở trên) */

/* Card trắng bên trái: nổi nhẹ khi hover */
#app section > .bg-white {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
#app section > .bg-white:hover {
  box-shadow: 0 8px 24px rgba(46, 42, 38, 0.09);
}

/* Nút bấm: phản hồi khi nhấn */
#app button { transition: transform 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease; }
#app button:active { transform: scale(0.97); }
#export-btn { box-shadow: 0 4px 14px rgba(193, 105, 79, 0.35); }
#export-btn:hover { box-shadow: 0 6px 18px rgba(193, 105, 79, 0.45); }

/* Khối cẩm nang (details): mũi tên xoay + hover */
#app details > summary { transition: background-color 0.15s ease; border-radius: 12px; list-style: none; }
#app details > summary::-webkit-details-marker { display: none; }
#app details > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 7px;
  color: #C1694F;
  transition: transform 0.18s ease;
}
#app details[open] > summary::before { transform: rotate(90deg); }
#app details > summary:hover { background: rgba(193, 105, 79, 0.06); }

/* Ô nhập: viền ấm lên khi focus (bổ trợ cho ring của tailwind) */
#app input:focus, #app select:focus { border-color: rgba(117, 144, 98, 0.6); }

/* ---------- Admin: nhãn form dễ đọc ---------- */
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(46, 42, 38, 0.78);
}

/* Tăng tương phản cho nhãn cũ dùng tailwind text-charcoal/60 */
#app .text-charcoal\/60 { color: rgba(46, 42, 38, 0.78); }
#app input::placeholder { color: rgba(46, 42, 38, 0.38); }
#app input, #app select { font-size: 14px; color: #2E2A26; }

/* ---------- Nhóm triệu chứng trong tab Sức khỏe ---------- */
.symptom-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9E4F38;
  margin: 14px 0 8px;
}
.symptom-group-title:first-child { margin-top: 2px; }
.symptom-group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(193, 105, 79, 0.25);
}
.symptom-group { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; align-items: stretch; }

/* ---------- Radio card (tông da / sắc độ) ---------- */
.radio-card { display: block; cursor: pointer; }
.radio-face {
  display: block;
  text-align: center;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1.5px solid rgba(46, 42, 38, 0.18);
  background: rgba(250, 246, 239, 0.5);
  font-size: 13.5px;
  font-weight: 600;
  color: #2E2A26;
  transition: all 0.15s ease;
}
.radio-card input:checked + .radio-face {
  background: #C1694F;
  border-color: #C1694F;
  color: #FAF6EF;
  box-shadow: 0 4px 12px rgba(193, 105, 79, 0.35);
}

/* ---------- Checkbox card (triệu chứng / khuyết điểm / da) ---------- */
/* display:flex + min-height → mọi thẻ cân đối bằng nhau dù nhãn 1 hay 2 dòng */
.check-card { display: flex; cursor: pointer; }
.check-face {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 10px 13px;
  border-radius: 13px;
  border: 1.5px solid rgba(46, 42, 38, 0.16);
  background: rgba(250, 246, 239, 0.5);
  font-size: 13.5px;
  font-weight: 500;
  color: #2E2A26;
  line-height: 1.28;
  transition: all 0.15s ease;
}
.check-face:hover { border-color: rgba(117, 144, 98, 0.55); background: rgba(156, 175, 136, 0.08); }
.check-face::before {
  content: "";
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1.5px solid rgba(46, 42, 38, 0.3);
  background: #fff;
  transition: all 0.15s ease;
}
.check-card input:checked + .check-face {
  background: rgba(156, 175, 136, 0.22);
  border-color: #759062;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(117, 144, 98, 0.18);
}
.check-card input:checked + .check-face::before {
  background: #759062;
  border-color: #759062;
  box-shadow: inset 0 0 0 4px #fff;
}
.check-card.hidden-by-search { display: none; }

/* ---------- Thẻ khuyết điểm có icon (icon card) ---------- */
.icon-card { display: block; cursor: pointer; }
.icon-card-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 8px;
  border-radius: 14px;
  border: 1.5px solid rgba(46, 42, 38, 0.15);
  background: rgba(250, 246, 239, 0.55);
  text-align: center;
  transition: all 0.15s ease;
  height: 100%;
}
.icon-card-face:hover { border-color: rgba(193, 105, 79, 0.5); }
.icon-card-ico { width: 26px; height: 26px; color: #9E4F38; transition: color 0.15s ease; }
.icon-card-label { font-size: 12.5px; font-weight: 600; line-height: 1.25; color: #2E2A26; }
.icon-card input:checked + .icon-card-face {
  background: #C1694F;
  border-color: #C1694F;
  box-shadow: 0 5px 14px rgba(193, 105, 79, 0.32);
}
.icon-card input:checked + .icon-card-face .icon-card-ico,
.icon-card input:checked + .icon-card-face .icon-card-label { color: #FAF6EF; }

/* ---------- Cột xem trước ghim (sticky) ---------- */
@media (min-width: 1280px) {
  .preview-col {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 104px);
    overflow-y: auto;
  }
}

/* ---------- Tab ---------- */
.tab-btn { color: rgba(46, 42, 38, 0.55); border-bottom: 3px solid transparent; }
.tab-btn.tab-active {
  color: #9E4F38;
  border-bottom-color: #C1694F;
  background: rgba(193, 105, 79, 0.06);
}
.tab-count {
  display: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #759062;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.tab-count.has-count { display: inline-block; }
.tab-btn.tab-active .tab-count { background: #C1694F; }

/* ---------- Hình minh họa trong dashboard ---------- */
.illust-preview {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: linear-gradient(160deg, #FBF7F0, #F1E9DB);
  border: 1.5px solid rgba(201, 168, 106, 0.4);
  text-align: center;
}
.illust-preview svg { width: 130px; height: auto; max-height: 190px; display: inline-block; }
.illust-preview .illust-cap {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #8F4128;
}

/* ═══════════ TAB SỨC KHỎE TINH THẦN ═══════════ */
.mental-test {
  border: 1.5px solid rgba(46, 42, 38, 0.14);
  border-radius: 14px;
  background: rgba(250, 246, 239, 0.5);
  overflow: hidden;
}
.mental-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 13.5px;
  color: #2E2A26;
}
.mental-summary::-webkit-details-marker { display: none; }
.mental-name { flex: 1; }
.mental-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(46, 42, 38, 0.1);
  color: rgba(46, 42, 38, 0.6);
  white-space: nowrap;
}
.mental-badge-partial { background: rgba(201, 168, 106, 0.25); color: #8a6d2f; }
.mental-badge-done { background: rgba(156, 175, 136, 0.3); color: #4f6a3c; }
.mental-badge-urgent { background: #f8d7d7; color: #b02020; }
/* Bảng tự quan sát (MDQ/ASRS) — không chấm điểm */
.mob-intro { font-size: 12.5px; line-height: 1.55; color: #6B655D; background: rgba(201, 168, 106, 0.1); border: 1px dashed rgba(139, 109, 47, 0.35); border-radius: 11px; padding: 9px 12px; margin: 14px 0 4px; }
.mob-badge { background: rgba(107, 91, 149, 0.16); color: #5C4E85; }
.mob-items { list-style: none; margin: 0 0 12px; }
.mob-items li { font-size: 13px; line-height: 1.55; color: #2E2A26; padding: 7px 0; border-bottom: 1px dashed rgba(46, 42, 38, 0.12); }
.mob-mark { display: inline-block; font-size: 11px; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(107, 91, 149, 0.12); color: #5C4E85; white-space: nowrap; }
.mob-criteria { font-size: 12.5px; line-height: 1.55; color: #2E2A26; background: rgba(156, 175, 136, 0.14); border: 1px solid rgba(79, 106, 60, 0.3); border-radius: 11px; padding: 10px 12px; margin-bottom: 10px; }
.mob-crit-head { font-weight: 700; color: #4f6a3c; margin-bottom: 5px; }
.mob-criteria ul { list-style: none; }
.mob-criteria li { padding-left: 14px; position: relative; margin-top: 3px; }
.mob-criteria li::before { content: '›'; position: absolute; left: 0; color: #4f6a3c; font-weight: 700; }
.mob-note { font-size: 12.5px; line-height: 1.55; color: #8a2020; background: rgba(248, 215, 215, 0.4); border-radius: 9px; padding: 8px 11px; margin-bottom: 8px; }
[data-theme="dark"] .mob-intro { color: #A59A86; background: rgba(74, 59, 47, 0.4); border-color: rgba(228, 200, 146, 0.3); }
[data-theme="dark"] .mob-badge { background: rgba(151, 134, 196, 0.22); color: #B8A9E0; }
[data-theme="dark"] .mob-items li { color: #D6CDBF; border-bottom-color: rgba(214, 205, 191, 0.14); }
[data-theme="dark"] .mob-mark { background: rgba(151, 134, 196, 0.2); color: #B8A9E0; }
[data-theme="dark"] .mob-criteria { color: #D6CDBF; background: rgba(74, 84, 62, 0.35); border-color: rgba(156, 175, 136, 0.3); }
[data-theme="dark"] .mob-crit-head { color: #AFC79A; }
[data-theme="dark"] .mob-criteria li::before { color: #AFC79A; }
[data-theme="dark"] .mob-note { color: #F5B5AE; background: rgba(64, 37, 34, 0.55); }
.mental-body { padding: 4px 15px 15px; }
.mental-prompt {
  font-size: 12.5px;
  font-weight: 600;
  color: #8F4128;
  background: rgba(193, 105, 79, 0.08);
  padding: 8px 10px;
  border-radius: 9px;
  margin-bottom: 12px;
}
.mental-item { margin-bottom: 13px; }
.mental-item-rev {
  border-left: 3px solid #9CAF88;
  background: rgba(156, 175, 136, 0.08);
  border-radius: 0 10px 10px 0;
  padding: 8px 10px 8px 12px;
  margin-left: -2px;
}
.mental-q { font-size: 13px; line-height: 1.4; margin-bottom: 7px; color: #2E2A26; }
.mental-qnum { font-weight: 700; color: #9E4F38; }
.mental-rev-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(117, 144, 98, 0.2);
  color: #4f6a3c;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}
.mental-scoring-note {
  font-size: 11.5px;
  line-height: 1.5;
  color: #8a6d2f;
  background: rgba(201, 168, 106, 0.13);
  border: 1.5px solid rgba(201, 168, 106, 0.35);
  border-radius: 10px;
  padding: 9px 11px;
  margin-bottom: 12px;
}
.mental-scoring-note em { font-style: normal; font-weight: 800; color: #4f6a3c; }
.mental-scoring-note.mental-scoring-good {
  color: #4f6a3c;
  background: rgba(156, 175, 136, 0.14);
  border-color: rgba(117, 144, 98, 0.4);
}
.mental-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.mental-opt { cursor: pointer; }
.mental-opt span {
  display: block;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  border: 1.5px solid rgba(46, 42, 38, 0.18);
  background: #fff;
  color: rgba(46, 42, 38, 0.7);
  transition: all 0.12s ease;
}
.mental-opt:hover span { border-color: #9CAF88; }
.mental-radio:checked + span {
  background: #759062;
  border-color: #759062;
  color: #fff;
}
.mental-incomplete { font-size: 12px; font-style: italic; color: #8a6d2f; margin-top: 8px; }
.mental-result-box {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(156, 175, 136, 0.5);
  background: rgba(156, 175, 136, 0.12);
}
.mental-result-box.mental-level-urgent {
  border-color: rgba(176, 32, 32, 0.4);
  background: rgba(248, 215, 215, 0.5);
}
.mental-score { font-size: 14px; margin-bottom: 5px; }
.mental-meaning { font-size: 12.5px; line-height: 1.45; color: #3c3833; margin-bottom: 8px; }
.mental-proto-title { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: #5F7A4C; margin-bottom: 4px; }
.mental-level-urgent .mental-proto-title { color: #b02020; }
.mental-proto { list-style: none; }
.mental-proto li { position: relative; padding-left: 16px; font-size: 12.5px; line-height: 1.4; margin-bottom: 4px; }
.mental-proto li::before { content: "›"; position: absolute; left: 3px; color: #759062; font-weight: 700; }
.mental-tool-head {
  font-size: 12.5px;
  font-weight: 800;
  color: #5F7A4C;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 14px 0 4px;
  padding-top: 10px;
  border-top: 1.5px solid rgba(117, 144, 98, 0.25);
}
.mental-tool-head:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.mental-seek-box {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(248, 215, 215, 0.35);
  border: 1.5px solid rgba(176, 32, 32, 0.28);
}
.mental-seek-box .mental-tool-step { color: #8a2020; margin-top: 4px; }
.mental-seek-box .mental-tool-step:first-child { margin-top: 0; }
.mental-tool { padding: 8px 0; border-bottom: 1px dashed rgba(46,42,38,0.12); }
.mental-tool:last-child { border-bottom: 0; }
.mental-tool-name { font-size: 12.5px; font-weight: 700; color: #2E2A26; }
.mental-tool-for { font-weight: 500; color: rgba(46,42,38,0.55); font-size: 11.5px; }
.mental-tool-step { font-size: 12px; line-height: 1.4; color: rgba(46,42,38,0.7); margin-top: 2px; }

/* ═══════════ CẨM NANG KIẾN THỨC TÂM LÝ (mental knowledge) ═══════════ */
#mental-knowledge { padding-top: 4px; }
.mk-head {
  font-size: 13px;
  font-weight: 800;
  color: #9E4F38;
  margin: 16px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1.5px solid rgba(193, 105, 79, 0.2);
}
.mk-head:first-child { margin-top: 2px; }
.mk-card {
  border: 1.5px solid rgba(46, 42, 38, 0.12);
  border-radius: 12px;
  background: rgba(250, 246, 239, 0.5);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.mk-name { font-size: 13.5px; font-weight: 800; color: #2E2A26; margin-bottom: 4px; }
.mk-overview { font-size: 12.5px; line-height: 1.5; color: #4A443E; margin-bottom: 8px; }
.mk-sub {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5F7A4C;
  margin: 8px 0 4px;
}
.mk-list { list-style: none; margin: 0; }
.mk-list li {
  position: relative;
  padding-left: 16px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #3c3833;
  margin-bottom: 4px;
}
.mk-list li::before { content: "•"; position: absolute; left: 4px; color: #759062; font-weight: 700; }
.mk-list.mk-list-plain {
  border: 1.5px solid rgba(156, 175, 136, 0.35);
  background: rgba(156, 175, 136, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.mk-concern {
  font-size: 12px;
  line-height: 1.45;
  color: #8a2020;
  background: rgba(248, 215, 215, 0.35);
  border-radius: 9px;
  padding: 8px 10px;
  margin-top: 8px;
}
.mk-concern strong { color: #A02020; }
.mk-src { font-size: 11px; line-height: 1.4; color: rgba(46, 42, 38, 0.6); margin-top: 6px; }
.mk-src strong { color: rgba(46, 42, 38, 0.72); }
[data-theme="dark"] .mk-src { color: #A59A86; }
[data-theme="dark"] .mk-src strong { color: #C9BEAC; }
.mk-safety { font-size: 12.5px; line-height: 1.5; color: #8a2020; background: rgba(248, 215, 215, 0.5); border: 1px solid rgba(160, 32, 32, 0.35); border-radius: 11px; padding: 10px 12px; margin-bottom: 12px; }
.mk-safety ul { margin-top: 6px; }
.mk-safety li { margin-top: 2px; }
.mk-safety strong { color: #A02020; }
[data-theme="dark"] .mk-safety { color: #F5B5AE; background: rgba(64, 37, 34, 0.6); border-color: rgba(245, 169, 160, 0.3); }
[data-theme="dark"] .mk-safety strong { color: #F5A9A0; }
.mk-therapy { padding: 8px 0; border-bottom: 1px dashed rgba(46, 42, 38, 0.12); }
.mk-therapy:last-child { border-bottom: 0; }
.mk-therapy-name { font-size: 12.5px; font-weight: 700; color: #2E2A26; }
.mk-therapy-for { font-weight: 500; color: rgba(46, 42, 38, 0.55); font-size: 11.5px; }
.mk-therapy-how { font-size: 12px; line-height: 1.45; color: rgba(46, 42, 38, 0.72); margin-top: 2px; }
.mk-panic {
  list-style: none;
  counter-reset: mk;
  border: 1.5px solid rgba(201, 168, 106, 0.4);
  background: rgba(201, 168, 106, 0.09);
  border-radius: 12px;
  padding: 12px 14px 12px 12px;
  margin-bottom: 10px;
}
.mk-panic li {
  counter-increment: mk;
  position: relative;
  padding-left: 30px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #3c3833;
  margin-bottom: 7px;
}
.mk-panic li:last-child { margin-bottom: 0; }
.mk-panic li::before {
  content: counter(mk);
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #B08D3E;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  line-height: 20px;
}
/* Tình trạng tâm lý dạng gập/mở + thang mức độ */
.mk-cond {
  border: 1.5px solid rgba(46, 42, 38, 0.12);
  border-radius: 12px;
  background: rgba(250, 246, 239, 0.5);
  margin-bottom: 8px;
  overflow: hidden;
}
.mk-cond-summary {
  cursor: pointer;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #2E2A26;
  list-style: none;
}
.mk-cond-summary::-webkit-details-marker { display: none; }
.mk-cond[open] .mk-cond-summary { border-bottom: 1px dashed rgba(46, 42, 38, 0.15); }
.mk-cond-body { border: 0; border-radius: 0; margin-bottom: 0; background: transparent; }
.mk-levels { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.mk-level {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.45;
}
.mk-level-name {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 11.5px;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.mk-level-desc { color: #3c3833; }
.mk-level-ok   { background: rgba(156, 175, 136, 0.13); }
.mk-level-ok .mk-level-name   { background: #759062; color: #fff; }
.mk-level-mid  { background: rgba(201, 168, 106, 0.15); }
.mk-level-mid .mk-level-name  { background: #B08D3E; color: #fff; }
.mk-level-high { background: rgba(248, 215, 215, 0.4); }
.mk-level-high .mk-level-name { background: #B02020; color: #fff; }

.mk-myth {
  border-left: 4px solid #9CAF88;
  background: rgba(250, 246, 239, 0.6);
  border-radius: 0 10px 10px 0;
  padding: 9px 12px;
  margin-bottom: 8px;
}
.mk-myth-x { font-size: 12.5px; font-weight: 700; color: #A83E28; margin-bottom: 3px; }
.mk-myth-v { font-size: 12.5px; line-height: 1.45; color: #4f6a3c; }
.mk-note {
  font-size: 11px;
  font-style: italic;
  color: rgba(46, 42, 38, 0.5);
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed rgba(46, 42, 38, 0.15);
}

/* ---------- Sổ nguồn dữ liệu ---------- */
.src-group {
  font-size: 12px;
  font-weight: 800;
  color: #9E4F38;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 12px 0 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(193, 105, 79, 0.18);
}
.src-group:first-child { margin-top: 0; }
.src-item { padding: 5px 0 5px 10px; border-left: 3px solid rgba(156, 175, 136, 0.5); margin-bottom: 4px; }
.src-topic { font-size: 12px; font-weight: 700; color: #2E2A26; line-height: 1.35; }
.src-source { font-size: 11.5px; color: rgba(46, 42, 38, 0.6); line-height: 1.4; }

/* ---------- Zoom controls ---------- */
.zoom-btn { color: rgba(46, 42, 38, 0.55); }
.zoom-btn:hover { background: rgba(193, 105, 79, 0.08); }
.zoom-btn.zoom-active { background: #C1694F; color: #FAF6EF; }

/* ---------- Chế độ xem: Tương tác / In ấn ---------- */
.mode-btn { color: rgba(46, 42, 38, 0.55); }
.mode-btn:hover { background: rgba(201, 168, 106, 0.12); }
.mode-btn.mode-active { background: #2E2A26; color: #FAF6EF; }

/* ═══════════ CHẾ ĐỘ TƯƠNG TÁC (web) — motion tinh tế ═══════════ */
/* Card trồi lên khi lăn vào khung nhìn */
.export-canvas.ec-interactive .ec-card {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.55s ease, transform 0.55s ease, box-shadow 0.25s ease;
}
.export-canvas.ec-interactive .ec-card.ec-reveal-in {
  opacity: 1;
  transform: translateY(0);
}
.export-canvas.ec-interactive .ec-card:hover {
  box-shadow: 0 10px 30px rgba(46, 42, 38, 0.12);
}

/* Tiêu đề card bấm được để gập/mở từng phần — đọc từng khúc, không ngợp chữ */
.export-canvas.ec-interactive .ec-card-title { cursor: pointer; user-select: none; position: relative; }
.export-canvas.ec-interactive .ec-card-title::after {
  content: "▾";
  margin-left: auto;
  font-size: 24px;
  color: #B08D3E;
  transition: transform 0.25s ease;
}
.export-canvas.ec-interactive .ec-card.ec-collapsed .ec-card-title::after { transform: rotate(-90deg); }
.export-canvas.ec-interactive .ec-card.ec-collapsed .ec-card-body { display: none; }
.export-canvas.ec-interactive .ec-card.ec-collapsed .ec-card-title { margin-bottom: 0; padding-bottom: 4px; border-bottom-color: transparent; }

/* Swatch màu phóng to nhẹ khi rê chuột */
.export-canvas.ec-interactive .ec-swatch-chip { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.export-canvas.ec-interactive .ec-swatch-chip:hover {
  transform: scale(1.14) translateY(-3px);
  box-shadow: 0 8px 18px rgba(46, 42, 38, 0.22);
}

/* Panel sáng nhẹ khi rê chuột + viên kim cương footer thở */
.export-canvas.ec-interactive .ec-card-body > .ec-list { transition: background-color 0.2s ease; }
.export-canvas.ec-interactive .ec-card-body > .ec-list:hover { background: rgba(156, 175, 136, 0.16); }
.export-canvas.ec-interactive .ec-card-body > .ec-list.ec-list-warn:hover { background: rgba(193, 105, 79, 0.11); }
.export-canvas.ec-interactive .ec-orn-gem { animation: la-gem 2.6s ease-in-out infinite; }
@keyframes la-gem {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.18); }
}

/* Tôn trọng người dùng giảm chuyển động */
@media (prefers-reduced-motion: reduce) {
  .export-canvas.ec-interactive .ec-card { opacity: 1; transform: none; transition: none; }
  .export-canvas.ec-interactive .ec-orn-gem { animation: none; }
  .export-canvas.ec-interactive .ec-swatch-chip { transition: none; }
}

/* ---------- Thẻ đối chiếu bệnh lý (độ khớp % + phác đồ) ---------- */
.ec-risk-item {
  margin: 12px 0;
  padding: 20px 24px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  border: 1.5px solid rgba(46, 42, 38, 0.12);
  border-left: 5px solid #9CAF88;
}
.ec-risk-item.ec-risk-mid  { border-left-color: #B08D3E; background: rgba(201, 168, 106, 0.07); }
.ec-risk-item.ec-risk-high { border-left-color: #B05335; background: rgba(193, 105, 79, 0.06); }
.ec-risk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ec-risk-name { font-size: 24px; font-weight: 800; color: #26221E; }
.ec-risk-badge {
  font-size: 17px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(46, 42, 38, 0.08);
  color: #4A443E;
  white-space: nowrap;
}
.ec-risk-high .ec-risk-badge { background: rgba(176, 83, 53, 0.15); color: #8F3A22; }
.ec-risk-mid .ec-risk-badge  { background: rgba(176, 141, 62, 0.16); color: #7c6224; }
.ec-risk-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(46, 42, 38, 0.08);
  overflow: hidden;
  margin-bottom: 12px;
}
.ec-risk-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #9CAF88, #759062);
}
.ec-risk-mid .ec-risk-fill  { background: linear-gradient(90deg, #C9A86A, #B08D3E); }
.ec-risk-high .ec-risk-fill { background: linear-gradient(90deg, #C1694F, #B05335); }
.ec-risk-advice { font-size: 21px; line-height: 1.55; color: #33302B; }
.ec-risk-plan-title {
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #5F7A4C;
  margin: 14px 0 6px;
}
.ec-risk-plan { list-style: none; counter-reset: rp; }
.ec-risk-plan li {
  counter-increment: rp;
  position: relative;
  padding-left: 40px;
  font-size: 20.5px;
  line-height: 1.52;
  color: #33302B;
  margin-bottom: 8px;
}
.ec-risk-plan li:last-child { margin-bottom: 0; }
.ec-risk-plan li::before {
  content: counter(rp);
  position: absolute;
  left: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #759062;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  line-height: 28px;
}

/* ---------- Lưới chỉ số nền tảng trong báo cáo ---------- */
.ec-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 6px 0 10px;
}
.ec-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 18px 12px 14px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(201, 168, 106, 0.1), rgba(255, 255, 255, 0.6));
  border: 1.5px solid rgba(201, 168, 106, 0.35);
}
.ec-stat-ico { font-size: 30px; line-height: 1; }
.ec-stat-val { font-size: 25px; font-weight: 800; color: #26221E; }
.ec-stat-lab {
  font-size: 16.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(46, 42, 38, 0.55);
}

/* ---------- Background preset thumbnail ---------- */
.bg-thumb {
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  background: none;
  border: 2.5px solid transparent;
  overflow: hidden;
  position: relative;
  transition: all 0.15s ease;
}
.bg-thumb.bg-thumb-active {
  border-color: #C1694F;
  box-shadow: 0 0 0 3px rgba(193, 105, 79, 0.25);
}
.bg-thumb span {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(46, 42, 38, 0.8);
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
   EXPORT CANVAS — khung thật 1080 × 1920 px
   ═══════════════════════════════════════════════════════════════ */
#canvas-viewport { overflow: auto; }
#canvas-scaler { transform-origin: top left; }

.export-canvas {
  width: 1080px;
  min-height: 1920px;   /* cao tối thiểu 1 màn hình; tự giãn khi nội dung dài để KHÔNG mất thông tin */
  height: auto;
  position: relative;
  overflow: hidden;
  background: #FAF6EF;
  font-family: "Be Vietnam Pro", sans-serif;
  color: #2E2A26;
  box-shadow: 0 20px 60px rgba(46, 42, 38, 0.3);
  border-radius: 4px;
}

.export-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background: linear-gradient(160deg, #FAF6EF 0%, #F1E9DB 55%, #EADFC9 100%);
}

/* ---------- Khung viền trang trí cao cấp ---------- */
.ec-frame { display: none; }
.export-canvas.ec-framed .ec-frame {
  display: block;
  position: absolute;
  inset: 26px;
  z-index: 3;
  border: 2px solid rgba(201, 168, 106, 0.75);
  border-radius: 10px;
  pointer-events: none;
}
.ec-corner {
  position: absolute;
  width: 64px;
  height: 64px;
}
.ec-corner-tl { top: -12px; left: -12px; }
.ec-corner-tr { top: -12px; right: -12px; transform: rotate(90deg); }
.ec-corner-br { bottom: -12px; right: -12px; transform: rotate(180deg); }
.ec-corner-bl { bottom: -12px; left: -12px; transform: rotate(270deg); }

.export-content {
  position: relative;
  z-index: 2;
  min-height: 1920px;   /* footer đẩy xuống đáy khi báo cáo ngắn; giãn theo nội dung khi dài */
  box-sizing: border-box;
  padding: 60px 52px 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ---------- Header — thang chữ tinh gọn, dễ đọc ---------- */
.ec-header { text-align: center; padding: 6px 0 4px; }
.ec-brand {
  font-size: 20px;
  letter-spacing: 0.42em;
  font-weight: 700;
  color: #B08D3E;
  margin-bottom: 16px;
}
.ec-title {
  font-family: "Playfair Display", serif;
  font-size: 50px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0.015em;
  color: #26221E;
}
.ec-divider {
  width: 190px;
  height: 2.5px;
  margin: 22px auto 20px;
  background: linear-gradient(90deg, transparent, #C1694F, transparent);
}
.ec-client {
  font-family: "Playfair Display", serif;
  font-size: 40px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.02em;
  color: #B05335;
}
.ec-client-meta {
  margin-top: 12px;
  font-size: 22px;
  font-weight: 600;
  color: rgba(46, 42, 38, 0.72);
  letter-spacing: 0.08em;
}
.ec-report-date {
  display: inline-block;
  margin-top: 14px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #8a6d2f;
  background: rgba(201, 168, 106, 0.16);
  border: 1.5px solid rgba(201, 168, 106, 0.45);
  border-radius: 999px;
  padding: 6px 22px;
}
.ec-report-date:empty { display: none; }

/* ---------- Card khối nội dung ---------- */
.ec-card {
  background: rgba(255, 255, 255, 0.93);
  border: 1.5px solid rgba(201, 168, 106, 0.45);
  border-radius: 24px;
  padding: 34px 42px 38px;
  flex-shrink: 0;
  box-shadow: 0 4px 18px rgba(46, 42, 38, 0.05);
}
/* Tiêu đề card: dải mảnh thanh lịch, icon trong chip vàng tròn */
.ec-card-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: "Playfair Display", serif;
  font-size: 26px;
  font-weight: 700;
  color: #8F4128;
  letter-spacing: 0.04em;
  padding: 0 0 16px;
  margin: 0 0 26px;
  border-bottom: 2px solid rgba(201, 168, 106, 0.4);
}
.ec-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(150deg, rgba(201, 168, 106, 0.22), rgba(193, 105, 79, 0.12));
  border: 1.5px solid rgba(201, 168, 106, 0.5);
  color: #B08D3E;
  font-size: 25px;
  line-height: 1;
  margin-right: 0;
}
.ec-card-body { font-size: 23px; line-height: 1.6; color: #33302B; }
.ec-empty {
  display: block;
  text-align: center;
  padding: 20px 0 12px;
  color: rgba(46, 42, 38, 0.4);
  font-style: italic;
  font-size: 22px;
}

/* Nhãn nhóm nhỏ = tiêu đề của một panel bên dưới */
.ec-label {
  font-size: 19px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #5F7A4C;
  margin: 28px 0 0;
  display: flex;
  align-items: center;
  gap: 11px;
}
.ec-label::before {
  content: "";
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  border-radius: 4px;
  background: #9CAF88;
}
.ec-label::after {
  content: "";
  flex: 1;
  height: 1.5px;
  background: rgba(117, 144, 98, 0.28);
}
.ec-label:first-child { margin-top: 0; }
.ec-label.ec-label-warn { color: #A83E28; }
.ec-label.ec-label-warn::before { background: #C1694F; }
.ec-label.ec-label-warn::after { background: rgba(177, 74, 52, 0.28); }

/* Danh sách gạch đầu dòng */
.ec-list { list-style: none; }
.ec-list li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 11px;
  font-size: 22.5px;
  line-height: 1.58;
  color: #33302B;
}
.ec-list li:last-child { margin-bottom: 0; }
.ec-list li::before {
  content: "•";
  position: absolute;
  left: 9px;
  color: #C1694F;
  font-weight: 700;
}
.ec-list li strong { color: #26221E; }
.ec-mech { display: block; margin-top: 3px; font-style: italic; color: rgba(46, 42, 38, 0.62); font-size: 0.92em; line-height: 1.4; }
.ec-list.ec-list-warn li::before { content: "✕"; color: #A83E28; font-size: 19px; top: 3px; }

/* ── Mỗi mục cấp cao trong card thành một PANEL màu ──
   Chia nhỏ nội dung theo khối, giảm cảm giác chữ chằn chịt.
   Chỉ áp cho danh sách trực tiếp trong body (list lồng trong illust/mental giữ nguyên). */
.ec-card-body > .ec-list {
  margin-top: 12px;
  padding: 20px 26px;
  border-radius: 14px;
  background: rgba(156, 175, 136, 0.09);
  border: 1.5px solid rgba(156, 175, 136, 0.28);
  border-left: 5px solid #9CAF88;
}
.ec-card-body > .ec-list.ec-list-warn {
  background: rgba(193, 105, 79, 0.06);
  border-color: rgba(193, 105, 79, 0.24);
  border-left-color: #C1694F;
}
.ec-card-body > .ec-swatch-grid {
  margin-top: 11px;
  padding: 20px 22px;
  border-radius: 16px;
  background: rgba(201, 168, 106, 0.09);
  border: 1.5px solid rgba(201, 168, 106, 0.32);
}
/* Câu "Tổng quan / Khuyến nghị / ghi chú" nổi bật như một callout */
.ec-card-body > .ec-inline-note {
  padding: 16px 22px;
  border-radius: 14px;
  background: rgba(250, 246, 239, 0.75);
  border: 1.5px solid rgba(201, 168, 106, 0.3);
}

/* Badge BMI */
.ec-bmi-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}
.ec-bmi-badge {
  background: #759062;
  color: #FAF6EF;
  font-weight: 700;
  font-size: 24px;
  padding: 10px 26px;
  border-radius: 999px;
  white-space: nowrap;
}
.ec-bmi-badge.ec-bmi-warn { background: #B05335; }
.ec-bmi-note { font-size: 21.5px; line-height: 1.5; color: #3C3833; }

/* ---------- Color swatches ---------- */
.ec-swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 6px;
}
.ec-swatch { text-align: center; width: 106px; }
.ec-swatch-chip {
  width: 106px;
  height: 62px;
  border-radius: 14px;
  border: 2px solid rgba(46, 42, 38, 0.14);
  margin-bottom: 6px;
}
/* ── Trích màu từ ảnh (atelier beauty) ── */
.sw-badge, .ec-tag-ref {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 1px 7px; border-radius: 999px; background: #EDE4D3; color: #8A6A3E; vertical-align: middle; margin-left: 4px;
}
.sw-upload {
  display: inline-block; cursor: pointer; padding: 0.55rem 1.1rem; border-radius: 0.75rem;
  background: #B5654B; color: #fff; font-weight: 600; font-size: 0.85rem;
}
.sw-upload:hover { background: #9E5540; }
.sw-empty {
  font-size: 0.8rem; color: rgba(46, 42, 38, 0.6); padding: 1.1rem; text-align: center;
  border: 1px dashed #E7DECF; border-radius: 0.75rem;
}
.sw-canvas { max-width: 100%; border-radius: 0.75rem; border: 1px solid #E7DECF; cursor: crosshair; display: block; }
.sw-modes { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sw-mode {
  padding: 0.4rem 0.85rem; border-radius: 0.6rem; border: 1px solid rgba(46, 42, 38, 0.18);
  background: #FAF6EF; font-size: 0.82rem; font-weight: 600; color: #2E2A26; cursor: pointer;
}
.sw-mode.sw-mode-on { background: #6E8B6E; color: #fff; border-color: #6E8B6E; }
.sw-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.sw-item { display: flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.5rem; border-radius: 0.55rem; background: #FAF6EF; border: 1px solid #E7DECF; }
.sw-chip { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(46, 42, 38, 0.18); }
.sw-part { font-size: 0.72rem; font-weight: 700; color: #8A6A3E; }
.sw-hex { font-size: 0.74rem; font-variant-numeric: tabular-nums; color: rgba(46, 42, 38, 0.7); }
.sw-del { border: 0; background: transparent; color: rgba(46, 42, 38, 0.5); cursor: pointer; font-size: 0.8rem; line-height: 1; padding: 2px; }
.sw-del:hover { color: #B5654B; }
.sw-hintbox { font-size: 0.78rem; color: rgba(46, 42, 38, 0.75); background: #F3EEE4; border-radius: 0.6rem; padding: 0.5rem 0.7rem; }
.sw-clear { border: 0; background: transparent; text-decoration: underline; color: rgba(46, 42, 38, 0.7); font-size: 0.8rem; font-weight: 600; cursor: pointer; padding: 0.3rem 0.2rem; }
.sw-clear:hover { color: #B5654B; }
[data-theme="dark"] .sw-badge, [data-theme="dark"] .ec-tag-ref { background: #4A3B2F; color: #E4C892; }
[data-theme="dark"] .sw-empty { color: #C9BEAC; border-color: #4A3B2F; }
[data-theme="dark"] .sw-canvas { border-color: #4A3B2F; }
[data-theme="dark"] .sw-mode { background: #241C15; color: #F4EFE7; border-color: #4A3B2F; }
[data-theme="dark"] .sw-mode.sw-mode-on { background: #6E8B6E; border-color: #6E8B6E; }
[data-theme="dark"] .sw-item { background: #241C15; border-color: #4A3B2F; }
[data-theme="dark"] .sw-part { color: #E4C892; }
[data-theme="dark"] .sw-hex { color: #C9BEAC; }
[data-theme="dark"] .sw-hintbox { background: #2A2119; color: #C9BEAC; }
[data-theme="dark"] .sw-clear { color: #C9BEAC; }

/* ── Thẻ công thức mặc đồ (assets-outfit.js) ── */
.of-card { margin: 6px 0 4px; }
.of-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.of-item { width: 92px; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 6px; border-radius: 12px; background: #FBF8F2; border: 1px solid #E7DECF; }
.of-icon { width: 62px; height: 74px; display: block; }
.of-name { font-size: 11.5px; line-height: 1.3; margin-top: 4px; font-weight: 600; color: #3c3833; }
.of-item.of-tone-light { background: #FBF3DE; border-color: #E7C36B; }
.of-item.of-tone-accent { background: #F7E7E0; border-color: #DDA890; }
.of-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 11px; }
.of-key { display: inline-flex; align-items: center; gap: 5px; color: #6b6459; }
.of-key::before { content: ""; width: 11px; height: 11px; border-radius: 3px; border: 1px solid #2E2A26; }
.of-key.of-tone-light::before { background: #E7C36B; }
.of-key.of-tone-dark::before { background: #3C4048; }
.of-key.of-tone-accent::before { background: #C1694F; }
[data-theme="dark"] .of-item { background: #241C15; border-color: #4A3B2F; }
[data-theme="dark"] .of-item.of-tone-light { background: #3a3220; border-color: #8a7333; }
[data-theme="dark"] .of-item.of-tone-accent { background: #3a2620; border-color: #8a5a48; }
[data-theme="dark"] .of-name { color: #EBE3D6; }
[data-theme="dark"] .of-key { color: #B4A995; }
/* Cặp Nên/Tránh — hai cột đối chiếu */
.odd-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.odd-col { border-radius: 12px; padding: 10px; }
.odd-do { background: rgba(156, 175, 136, 0.13); border: 1.5px solid rgba(79, 106, 60, 0.35); }
.odd-dont { background: rgba(248, 215, 215, 0.28); border: 1.5px solid rgba(176, 32, 32, 0.3); }
.odd-head { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; color: #4f6a3c; margin-bottom: 7px; }
.odd-head-dont { color: #b02020; }
.odd-items { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.odd-items .of-item { margin: 0; }
.odd-x { position: relative; }
.odd-x .of-icon { opacity: 0.55; filter: grayscale(0.5); }
.odd-x::before { content: '✖'; position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-size: 30px; line-height: 1; color: rgba(176, 32, 32, 0.7); pointer-events: none; z-index: 1; }
@media (max-width: 480px) { .odd-items { grid-template-columns: 1fr; } }
[data-theme="dark"] .odd-do { background: rgba(74, 84, 62, 0.3); border-color: rgba(156, 175, 136, 0.35); }
[data-theme="dark"] .odd-dont { background: rgba(64, 37, 34, 0.42); border-color: rgba(245, 169, 160, 0.32); }
[data-theme="dark"] .odd-head { color: #AFC79A; }
[data-theme="dark"] .odd-head-dont { color: #F5A9A0; }
[data-theme="dark"] .odd-x::before { color: rgba(245, 169, 160, 0.75); }
/* Gợi ý mùa màu cá nhân */
.ss-empty { font-size: 12px; color: #6B655D; font-style: italic; padding: 6px 2px; }
.ss-head { font-size: 12.5px; font-weight: 800; color: #8F4128; margin: 8px 0 4px; }
.ss-reason { font-size: 12px; color: #6B655D; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.ss-tag { font-style: normal; background: rgba(201, 168, 106, 0.18); border: 1px solid rgba(139, 109, 47, 0.3); border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 600; color: #6B5B2F; }
.ss-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 6px; }
.ss-chip { font-size: 12.5px; font-weight: 700; padding: 7px 13px; border-radius: 999px; border: 1.5px solid rgba(143, 65, 40, 0.4); background: rgba(193, 105, 79, 0.09); color: #8F4128; cursor: pointer; transition: all 0.15s ease; }
.ss-chip:hover { background: rgba(193, 105, 79, 0.18); }
.ss-chip.ss-on { background: #8F4128; color: #FBF6EC; border-color: #8F4128; }
.ss-note { font-size: 11.5px; line-height: 1.55; color: #6B655D; }
[data-theme="dark"] .ss-empty, [data-theme="dark"] .ss-note, [data-theme="dark"] .ss-reason { color: #A59A86; }
[data-theme="dark"] .ss-head { color: #E0A188; }
[data-theme="dark"] .ss-tag { background: rgba(74, 59, 47, 0.5); border-color: rgba(228, 200, 146, 0.3); color: #E4C892; }
[data-theme="dark"] .ss-chip { background: rgba(224, 161, 136, 0.1); border-color: rgba(224, 161, 136, 0.4); color: #E0A188; }
[data-theme="dark"] .ss-chip.ss-on { background: #E0A188; color: #241C15; border-color: #E0A188; }
/* Bảng màu trang điểm theo mùa — nhãn con nhỏ hơn nhãn mục */
.ec-mku-label { font-size: 11px; opacity: 0.85; margin-top: 6px; }
/* Soi đĩa ăn từ ảnh (monan-ai) */
.mna-badge { font-size: 10px; font-weight: 800; letter-spacing: 0.05em; vertical-align: middle; margin-left: 6px; padding: 3px 8px; border-radius: 999px; background: rgba(107, 91, 149, 0.14); color: #5C4E85; }
.mna-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 9px 14px; border-radius: 11px; border: 1.5px dashed rgba(46, 42, 38, 0.3); color: #2E2A26; cursor: pointer; background: rgba(242, 231, 208, 0.4); }
.mna-pick:hover { border-color: #C1694F; color: #8F4128; }
.mna-preview { max-width: 100%; max-height: 260px; border-radius: 12px; margin: 10px 0 4px; border: 1px solid rgba(46, 42, 38, 0.15); }
.mna-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 9px 0; border-bottom: 1px dashed rgba(46, 42, 38, 0.14); }
.mna-info { font-size: 13.5px; font-weight: 700; color: #2E2A26; flex: 1; min-width: 140px; }
.mna-kcal { font-size: 12px; color: #6B655D; }
.mna-add { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; border: 1.5px solid rgba(117, 144, 98, 0.5); background: rgba(156, 175, 136, 0.15); color: #4f6a3c; cursor: pointer; }
.mna-add:hover { background: rgba(156, 175, 136, 0.3); }
.mna-add:disabled { opacity: 0.65; cursor: default; }
.mna-miss .mna-info { color: #8a6d2f; font-weight: 600; }
.mna-empty { font-size: 12.5px; font-style: italic; color: #6B655D; padding: 8px 0; }
.mna-foot { font-size: 11.5px; line-height: 1.55; color: #6B655D; background: rgba(201, 168, 106, 0.12); border: 1px dashed rgba(139, 109, 47, 0.3); border-radius: 10px; padding: 8px 11px; margin-top: 10px; }
[data-theme="dark"] .mna-badge { background: rgba(151, 134, 196, 0.22); color: #B8A9E0; }
[data-theme="dark"] .mna-pick { background: rgba(74, 59, 47, 0.35); border-color: rgba(214, 205, 191, 0.3); color: #D6CDBF; }
[data-theme="dark"] .mna-pick:hover { border-color: #E0A188; color: #E0A188; }
[data-theme="dark"] .mna-preview { border-color: rgba(214, 205, 191, 0.2); }
[data-theme="dark"] .mna-row { border-bottom-color: rgba(214, 205, 191, 0.14); }
[data-theme="dark"] .mna-info { color: #D6CDBF; }
[data-theme="dark"] .mna-kcal, [data-theme="dark"] .mna-empty { color: #A59A86; }
[data-theme="dark"] .mna-add { background: rgba(156, 175, 136, 0.16); border-color: rgba(156, 175, 136, 0.4); color: #AFC79A; }
[data-theme="dark"] .mna-miss .mna-info { color: #E4C892; }
[data-theme="dark"] .mna-foot { color: #A59A86; background: rgba(74, 59, 47, 0.4); border-color: rgba(228, 200, 146, 0.3); }
/* ── Khối Dược thư (duocThu) trong thẻ thuốc ── */
.th-duocthu { border-left: 3px solid #5B8AA6; background: rgba(91, 138, 166, 0.06); border-radius: 10px; padding: 12px 14px; }
.th-duocthu .mbti-block-title { color: #3E6B84; }
.th-duocthu b { color: #2E5468; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.th-thaiky b { color: #9A6A1E; }
[data-theme="dark"] .th-duocthu { border-left-color: #6FA3C0; background: rgba(91, 138, 166, 0.12); }
[data-theme="dark"] .th-duocthu .mbti-block-title { color: #9CC3D8; }
[data-theme="dark"] .th-duocthu b { color: #A9CEE0; }

/* So sánh 2 thuốc (Module 6) — GIỮ 2 cột kể cả mobile để đọc ngang được */
.th-cmp .mbti-two-col { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 0; }
.th-cmp-heads { margin-bottom: 14px; }
.th-cmp-field { margin-bottom: 14px; }
.th-cmp-field .mbti-block-title { margin-bottom: 6px; }
.th-cmp-cell { background: #FBF6EE; border: 1px solid #EADFC9; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.6; color: rgba(46, 42, 38, 0.85); overflow-wrap: anywhere; }
.th-cmp-cell .mbti-list { margin: 0; }
.th-cmp-head { text-align: center; background: #fff; border-left: 3px solid #C1694F; }
.th-cmp-name { font-family: "Playfair Display", serif; font-weight: 700; font-size: 15px; color: #2E2A26; margin-bottom: 6px; }
.th-cmp-nhom { display: inline-block; margin-top: 6px; font-size: 11px; color: rgba(46, 42, 38, 0.55); }
[data-theme="dark"] .th-cmp-cell { background: #241C15; border-color: #4A3B2F; color: #D4CFC9; }
[data-theme="dark"] .th-cmp-head { background: #2A211A; border-left-color: #E8A68D; }
[data-theme="dark"] .th-cmp-name { color: #EBE3D6; }
[data-theme="dark"] .th-cmp-nhom { color: rgba(233, 227, 214, 0.5); }
[data-theme="dark"] .th-thaiky b { color: #E4C892; }
/* ── Trang Thuật ngữ Y khoa (glossary) — academic/encyclopedia ── */
.gl-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.gl-chip { font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: rgba(201, 168, 106, 0.14); color: #6B5B2F; text-decoration: none; border: 1px solid rgba(139, 109, 47, 0.22); transition: all 0.13s ease; }
.gl-chip:hover { background: rgba(201, 168, 106, 0.28); }
.gl-cat { margin-bottom: 22px; scroll-margin-top: 90px; }
.gl-cat-head { font-family: "Playfair Display", serif; font-size: 1.25rem; font-weight: 700; color: #8F4128; padding-bottom: 6px; margin-bottom: 12px; border-bottom: 2px solid rgba(143, 65, 40, 0.18); }
.gl-grid { display: grid; gap: 12px; }
.gl-card { background: #fff; border: 1px solid #EADFC9; border-left: 3px solid #C9A86A; border-radius: 12px; padding: 14px 16px; scroll-margin-top: 90px; }
.gl-term { font-family: "Playfair Display", serif; font-size: 1.05rem; font-weight: 700; color: #2E2A26; margin-bottom: 4px; }
.gl-short { font-size: 13.5px; font-weight: 600; color: #8F4128; line-height: 1.55; margin-bottom: 6px; }
.gl-long { font-size: 13.5px; line-height: 1.7; color: rgba(46, 42, 38, 0.82); margin-bottom: 8px; }
.gl-src { font-size: 11.5px; color: rgba(46, 42, 38, 0.55); }
.gl-src span { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 10.5px; }
.la-hit.gl-card { box-shadow: 0 0 0 3px rgba(201, 105, 79, 0.4); }
/* Deep citation: tên cơ quan trong dòng Nguồn → link kiểm chứng (Module 5A) */
.gl-cite { color: #8F4128; font-weight: 600; text-decoration: none; border-bottom: 1px dotted rgba(143, 65, 40, 0.5); }
.gl-cite:hover, .gl-cite:focus-visible { border-bottom-style: solid; outline: none; }
[data-theme="dark"] .gl-cite { color: #E0A188; border-bottom-color: rgba(224, 161, 136, 0.5); }

/* PubMed — lớp nghiên cứu gốc THAM KHẢO (Module 5B), tông teal tách biệt */
.pm-panel { margin: 26px 0 10px; padding: 18px 20px; border: 1px dashed rgba(62, 124, 116, 0.5); border-radius: 16px; background: rgba(62, 124, 116, 0.05); }
.pm-title { font-family: "Playfair Display", serif; font-size: 1.15rem; font-weight: 700; color: #2E5468; margin-bottom: 8px; }
.pm-caveat { font-size: 12.5px; line-height: 1.6; color: rgba(46, 42, 38, 0.72); background: rgba(178, 58, 72, 0.06); border-left: 3px solid rgba(178, 58, 72, 0.5); border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; }
.pm-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.pm-form .nutri-input { flex: 1; min-width: 200px; }
.pm-btn { flex: none; padding: 10px 18px; border-radius: 12px; background: #3E7C74; color: #fff; font-weight: 700; font-size: 13.5px; border: none; cursor: pointer; transition: background 0.15s ease; }
.pm-btn:hover { background: #336A63; }
.pm-btn:disabled { opacity: 0.55; cursor: default; }
.pm-results { margin-top: 12px; display: grid; gap: 10px; }
.pm-msg { font-size: 13px; color: rgba(46, 42, 38, 0.65); font-style: italic; padding: 6px 0; }
.pm-item { border: 1px solid #EADFC9; border-left: 3px solid #3E7C74; border-radius: 10px; padding: 11px 13px; background: #fff; }
.pm-item-title { display: inline-block; font-size: 13.5px; font-weight: 600; color: #2E5468; text-decoration: none; line-height: 1.5; }
.pm-item-title:hover, .pm-item-title:focus-visible { text-decoration: underline; outline: none; }
.pm-item-meta { font-size: 11.5px; color: rgba(46, 42, 38, 0.55); margin-top: 4px; }
[data-theme="dark"] .pm-panel { border-color: rgba(127, 190, 178, 0.4); background: rgba(127, 190, 178, 0.06); }
[data-theme="dark"] .pm-title { color: #9CC3D8; }
[data-theme="dark"] .pm-caveat { color: rgba(233, 227, 214, 0.72); background: rgba(232, 130, 143, 0.08); border-left-color: rgba(232, 130, 143, 0.5); }
[data-theme="dark"] .pm-item { background: #2A211A; border-color: #4A3B2F; border-left-color: #7FBEB2; }
[data-theme="dark"] .pm-item-title { color: #9CC3D8; }
[data-theme="dark"] .pm-item-meta { color: rgba(233, 227, 214, 0.5); }
[data-theme="dark"] .pm-msg { color: rgba(233, 227, 214, 0.6); }

/* Bảng tra chỉ số xét nghiệm (Module 7) */
.lr-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.lr-tab { font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 999px; background: rgba(62, 124, 116, 0.1); color: #2E5468; border: 1px solid rgba(62, 124, 116, 0.28); cursor: pointer; transition: background 0.13s ease; }
.lr-tab:hover { background: rgba(62, 124, 116, 0.2); }
.lr-tab.on { background: #3E7C74; color: #fff; border-color: #3E7C74; }
.lr-tool-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.lr-name { font-family: "Playfair Display", serif; font-size: 1.15rem; font-weight: 700; color: #2E2A26; }
.lr-units { display: inline-flex; border: 1px solid #DCCFB8; border-radius: 999px; overflow: hidden; }
.lr-unit-btn { font-size: 12px; font-weight: 700; padding: 5px 12px; background: transparent; color: rgba(46, 42, 38, 0.6); border: none; cursor: pointer; }
.lr-unit-btn.on { background: #C9A86A; color: #2E2A26; }
.lr-toggles { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.lr-input-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.lr-bp-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.lr-bp-field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: rgba(46, 42, 38, 0.6); }
.lr-bp-field .lr-num { max-width: 110px; }
.lr-bp-sep { font-size: 24px; font-weight: 700; color: rgba(46, 42, 38, 0.35); padding-bottom: 6px; }
.lr-bp-unit { font-size: 13px; font-weight: 600; color: rgba(46, 42, 38, 0.55); padding-bottom: 10px; }
[data-theme="dark"] .lr-bp-field { color: rgba(233, 227, 214, 0.6); }
[data-theme="dark"] .lr-bp-unit, [data-theme="dark"] .lr-bp-sep { color: rgba(233, 227, 214, 0.45); }
.lr-num { max-width: 160px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lr-range { width: 100%; accent-color: #3E7C74; }
.lr-hint { font-size: 13px; color: rgba(46, 42, 38, 0.55); font-style: italic; padding: 6px 0; }
.lr-verdict { border: 1px solid; border-radius: 12px; padding: 14px 16px; margin-top: 4px; }
.lr-val { font-size: 20px; font-weight: 800; color: #2E2A26; font-variant-numeric: tabular-nums; }
.lr-unit { font-size: 13px; font-weight: 600; color: rgba(46, 42, 38, 0.55); }
.lr-label { font-family: "Playfair Display", serif; font-size: 1.1rem; font-weight: 700; margin: 2px 0 12px; }
.lr-bar { position: relative; display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.lr-seg { display: block; height: 100%; }
.lr-marker { position: absolute; top: -4px; width: 3px; height: 20px; background: #2E2A26; border-radius: 2px; transform: translateX(-50%); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8); }
.lr-bands { display: grid; gap: 4px; margin-bottom: 10px; }
.lr-band-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(46, 42, 38, 0.6); padding: 4px 8px; border-radius: 8px; }
.lr-band-row.on { background: rgba(201, 168, 106, 0.16); color: #2E2A26; font-weight: 700; }
.lr-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lr-band-name { flex: 1; }
.lr-band-rng { font-variant-numeric: tabular-nums; color: rgba(46, 42, 38, 0.5); }
.lr-note { font-size: 12.5px; line-height: 1.6; color: rgba(46, 42, 38, 0.7); background: rgba(178, 58, 72, 0.06); border-left: 3px solid rgba(178, 58, 72, 0.4); border-radius: 8px; padding: 8px 11px; margin: 10px 0; }
.lr-src { font-size: 11.5px; color: rgba(46, 42, 38, 0.55); }
.lr-src span { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 10.5px; }
.lr-unitnote { color: rgba(46, 42, 38, 0.6); }
[data-theme="dark"] .lr-tab { background: rgba(127, 190, 178, 0.12); color: #9CC3D8; border-color: rgba(127, 190, 178, 0.3); }
[data-theme="dark"] .lr-tab.on { background: #3E7C74; color: #fff; }
[data-theme="dark"] .lr-name, [data-theme="dark"] .lr-val { color: #EBE3D6; }
[data-theme="dark"] .lr-units { border-color: #4A3B2F; }
[data-theme="dark"] .lr-unit-btn { color: rgba(233, 227, 214, 0.55); }
[data-theme="dark"] .lr-unit-btn.on { background: #C9A86A; color: #2A211A; }
[data-theme="dark"] .lr-band-row { color: rgba(233, 227, 214, 0.6); }
[data-theme="dark"] .lr-band-row.on { background: rgba(201, 168, 106, 0.2); color: #EBE3D6; }
[data-theme="dark"] .lr-band-rng { color: rgba(233, 227, 214, 0.45); }
[data-theme="dark"] .lr-note { color: rgba(233, 227, 214, 0.72); background: rgba(232, 130, 143, 0.08); border-left-color: rgba(232, 130, 143, 0.5); }
[data-theme="dark"] .lr-src, [data-theme="dark"] .lr-unitnote { color: rgba(233, 227, 214, 0.55); }
[data-theme="dark"] .lr-marker { background: #EBE3D6; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5); }
[data-theme="dark"] .gl-chip { background: rgba(74, 59, 47, 0.5); color: #E4C892; border-color: rgba(228, 200, 146, 0.28); }
[data-theme="dark"] .gl-chip:hover { background: rgba(74, 59, 47, 0.8); }
[data-theme="dark"] .gl-cat-head { color: #E0A188; border-bottom-color: rgba(224, 161, 136, 0.3); }
[data-theme="dark"] .gl-card { background: #2A211A; border-color: #4A3B2F; border-left-color: #C9A86A; }
[data-theme="dark"] .gl-term { color: #EBE3D6; }
[data-theme="dark"] .gl-short { color: #E0A188; }
[data-theme="dark"] .gl-long { color: #C9BEAC; }
[data-theme="dark"] .gl-src { color: #A59A86; }

/* Cross-link "Liên quan" (Module 3) */
.gl-see { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.gl-see-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(46, 42, 38, 0.5); margin-right: 2px; }
.gl-see-chip { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(143, 65, 40, 0.08); color: #8F4128; text-decoration: none; border: 1px solid rgba(143, 65, 40, 0.2); transition: background 0.13s ease; cursor: pointer; }
.gl-see-chip:hover, .gl-see-chip:focus-visible { background: rgba(143, 65, 40, 0.18); outline: none; }
[data-theme="dark"] .gl-see-lbl { color: rgba(233, 227, 214, 0.5); }
[data-theme="dark"] .gl-see-chip { background: rgba(224, 161, 136, 0.12); color: #E0A188; border-color: rgba(224, 161, 136, 0.3); }
[data-theme="dark"] .gl-see-chip:hover, [data-theme="dark"] .gl-see-chip:focus-visible { background: rgba(224, 161, 136, 0.24); }

/* Popover định nghĩa thuật ngữ — la-tip (Module 3). Bong bóng tối, đọc rõ ở cả 2 theme. */
.la-tip { position: fixed; z-index: 60; max-width: 300px; background: #2E2A26; color: #F5EFE3; border-radius: 12px; padding: 11px 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28); opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity 0.14s ease, transform 0.14s ease; }
.la-tip.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.la-tip-t { font-family: "Playfair Display", serif; font-weight: 700; font-size: 13.5px; margin: 0 0 3px; color: #F1D9A8; }
.la-tip-b { font-size: 12.5px; line-height: 1.55; margin: 0 0 7px; color: rgba(245, 239, 227, 0.92); }
.la-tip-a { display: inline-block; font-size: 11.5px; font-weight: 700; color: #E8B98B; text-decoration: none; }
.la-tip-a:hover, .la-tip-a:focus-visible { text-decoration: underline; outline: none; }
[data-theme="dark"] .la-tip { background: #17130F; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
@media (prefers-reduced-motion: reduce) { .la-tip, .la-tip.show { transition: none; transform: none; } }
/* Tủ đồ capsule trực quan */
.cw-wrap { margin: 10px 0 12px; }
.cw-group { margin-bottom: 10px; }
.cw-cat { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 800; color: #8a6d2f; margin-bottom: 5px; }
.cw-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cw-items .of-item { margin: 0; }
.cw-math { font-size: 12px; line-height: 1.6; color: #2E2A26; background: rgba(201, 168, 106, 0.13); border: 1px dashed rgba(139, 109, 47, 0.35); border-radius: 11px; padding: 9px 12px; margin-top: 4px; }
[data-theme="dark"] .cw-cat { color: #E4C892; }
[data-theme="dark"] .cw-math { color: #D6CDBF; background: rgba(74, 59, 47, 0.4); border-color: rgba(228, 200, 146, 0.3); }
/* Một tuần mặc thử từ tủ capsule */
.wk-wrap { margin: 4px 0 12px; }
.wk-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 7px 0; border-bottom: 1px dashed rgba(46, 42, 38, 0.14); }
.wk-day { flex-shrink: 0; width: 72px; font-size: 11.5px; font-weight: 800; color: #8F4128; }
.wk-items { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 200px; }
.wk-item { display: inline-flex; align-items: center; gap: 3px; }
.wk-item .of-icon { width: 26px; height: 31px; }
.wk-name { font-size: 11px; color: #2E2A26; }
.wk-plus { font-size: 11px; color: #8a6d2f; font-weight: 700; }
.wk-mood { flex-shrink: 0; font-size: 10.5px; font-style: italic; color: #6B655D; }
[data-theme="dark"] .wk-row { border-bottom-color: rgba(214, 205, 191, 0.14); }
[data-theme="dark"] .wk-day { color: #E0A188; }
[data-theme="dark"] .wk-name { color: #D6CDBF; }
[data-theme="dark"] .wk-plus { color: #E4C892; }
[data-theme="dark"] .wk-mood { color: #A59A86; }
/* Kế hoạch an toàn cá nhân (Stanley-Brown) */
.msp-card { background: rgba(156, 175, 136, 0.09); border: 1.5px solid rgba(79, 106, 60, 0.3); border-radius: 13px; padding: 13px 14px; margin-bottom: 14px; }
.msp-intro { font-size: 12.5px; line-height: 1.6; color: #2E2A26; margin-bottom: 11px; }
.msp-steps { list-style: none; counter-reset: msp; margin: 0; }
.msp-steps > li { counter-increment: msp; position: relative; padding: 0 0 12px 34px; }
.msp-steps > li::before { content: counter(msp); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 999px; background: #4f6a3c; color: #FBF6EC; font-size: 12.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.msp-name { font-size: 13px; font-weight: 700; color: #2E2A26; margin-bottom: 2px; }
.msp-hint { font-size: 12px; line-height: 1.55; color: #6B655D; margin-bottom: 5px; }
.msp-write { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: #8a6d2f; margin-bottom: 2px; }
.msp-line { border-bottom: 1.5px dotted rgba(46, 42, 38, 0.35); height: 17px; }
.msp-note { font-size: 12.5px; line-height: 1.55; color: #8a2020; background: rgba(248, 215, 215, 0.4); border-radius: 9px; padding: 8px 11px; margin: 4px 0 8px; }
[data-theme="dark"] .msp-card { background: rgba(74, 84, 62, 0.25); border-color: rgba(156, 175, 136, 0.3); }
[data-theme="dark"] .msp-intro, [data-theme="dark"] .msp-name { color: #D6CDBF; }
[data-theme="dark"] .msp-hint { color: #A59A86; }
[data-theme="dark"] .msp-steps > li::before { background: #AFC79A; color: #241C15; }
[data-theme="dark"] .msp-write { color: #E4C892; }
[data-theme="dark"] .msp-line { border-bottom-color: rgba(214, 205, 191, 0.35); }
[data-theme="dark"] .msp-note { color: #F5B5AE; background: rgba(64, 37, 34, 0.55); }

.ec-swatch.ec-swatch-worst .ec-swatch-chip { position: relative; }
.ec-swatch.ec-swatch-worst .ec-swatch-chip::after {
  content: "✕";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  font-size: 26px;
  font-weight: 700;
}
.ec-swatch-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: #4A443E;
}
.ec-season-desc {
  font-size: 22px;
  line-height: 1.56;
  color: #33302B;
  margin-bottom: 8px;
}
.ec-inline-note { font-size: 21.5px; line-height: 1.55; color: #33302B; }

/* ---------- Hàng minh họa trong báo cáo (hình + text) ---------- */
.ec-illust-row {
  display: flex;
  gap: 26px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.ec-illust {
  flex-shrink: 0;
  background: linear-gradient(160deg, #FCF8F1, #F1E7D5);
  border: 2px solid rgba(201, 168, 106, 0.5);
  border-radius: 18px;
  padding: 14px 12px 10px;
  text-align: center;
}
/* Chiều cao đặt tường minh theo tỉ lệ viewBox để html2canvas render đúng (không bị cao 0px) */
.ec-illust-body svg { width: 176px; height: 334px; }
.ec-illust-face svg { width: 176px; height: 220px; }
.ec-illust-outfit svg { width: 250px; height: 117px; }
.ec-illust-cap {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  font-weight: 800;
  color: #8F4128;
}
.ec-illust-text { flex: 1; min-width: 0; }

/* Dòng nguồn tham khảo trong từng thẻ */
.ec-source-note {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(46, 42, 38, 0.25);
  font-size: 17px;
  font-style: italic;
  color: rgba(46, 42, 38, 0.55);
}

/* ---------- Cẩm nang vi chất (tab Sức khỏe) ---------- */
.nutrient-item { padding: 9px 0; border-bottom: 1px dashed rgba(46, 42, 38, 0.12); }
.nutrient-item:last-child { border-bottom: 0; }
.nutrient-name { font-size: 13px; font-weight: 700; color: #2E2A26; }
.nutrient-role { font-weight: 500; color: rgba(46, 42, 38, 0.6); font-size: 11.5px; }
.nutrient-line { font-size: 12px; line-height: 1.4; color: rgba(46, 42, 38, 0.78); margin-top: 2px; }
.nutrient-line strong { color: #5F7A4C; }
.nutrient-note { font-size: 11.5px; font-style: italic; color: rgba(46, 42, 38, 0.55); margin-top: 2px; }

/* ---------- Thẻ Kết luận tổng thể (nổi bật) trong báo cáo ---------- */
.ec-summary-card {
  background: linear-gradient(160deg, rgba(201,168,106,0.16), rgba(255,255,255,0.9));
  border: 2px solid rgba(201, 168, 106, 0.75);
}
.ec-summary-card .ec-card-title {
  color: #9C7A2F;
  background: linear-gradient(100deg, rgba(201,168,106,0.24), rgba(201,168,106,0.07));
  border-color: rgba(201, 168, 106, 0.5);
}

/* ---------- Thẻ Tinh thần trong báo cáo ---------- */
.ec-mental-item {
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(156, 175, 136, 0.12);
  border: 1.5px solid rgba(156, 175, 136, 0.45);
  margin-bottom: 14px;
}
.ec-mental-item.ec-mental-urgent {
  background: rgba(248, 215, 215, 0.4);
  border-color: rgba(176, 32, 32, 0.4);
}
.ec-mental-head {
  font-size: 23px;
  font-weight: 800;
  color: #5F7A4C;
  margin-bottom: 7px;
}
.ec-mental-urgent .ec-mental-head { color: #A83E28; }
.ec-mental-score {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  background: #759062;
  padding: 3px 15px;
  border-radius: 999px;
  margin-left: 8px;
  white-space: nowrap;
}
.ec-mental-urgent .ec-mental-score { background: #B05335; }
.ec-mental-safety {
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(248, 215, 215, 0.55);
  border: 2px solid rgba(176, 32, 32, 0.5);
  margin-bottom: 14px;
}
.ec-mental-safety-title {
  font-size: 24px;
  font-weight: 800;
  color: #A02020;
  margin-bottom: 6px;
}
.export-canvas.ec-compact .ec-mental-head { font-size: 22px; }
.export-canvas.ec-compact .ec-mental-item { padding: 12px 16px; }
.export-canvas.ec-compact-2 .ec-mental-head { font-size: 18px; }
.export-canvas.ec-compact-2 .ec-mental-score { font-size: 16px; padding: 2px 11px; }
.export-canvas.ec-compact-2 .ec-mental-item { padding: 9px 13px; margin-bottom: 8px; }
.export-canvas.ec-compact-2 .ec-mental-safety-title { font-size: 18px; }

/* ---------- Thẻ MBTI trong báo cáo ---------- */
.ec-mbti-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 28px;
  border-radius: 18px;
  border: 2px solid;
  margin-bottom: 18px;
}
.ec-mbti-code {
  font-family: "Playfair Display", serif;
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
  flex-shrink: 0;
}
.ec-mbti-nick {
  font-family: "Playfair Display", serif;
  font-size: 28px;
  font-weight: 700;
  font-style: italic;
  color: #26221E;
  margin-bottom: 4px;
}
.ec-mbti-group { font-size: 19px; font-weight: 600; color: rgba(46, 42, 38, 0.6); }

/* Tiêu đề phụ trong card Beauty (tên tình trạng da / khuôn mặt) */
.ec-subhead {
  font-size: 23px;
  font-weight: 800;
  color: #8F4128;
  margin: 16px 0 5px;
}
.ec-subhead:first-child { margin-top: 0; }
.ec-mini-note {
  font-size: 20px;
  line-height: 1.52;
  color: #4A443E;
  font-style: italic;
  margin-bottom: 8px;
}

/* ---------- Footer ---------- */
.ec-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1.5px solid rgba(46, 42, 38, 0.2);
}
.ec-footer-ornament {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.ec-orn-line {
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 106, 0.8));
}
.ec-orn-line:last-child {
  background: linear-gradient(90deg, rgba(201, 168, 106, 0.8), transparent);
}
.ec-orn-gem { color: #B08D3E; font-size: 22px; line-height: 1; }
.ec-seal {
  text-align: center;
  font-family: "Playfair Display", serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.4em;
  color: #9C7A2F;
  margin-bottom: 12px;
}
.ec-seal-sub {
  display: block;
  margin-top: 3px;
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 15px;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.08em;
  color: rgba(46, 42, 38, 0.55);
}
.ec-sources {
  font-size: 16.5px;
  line-height: 1.45;
  text-align: center;
  color: rgba(46, 42, 38, 0.62);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.ec-disclaimer {
  font-size: 18px;
  line-height: 1.5;
  text-align: center;
  color: rgba(46, 42, 38, 0.62);
  font-style: italic;
}

/* ---------- Chế độ thu gọn cấp 1 (nội dung dài) ---------- */
.export-canvas.ec-compact .export-content { gap: 18px; padding-top: 44px; }
.export-canvas.ec-compact .ec-title { font-size: 52px; }
.export-canvas.ec-compact .ec-client { font-size: 40px; }
.export-canvas.ec-compact .ec-card { padding: 24px 32px; border-radius: 20px; }
.export-canvas.ec-compact .ec-card-body,
.export-canvas.ec-compact .ec-list li { font-size: 21.5px; }
.export-canvas.ec-compact .ec-season-desc,
.export-canvas.ec-compact .ec-inline-note,
.export-canvas.ec-compact .ec-bmi-note { font-size: 21px; }
.export-canvas.ec-compact .ec-card-title { font-size: 28px; margin-bottom: 12px; padding-bottom: 10px; }
.export-canvas.ec-compact .ec-swatch { width: 90px; }
.export-canvas.ec-compact .ec-swatch-chip { width: 90px; height: 52px; }
.export-canvas.ec-compact .ec-swatch-name { font-size: 15px; }
.export-canvas.ec-compact .ec-label { font-size: 19.5px; margin-top: 12px; }
.export-canvas.ec-compact .ec-subhead { font-size: 22.5px; }
.export-canvas.ec-compact .ec-mini-note { font-size: 19px; }
.export-canvas.ec-compact .ec-list li { margin-bottom: 4px; }
.export-canvas.ec-compact .ec-illust-body svg { width: 150px; height: 285px; }
.export-canvas.ec-compact .ec-illust-face svg { width: 150px; height: 188px; }
.export-canvas.ec-compact .ec-illust-outfit svg { width: 210px; height: 98px; }
.export-canvas.ec-compact .ec-illust-cap { font-size: 18px; }
.export-canvas.ec-compact .ec-illust-row { gap: 20px; }
.export-canvas.ec-compact .ec-source-note { font-size: 15px; margin-top: 12px; }

/* ---------- Chế độ thu gọn cấp 2 (nội dung rất dài) ---------- */
.export-canvas.ec-compact-2 .export-content { gap: 14px; padding: 36px 48px 28px; }
.export-canvas.ec-compact-2 .ec-brand { font-size: 19px; margin-bottom: 8px; }
.export-canvas.ec-compact-2 .ec-title { font-size: 42px; }
.export-canvas.ec-compact-2 .ec-divider { margin: 12px auto 10px; }
.export-canvas.ec-compact-2 .ec-client { font-size: 33px; }
.export-canvas.ec-compact-2 .ec-client-meta { font-size: 20px; margin-top: 6px; }
.export-canvas.ec-compact-2 .ec-card { padding: 18px 26px; border-radius: 18px; }
.export-canvas.ec-compact-2 .ec-card-title { font-size: 24px; margin-bottom: 8px; padding-bottom: 7px; }
.export-canvas.ec-compact-2 .ec-card-body,
.export-canvas.ec-compact-2 .ec-list li { font-size: 18px; line-height: 1.38; }
.export-canvas.ec-compact-2 .ec-season-desc,
.export-canvas.ec-compact-2 .ec-inline-note,
.export-canvas.ec-compact-2 .ec-bmi-note { font-size: 17.5px; }
.export-canvas.ec-compact-2 .ec-bmi-badge { font-size: 19px; padding: 7px 18px; }
.export-canvas.ec-compact-2 .ec-label { font-size: 16px; margin: 9px 0 5px; }
.export-canvas.ec-compact-2 .ec-subhead { font-size: 19px; margin-top: 9px; }
.export-canvas.ec-compact-2 .ec-mini-note { font-size: 16px; }
.export-canvas.ec-compact-2 .ec-list li { margin-bottom: 3px; padding-left: 24px; }
.export-canvas.ec-compact-2 .ec-swatch { width: 72px; }
.export-canvas.ec-compact-2 .ec-swatch-chip { width: 72px; height: 42px; border-radius: 10px; }
.export-canvas.ec-compact-2 .ec-swatch-name { font-size: 12.5px; }
.export-canvas.ec-compact-2 .ec-swatch-grid { gap: 9px; }
.export-canvas.ec-compact-2 .ec-sources { font-size: 13px; }
.export-canvas.ec-compact-2 .ec-disclaimer { font-size: 14px; }
.export-canvas.ec-compact-2 .ec-illust-body svg { width: 118px; height: 224px; }
.export-canvas.ec-compact-2 .ec-illust-face svg { width: 118px; height: 148px; }
.export-canvas.ec-compact-2 .ec-illust-outfit svg { width: 170px; height: 80px; }
.export-canvas.ec-compact-2 .ec-illust { padding: 8px 8px 6px; border-radius: 14px; }
.export-canvas.ec-compact-2 .ec-illust-cap { font-size: 14px; margin-top: 4px; }
.export-canvas.ec-compact-2 .ec-illust-row { gap: 14px; margin-bottom: 6px; }
.export-canvas.ec-compact-2 .ec-source-note { font-size: 12.5px; margin-top: 8px; padding-top: 7px; }

/* ═══════════ MBTI WIZARD 4 PHẦN + NGHỀ NGHIỆP CHI TIẾT ═══════════ */
.mbti-intro-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mbti-stat-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #9E4F38;
  background: rgba(193, 105, 79, 0.1);
  border: 1px solid rgba(193, 105, 79, 0.3);
  border-radius: 999px;
  padding: 5px 13px;
}
.mbti-howto { margin-top: 12px; display: grid; gap: 8px; }
.mbti-howto li {
  position: relative;
  padding: 10px 14px 10px 38px;
  background: rgba(156, 175, 136, 0.1);
  border: 1px solid rgba(117, 144, 98, 0.22);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(46, 42, 38, 0.85);
}
.mbti-howto li::before {
  content: "✓";
  position: absolute;
  left: 13px;
  top: 9px;
  font-weight: 800;
  color: #759062;
}

/* Bản đồ 4 phần */
.mbti-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.mbti-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 14px;
  border: 1.5px solid rgba(46, 42, 38, 0.12);
  background: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}
.mbti-step:hover { border-color: rgba(193, 105, 79, 0.45); }
.mbti-step-no {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 800;
  background: rgba(46, 42, 38, 0.08);
  color: rgba(46, 42, 38, 0.55);
}
.mbti-step-name { font-size: 10.5px; font-weight: 700; line-height: 1.25; color: rgba(46, 42, 38, 0.65); }
.mbti-step-count { font-size: 10px; font-weight: 700; color: rgba(46, 42, 38, 0.4); }
.mbti-step.is-now {
  border-color: #C1694F;
  background: rgba(193, 105, 79, 0.08);
  box-shadow: 0 4px 14px rgba(193, 105, 79, 0.18);
}
.mbti-step.is-now .mbti-step-no { background: #C1694F; color: #fff; }
.mbti-step.is-now .mbti-step-name { color: #9E4F38; }
.mbti-step.is-done { border-color: rgba(117, 144, 98, 0.5); }
.mbti-step.is-done .mbti-step-no { background: rgba(117, 144, 98, 0.18); color: #5D7350; }
@media (max-width: 560px) {
  .mbti-step-name { display: none; }
  .mbti-step { padding: 8px 4px; }
}

/* Thẻ mở đầu mỗi phần */
.mbti-part-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(150deg, rgba(193, 105, 79, 0.1), rgba(255, 255, 255, 0.85));
  border: 1.5px solid rgba(193, 105, 79, 0.3);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.mbti-part-icon { font-size: 30px; line-height: 1; margin-top: 2px; }
.mbti-part-kicker {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9E4F38;
  margin-bottom: 3px;
}
.mbti-part-title { font-family: "Playfair Display", serif; font-size: 21px; font-weight: 700; color: #2E2A26; }
.mbti-part-desc { font-size: 13px; line-height: 1.65; color: rgba(46, 42, 38, 0.65); margin-top: 4px; }

/* Điều hướng giữa các phần */
.mbti-quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.mbti-nav-btn {
  padding: 13px 22px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid transparent;
}
.mbti-nav-main {
  background: #C1694F;
  color: #fff;
  box-shadow: 0 8px 20px rgba(193, 105, 79, 0.3);
}
.mbti-nav-main:hover { background: #9E4F38; transform: translateY(-1px); }
.mbti-nav-ghost {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(46, 42, 38, 0.15);
  color: rgba(46, 42, 38, 0.7);
}
.mbti-nav-ghost:hover { border-color: rgba(46, 42, 38, 0.35); }

/* Nghề nghiệp chi tiết theo ngành */
.mbti-career-group {
  background: rgba(250, 246, 239, 0.7);
  border: 1px solid rgba(201, 168, 106, 0.35);
  border-left: 4px solid #C9A86A;
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 10px;
}
.mbti-career-group:last-of-type { margin-bottom: 0; }
.mbti-career-field {
  font-size: 13.5px;
  font-weight: 800;
  color: #8A6A2F;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.mbti-career-why {
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(46, 42, 38, 0.65);
  font-style: italic;
  margin-bottom: 9px;
}

/* ═══════════ MODULE DINH DƯỠNG + NHÂN SỐ HỌC ═══════════ */
.nutri-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(46, 42, 38, 0.55);
  margin-bottom: 7px;
}
.nutri-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(46, 42, 38, 0.15);
  background: rgba(250, 246, 239, 0.5);
  font-size: 14.5px;
  font-weight: 600;
  color: #2E2A26;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nutri-input:focus {
  outline: none;
  border-color: #C1694F;
  box-shadow: 0 0 0 3px rgba(193, 105, 79, 0.15);
}
.nutri-radio { display: block; cursor: pointer; flex: 1; }
.nutri-radio-face {
  display: block;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(46, 42, 38, 0.15);
  background: rgba(250, 246, 239, 0.5);
  font-size: 13.5px;
  line-height: 1.45;
  transition: all 0.15s ease;
}
.nutri-radio-face:hover { border-color: rgba(117, 144, 98, 0.6); }
.nutri-radio input:checked + .nutri-radio-face {
  background: rgba(156, 175, 136, 0.2);
  border-color: #759062;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(117, 144, 98, 0.18);
}
.nutri-radio-row { display: flex; flex-direction: column; gap: 2px; }
.nutri-radio-row small { font-size: 11.5px; color: rgba(46, 42, 38, 0.55); font-weight: 400; }

/* Khối chỉ số năng lượng */
.nutri-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .nutri-stat-row { grid-template-columns: 1fr; } }
.nutri-stat {
  background: rgba(250, 246, 239, 0.8);
  border: 1px solid rgba(46, 42, 38, 0.1);
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
}
.nutri-stat b { display: block; font-family: "Playfair Display", serif; font-size: 26px; color: #2E2A26; }
.nutri-stat span { display: block; font-size: 11px; line-height: 1.4; color: rgba(46, 42, 38, 0.55); margin-top: 4px; font-weight: 600; }
.nutri-stat-hl { border-color: #759062; background: rgba(156, 175, 136, 0.16); }
.nutri-stat-hl b { color: #5D7350; }
.nutri-warn {
  margin-top: 10px;
  padding: 10px 13px;
  border-radius: 12px;
  background: rgba(193, 105, 79, 0.1);
  border: 1px solid rgba(193, 105, 79, 0.35);
  font-size: 12.5px;
  line-height: 1.6;
  color: #7E3F2D;
}

/* Thanh BMI */
.nutri-bmi-bar { position: relative; display: flex; height: 12px; border-radius: 999px; overflow: visible; }
.nutri-bmi-seg { flex: 1; }
.nutri-bmi-seg:first-child { border-radius: 999px 0 0 999px; }
.nutri-bmi-seg:last-child { border-radius: 0 999px 999px 0; }
.nutri-bmi-dot {
  position: absolute;
  top: 50%;
  width: 20px; height: 20px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #fff;
  border: 4px solid #2E2A26;
  box-shadow: 0 2px 8px rgba(46, 42, 38, 0.35);
}

/* Bảng macro + vi chất */
.nutri-macro { display: grid; gap: 8px; }
.nutri-macro-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  background: rgba(250, 246, 239, 0.8);
  border: 1px solid rgba(46, 42, 38, 0.1);
  border-radius: 12px;
  padding: 11px 14px;
}
.nutri-macro-name { font-size: 13.5px; font-weight: 700; color: #2E2A26; }
.nutri-macro-num { font-size: 15px; font-weight: 800; color: #5D7350; text-align: center; }
.nutri-macro-pct { font-size: 11.5px; color: rgba(46, 42, 38, 0.5); text-align: right; font-weight: 600; }
.nutri-micro-table { display: grid; gap: 6px; }
.nutri-micro-row {
  display: grid;
  grid-template-columns: 92px 96px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 9px 12px;
  background: rgba(250, 246, 239, 0.7);
  border: 1px solid rgba(46, 42, 38, 0.08);
  border-radius: 10px;
}
@media (max-width: 560px) { .nutri-micro-row { grid-template-columns: 80px 1fr; } .nutri-micro-food { grid-column: 1 / -1; } }
.nutri-micro-name { font-size: 12.5px; font-weight: 800; color: #2E2A26; }
.nutri-micro-val { font-size: 12.5px; font-weight: 800; color: #8A6A2F; }
.nutri-micro-food { font-size: 12px; line-height: 1.55; color: rgba(46, 42, 38, 0.65); }
.nutri-micro-food i { color: rgba(46, 42, 38, 0.45); }
.nutri-sources li { font-size: 11.5px !important; }

/* Nhân số học — bản đồ số + biểu đồ ngày sinh */
.num-sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.num-sum-card {
  background: rgba(250, 246, 239, 0.85);
  border: 1px solid rgba(201, 168, 106, 0.4);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}
.num-sum-label { display: block; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(46, 42, 38, 0.5); }
.num-sum-value { display: block; font-family: "Playfair Display", serif; font-size: 30px; font-weight: 800; color: #B08D3E; line-height: 1.15; margin-top: 2px; }
.num-sum-hint { display: block; font-size: 10.5px; color: rgba(46, 42, 38, 0.45); margin-top: 2px; }
.num-grid-wrap { display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: start; }
@media (max-width: 560px) { .num-grid-wrap { grid-template-columns: 1fr; } }
.num-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: 190px;
}
.num-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1.5px dashed rgba(46, 42, 38, 0.18);
  background: rgba(255, 255, 255, 0.6);
  font-family: "Playfair Display", serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #8A6A2F;
}
.num-cell-on {
  border: 1.5px solid rgba(201, 168, 106, 0.6);
  background: rgba(201, 168, 106, 0.14);
}

/* ═══════════ RESPONSIVE HARDENING — chống tràn ngang mọi thiết bị ═══════════ */
html, body { max-width: 100%; overflow-x: clip; }
@supports not (overflow: clip) { html, body { overflow-x: hidden; } }
/* Ảnh/SVG không bao giờ rộng hơn khung chứa (trừ vùng xuất ảnh 1080px đã có bộ scale riêng) */
img, video { max-width: 100%; height: auto; }
.mbti-chips, .mbti-intro-chips { min-width: 0; }
.mbti-chip, .mbti-stat-chip { max-width: 100%; overflow-wrap: break-word; }

/* Điện thoại nhỏ (≤560px): chữ hero kết quả và bảng biểu co lại vừa khung */
@media (max-width: 560px) {
  .mbti-result { padding: 4px; }
  .mbti-hero { padding: 28px 16px 24px; }
  .mbti-hero-code { font-size: 46px; }
  .mbti-hero-nick { font-size: 21px; }
  .mbti-hero-group { font-size: 11.5px; padding: 5px 12px; }
  .mbti-block { padding-left: 14px; padding-right: 14px; }

  /* Bảng macro: gọn 2 cột, dòng % xuống hàng riêng */
  .nutri-macro-row { grid-template-columns: 1fr auto; }
  .nutri-macro-pct { grid-column: 1 / -1; text-align: left; }

  /* Điều hướng wizard: nút giãn hết bề ngang cho dễ bấm */
  .mbti-quiz-nav { flex-wrap: wrap; }
  .mbti-quiz-nav .mbti-nav-btn { flex: 1 1 100%; text-align: center; }

  /* Thẻ phần: icon nhỏ lại */
  .mbti-part-card { padding: 14px 16px; gap: 10px; }
  .mbti-part-icon { font-size: 24px; }
  .mbti-part-title { font-size: 18px; }

  /* Biểu đồ ngày sinh căn giữa */
  .num-grid { margin: 0 auto; }

  /* Thẻ đăng nhập Atelier: bớt đệm để vừa màn 320-390px */
  .login-card { padding: 30px 22px !important; }
}

/* Tablet dọc (561-820px): kết quả 2 cột về 1 cột sớm hơn cho dễ đọc */
@media (max-width: 820px) {
  .mbti-two-col { grid-template-columns: 1fr; }
}

/* ═══════════ ICON LƠ LỬNG TRANG TRÍ + LỊCH TUẦN ═══════════ */
/* Icon đáng yêu trôi nhẹ ở các mảng trống — chỉ hiện trên màn rộng,
   mờ nhẹ, không bắt chuột, không gây rối nội dung chính */
.float-ico {
  position: fixed;
  z-index: 1;
  font-size: 26px;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  filter: saturate(0.85);
  animation: float-in 1.2s ease 0.8s forwards, float-drift 7s ease-in-out 2s infinite alternate;
}
@keyframes float-in { to { opacity: 0.4; } }
@keyframes float-drift {
  from { transform: translateY(0) rotate(-4deg); }
  to   { transform: translateY(-16px) rotate(5deg); }
}
.float-1 { top: 16%; left: 5%; animation-duration: 1.2s, 7s; }
.float-2 { top: 42%; left: 3.2%; font-size: 21px; animation-delay: 1.1s, 2.6s; animation-duration: 1.2s, 8.5s; }
.float-3 { top: 70%; left: 6%; font-size: 23px; animation-delay: 1.4s, 3.1s; animation-duration: 1.2s, 6.4s; }
.float-4 { top: 20%; right: 5%; animation-delay: 0.95s, 2.2s; animation-duration: 1.2s, 7.8s; }
.float-5 { top: 48%; right: 3.4%; font-size: 20px; animation-delay: 1.25s, 2.9s; animation-duration: 1.2s, 9s; }
.float-6 { top: 74%; right: 5.6%; font-size: 24px; animation-delay: 1.55s, 3.4s; animation-duration: 1.2s, 6.8s; }
/* Màn hẹp không có mảng trống hai bên -> ẩn để không đè nội dung */
@media (max-width: 1180px) { .float-ico { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .float-ico { animation: none; opacity: 0.3; }
}

/* Lịch tuần mẫu (module Giấc ngủ & Vận động) */
.well-week { display: grid; gap: 6px; }
.well-day {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  background: rgba(250, 246, 239, 0.75);
  border: 1px solid rgba(46, 42, 38, 0.08);
  border-radius: 10px;
  padding: 9px 12px;
}
.well-day-tag {
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
  color: #fff;
  background: #9CAF88;
  border-radius: 8px;
  padding: 4px 0;
}
.well-day:last-child .well-day-tag { background: #C9A86A; }
.well-day-body { font-size: 13px; line-height: 1.55; color: rgba(46, 42, 38, 0.8); }

/* ═══════════ NÂNG CẤP ICON LƠ LỬNG LÊN MOTION 3D ═══════════ */
/* Ghi đè float-drift phẳng bằng chuyển động 3 chiều có phối cảnh */
@keyframes float-3d {
  0%   { transform: perspective(650px) translateY(0)     rotateY(-20deg) rotateX(7deg)  rotateZ(-4deg) scale(1); }
  50%  { transform: perspective(650px) translateY(-13px) rotateY(16deg)  rotateX(-9deg) rotateZ(3deg)  scale(1.09); }
  100% { transform: perspective(650px) translateY(-22px) rotateY(-12deg) rotateX(5deg)  rotateZ(6deg)  scale(0.97); }
}
.float-ico {
  animation-name: float-in, float-3d;
  text-shadow: 0 16px 24px rgba(45, 40, 37, 0.2);
}
@keyframes float-in { to { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .float-ico { animation: none; opacity: 0.3; } }

/* ═══════════ ICON HOA & SAO — BỐ CỤC RẢI RÁC ═══════════ */
/* Trang con hiện 3 icon (slot 1, 4, 6) — vị trí lệch nhau tự nhiên */
.float-1 { top: 17%; left: 6%;    font-size: 25px; }
.float-2 { top: 44%; left: 3%;    font-size: 19px; }
.float-3 { top: 70%; left: 7.5%;  font-size: 23px; }
.float-4 { top: 24%; right: 4.5%; font-size: 20px; }
.float-5 { top: 52%; right: 2.8%; font-size: 17px; }
.float-6 { top: 76%; right: 8%;   font-size: 26px; }

/* ═══════════ MODULE KHÁM ĐỊNH KỲ + ĐIỀU HƯỚNG CHÉO ═══════════ */
.chk-src {
  float: right;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3E7C74;
  background: rgba(62, 124, 116, 0.1);
  border: 1px solid rgba(62, 124, 116, 0.3);
  border-radius: 999px;
  padding: 2px 9px;
  margin-left: 8px;
}
.chk-freq {
  font-size: 12.5px;
  font-weight: 700;
  color: #5D7350;
  margin: 3px 0 5px;
}

/* Điều hướng chéo hệ sinh thái cuối mỗi trang */
.xnav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}
.xnav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1.5px solid rgba(46, 42, 38, 0.1);
  font-size: 13px;
  font-weight: 700;
  color: rgba(46, 42, 38, 0.75);
  transition: all 0.25s ease;
}
.xnav-item:hover {
  border-color: rgba(193, 105, 79, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(46, 42, 38, 0.1);
  color: #9E4F38;
}
.xnav-ico { font-size: 18px; }

/* ═══════════ GAME THẬT HAY LẦM TƯỞNG ═══════════ */
.qz-mode {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(46, 42, 38, 0.13);
  background: rgba(250, 246, 239, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}
.qz-mode:hover {
  border-color: #C1694F;
  background: rgba(193, 105, 79, 0.07);
  transform: translateX(4px);
}
.qz-mode-ico { font-size: 24px; }
.qz-mode-body { display: flex; flex-direction: column; gap: 1px; }
.qz-mode-body b { font-size: 14px; color: #2E2A26; }
.qz-mode-body small { font-size: 12px; color: rgba(46, 42, 38, 0.55); }

.qz-hud { display: flex; gap: 8px; margin-bottom: 10px; }
.qz-hud-item {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  font-weight: 800;
  padding: 8px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(46, 42, 38, 0.1);
  color: rgba(46, 42, 38, 0.75);
}
.qz-hud-streak { color: #9E4F38; }

.qz-question {
  background: #fff;
  border: 2px solid #F1E9DB;
  border-radius: 20px;
  padding: 26px 24px;
  animation: lux-up 0.5s cubic-bezier(0.25, 1, 0.5, 1) both;
}
.qz-question.qz-right { border-color: rgba(117, 144, 98, 0.65); background: rgba(156, 175, 136, 0.07); }
.qz-question.qz-wrong { border-color: rgba(193, 105, 79, 0.6); background: rgba(193, 105, 79, 0.05); }
.qz-cat {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8A6A2F;
  background: rgba(201, 168, 106, 0.15);
  border: 1px solid rgba(201, 168, 106, 0.4);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 14px;
}
.qz-claim {
  font-family: "Playfair Display", serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.45;
  color: #2E2A26;
  margin-bottom: 20px;
  text-wrap: balance;
}
.qz-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .qz-answers { grid-template-columns: 1fr; } }
.qz-btn {
  padding: 15px 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}
.qz-btn-true { background: rgba(156, 175, 136, 0.18); border-color: rgba(117, 144, 98, 0.45); color: #4C6240; }
.qz-btn-true:hover { background: rgba(156, 175, 136, 0.32); transform: translateY(-2px); }
.qz-btn-false { background: rgba(193, 105, 79, 0.1); border-color: rgba(193, 105, 79, 0.4); color: #9E4F38; }
.qz-btn-false:hover { background: rgba(193, 105, 79, 0.2); transform: translateY(-2px); }
.qz-btn-next {
  width: 100%;
  margin-top: 18px;
  background: #C1694F;
  color: #fff;
  box-shadow: 0 8px 20px rgba(193, 105, 79, 0.3);
}
.qz-btn-next:hover { background: #9E4F38; transform: translateY(-1px); }
.qz-verdict { font-size: 14.5px; line-height: 1.6; color: #2E2A26; margin-bottom: 10px; }
.qz-explain { font-size: 13.5px; line-height: 1.7; color: rgba(46, 42, 38, 0.75); margin-bottom: 10px; }
.qz-source { font-size: 12px; font-weight: 700; color: #8A6A2F; }

/* ═══════════ THƯ VIỆN NGUỒN ═══════════ */
.lib-group { margin-bottom: 22px; }
.lib-group-title {
  font-family: "Playfair Display", serif;
  font-size: 19px;
  font-weight: 700;
  color: #2E2A26;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(201, 168, 106, 0.35);
}
.lib-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.lib-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 15px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(46, 42, 38, 0.1);
  transition: all 0.25s ease;
}
.lib-card:hover {
  border-color: rgba(193, 105, 79, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(46, 42, 38, 0.12);
}
.lib-card-name { font-size: 14px; font-weight: 800; color: #2E2A26; }
.lib-card-ext { color: #C1694F; font-weight: 800; }
.lib-card-desc { font-size: 12.5px; line-height: 1.6; color: rgba(46, 42, 38, 0.65); }
.lib-card-host { font-size: 11px; font-weight: 700; color: #8A6A2F; }

/* ═══════════ MODULE SƠ CỨU ═══════════ */
.fa-emergency {
  background: linear-gradient(140deg, #B23A48, #8E2C38);
  color: #fff;
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.65;
  margin-bottom: 18px;
  box-shadow: 0 10px 26px rgba(178, 58, 72, 0.3);
}
.fa-card {
  background: #fff;
  border: 1.5px solid #F1E9DB;
  border-radius: 16px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.fa-card[open] { border-color: rgba(193, 105, 79, 0.45); box-shadow: 0 10px 26px rgba(46, 42, 38, 0.08); }
.fa-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.fa-summary::-webkit-details-marker { display: none; }
.fa-summary:hover { background: rgba(250, 246, 239, 0.7); }
.fa-ico { font-size: 24px; }
.fa-title { flex: 1; font-size: 15px; font-weight: 800; color: #2E2A26; }
.fa-chev { color: rgba(46, 42, 38, 0.4); transition: transform 0.25s ease; }
.fa-card[open] .fa-chev { transform: rotate(180deg); }
.fa-body { padding: 4px 18px 18px; }
.fa-sec { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; margin: 12px 0 7px; }
.fa-sec-do { color: #5D7350; }
.fa-sec-dont { color: #B23A48; }
.fa-steps { counter-reset: fa; display: grid; gap: 6px; }
.fa-steps li {
  counter-increment: fa;
  position: relative;
  padding: 9px 12px 9px 38px;
  background: rgba(156, 175, 136, 0.08);
  border: 1px solid rgba(117, 144, 98, 0.2);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.65;
}
.fa-steps li::before {
  content: counter(fa);
  position: absolute;
  left: 10px; top: 9px;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: #759062;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.fa-donts { display: grid; gap: 6px; }
.fa-donts li {
  padding: 9px 12px 9px 34px;
  position: relative;
  background: rgba(178, 58, 72, 0.06);
  border: 1px solid rgba(178, 58, 72, 0.22);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.65;
}
.fa-donts li::before { content: "✕"; position: absolute; left: 12px; top: 8px; color: #B23A48; font-weight: 800; }
.fa-call {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(201, 168, 106, 0.13);
  border: 1.5px dashed rgba(178, 58, 72, 0.45);
  font-size: 12.5px;
  line-height: 1.65;
}
.fa-src { margin-top: 8px; font-size: 11.5px; font-weight: 700; color: #8A6A2F; }

/* Banner "kết quả lần trước" (localStorage) */
.last-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(201, 168, 106, 0.12);
  border: 1.5px solid rgba(201, 168, 106, 0.45);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
}
.last-banner b { color: #8A6A2F; }
/* Neo từ chip "biết bạn" trang chủ: nhảy đúng thẻ, chừa chỗ cho header dính */
#ts-card:target, #tc-card:target, #qw-card:target, #bp-card:target, #sl-card:target, #bk-card:target { scroll-margin-top: 84px; }
.last-banner-note { flex-basis: 100%; width: 100%; margin: 2px 0 0; font-size: 12px; line-height: 1.5; color: rgba(46, 42, 38, 0.62); }
.last-banner-note b { color: #8A6A2F; }
[data-theme="dark"] .last-banner-note { color: rgba(255, 255, 255, 0.58); }
.last-banner-btns { display: flex; gap: 8px; margin-left: auto; }
.last-btn {
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s ease;
}
.last-btn-view { background: #C9A86A; color: #fff; }
.last-btn-view:hover { background: #B08D3E; }
.last-btn-clear { background: rgba(255,255,255,0.8); border-color: rgba(46,42,38,0.18); color: rgba(46,42,38,0.65); }
.last-btn-clear:hover { border-color: rgba(46,42,38,0.4); }

/* ═══════════ MỘT NGÀY HOÀN HẢO — TIMELINE + THƯỚC ĐO ═══════════ */
.bp-meter {
  background: #fff;
  border: 1.5px solid #F1E9DB;
  border-radius: 16px;
  padding: 16px 18px;
}
.bp-meter-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: rgba(46,42,38,0.7); margin-bottom: 8px; }
.bp-meter-head b { color: #8A6A2F; }
.bp-meter-bar { height: 10px; border-radius: 999px; background: rgba(46,42,38,0.08); overflow: hidden; }
.bp-meter-bar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #C9A86A, #B0762E); transition: width 0.6s cubic-bezier(0.25,1,0.5,1); }
.bp-missing { display: grid; gap: 7px; margin-top: 12px; }
.bp-missing-item {
  display: block;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(193, 105, 79, 0.06);
  border: 1.5px dashed rgba(193, 105, 79, 0.4);
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(46,42,38,0.75);
  transition: all 0.2s ease;
}
.bp-missing-item:hover { background: rgba(193, 105, 79, 0.12); transform: translateX(4px); }
.bp-missing-item b { color: #9E4F38; }

.bp-timeline { display: grid; gap: 0; }
.bp-row {
  display: grid;
  grid-template-columns: 88px 26px 1fr;
  gap: 6px;
  align-items: start;
}
.bp-time {
  font-size: 13px;
  font-weight: 800;
  color: #8A6A2F;
  text-align: right;
  padding-top: 12px;
  white-space: nowrap;
}
.bp-dotcol { position: relative; display: flex; justify-content: center; height: 100%; padding-top: 15px; }
.bp-dotcol::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: rgba(201, 168, 106, 0.35);
}
.bp-row:first-child .bp-dotcol::before { top: 15px; }
.bp-row:last-child .bp-dotcol::before { bottom: calc(100% - 15px); }
.bp-dot {
  position: relative;
  z-index: 1;
  width: 12px; height: 12px;
  border-radius: 999px;
  background: #C9A86A;
  border: 2.5px solid #FAF6EF;
  box-shadow: 0 0 0 2px rgba(201, 168, 106, 0.5);
}
.bp-body {
  background: rgba(250, 246, 239, 0.75);
  border: 1px solid rgba(46, 42, 38, 0.08);
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 8px;
}
.bp-title { font-size: 13.5px; font-weight: 800; color: #2E2A26; margin-bottom: 3px; }
.bp-desc { font-size: 12.5px; line-height: 1.65; color: rgba(46, 42, 38, 0.7); }
.bp-desc b { color: #5D7350; }
.bp-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9E4F38;
  background: rgba(193, 105, 79, 0.12);
  border: 1px solid rgba(193, 105, 79, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: 1px;
}
@media (max-width: 560px) {
  .bp-row { grid-template-columns: 52px 20px 1fr; }
  .bp-time { font-size: 11.5px; }
}

/* ═══════════ GÓC HÍT THỞ — VÒNG DẪN NHỊP ═══════════ */
.br-stage {
  background: #fff;
  border: 1.5px solid #F1E9DB;
  border-radius: 22px;
  padding: 28px 22px;
  text-align: center;
}
.br-tech-name { font-family: "Playfair Display", serif; font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.br-circle-wrap {
  position: relative;
  width: min(280px, 70vw);
  aspect-ratio: 1;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.br-circle {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(156, 175, 136, 0.45), rgba(156, 175, 136, 0.16) 60%, rgba(156, 175, 136, 0.05));
  border: 2px solid rgba(117, 144, 98, 0.45);
  transform: scale(0.45);
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
  will-change: transform;
}
.br-center { position: relative; z-index: 1; }
.br-phase { font-family: "Playfair Display", serif; font-size: 24px; font-weight: 700; color: #2E2A26; }
.br-count { font-size: 40px; font-weight: 800; color: #5D7350; line-height: 1.2; }
.br-stats { display: flex; gap: 8px; justify-content: center; }
.br-stats .qz-hud-item { flex: 0 1 180px; }
@media (prefers-reduced-motion: reduce) { .br-circle { transition: none !important; } }

/* ═══════════ VƯỜN THÓI QUEN ═══════════ */
.hb-card {
  background: #fff;
  border: 1.5px solid #F1E9DB;
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.hb-head { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; }
.hb-plant { font-size: 34px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(93, 115, 80, 0.25)); }
.hb-info { flex: 1; min-width: 0; }
.hb-name { font-size: 14.5px; font-weight: 800; color: #2E2A26; overflow-wrap: break-word; }
.hb-meta { font-size: 12px; color: rgba(46, 42, 38, 0.55); margin-top: 2px; }
.hb-meta b { color: #9E4F38; }
.hb-del {
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 1.5px solid rgba(46, 42, 38, 0.15);
  background: rgba(255, 255, 255, 0.8);
  color: rgba(46, 42, 38, 0.45);
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.hb-del:hover { border-color: #C1694F; color: #C1694F; }
.hb-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.hb-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px;
  border-radius: 12px;
  border: 1.5px solid rgba(46, 42, 38, 0.12);
  background: rgba(250, 246, 239, 0.6);
  cursor: default;
}
.hb-day:disabled { opacity: 0.6; }
.hb-day-today { cursor: pointer; border-color: rgba(193, 105, 79, 0.55); box-shadow: 0 0 0 2px rgba(193, 105, 79, 0.12); }
.hb-day-today:hover { background: rgba(193, 105, 79, 0.08); }
.hb-day-on { background: rgba(156, 175, 136, 0.25); border-color: #759062; }
.hb-day-on .hb-mark { color: #4C6240; }
.hb-dow { font-size: 10px; font-weight: 800; color: rgba(46, 42, 38, 0.45); text-transform: uppercase; }
.hb-mark { font-size: 15px; font-weight: 800; color: rgba(46, 42, 38, 0.3); }
.hb-cheer { margin-top: 10px; font-size: 12px; font-style: italic; color: #8A6A2F; text-align: right; }
.hb-sug { cursor: pointer; transition: all 0.15s ease; border: none; }
.hb-sug:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(46, 42, 38, 0.12); }


/* ═══════════ GÓC TRẺ EM (quiz) ═══════════ */
.qzk-q { font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 700; line-height: 1.4; margin-bottom: 16px; text-align: center; }
.qzk-duel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qzk-choice { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 12px; background: #fff; border: 2px solid #E8DFCE; border-radius: 20px; cursor: pointer; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; font-family: inherit; }
.qzk-choice:hover { transform: translateY(-3px) scale(1.02); border-color: #C9A86A; box-shadow: 0 10px 24px rgba(46, 42, 38, .10); }
.qzk-emoji { font-size: 3.2rem; line-height: 1; }
.qzk-label { font-size: 14px; font-weight: 700; color: #2E2A26; text-align: center; line-height: 1.35; }
.qzk-big { font-size: 2.6rem; text-align: center; margin-bottom: 4px; }
.qzk-pickgood { text-align: center; font-size: 15px; margin: 6px 0 10px; }
.qzk-stars { font-size: 2.6rem; letter-spacing: .1em; margin: 6px 0; }
.qzk-seq { display: grid; gap: 8px; margin-top: 14px; }
.qzk-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 2px solid #E8DFCE; border-radius: 14px; cursor: pointer; text-align: left; font-family: inherit; font-size: 13.5px; font-weight: 600; color: #2E2A26; transition: border-color .15s ease, background .15s ease; }
.qzk-chip:hover { border-color: #C9A86A; }
.qzk-chip-done { background: #9CAF8822; border-color: #9CAF88; cursor: default; }
.qzk-chip .qzk-cemo { font-size: 1.5rem; flex-shrink: 0; }
.qzk-num { margin-left: auto; min-width: 26px; height: 26px; border-radius: 999px; background: #759062; color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qzk-shake { animation: qzkShake .35s ease; border-color: #C1694F !important; }
@keyframes qzkShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.qzk-itembox { text-align: center; padding: 10px 0 4px; }
.qzk-item-emoji { font-size: 3.6rem; line-height: 1.1; }
.qzk-item-name { font-size: 16px; font-weight: 800; margin-top: 6px; }
.qzk-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.qzk-group { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; background: #fff; border: 2px solid #E8DFCE; border-radius: 16px; cursor: pointer; font-family: inherit; transition: transform .15s ease, border-color .15s ease; }
.qzk-group:hover { transform: translateY(-2px); border-color: #C9A86A; }
.qzk-group:disabled { opacity: .75; cursor: default; }
.qzk-gemo { font-size: 1.9rem; }
.qzk-glabel { font-size: 13px; font-weight: 800; }
.qzk-ghint { font-size: 11px; color: #2E2A2699; text-align: center; line-height: 1.3; }
.qzk-flash { text-align: center; font-size: 14px; font-weight: 700; color: #5D7350; margin-top: 12px; min-height: 22px; }
.qzk-flash-bad { color: #9E4F38; }
@media (max-width: 480px) {
  .qzk-emoji { font-size: 2.6rem; }
  .qzk-q { font-size: 1.15rem; }
}


/* ═══ Trò lật thẻ (Góc trẻ em) ═══ */
.qzk-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.qzk-mcard { min-height: 88px; border: 2px solid #E8DFCE; border-radius: 14px; background: linear-gradient(160deg, #C9A86A22, #ffffff); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 4px; font-family: inherit; transition: transform .15s ease, border-color .15s ease, background .2s ease; }
.qzk-mcard:hover { transform: translateY(-2px); border-color: #C9A86A; }
.qzk-mface { font-size: 1.6rem; opacity: .55; }
.qzk-mcard-up { background: #fff; border-color: #C9A86A; }
.qzk-mcard-matched { background: #9CAF8822; border-color: #9CAF88; cursor: default; }
.qzk-memoji { font-size: 1.5rem; line-height: 1.1; }
.qzk-mlabel { font-size: 10.5px; font-weight: 700; text-align: center; line-height: 1.25; color: #2E2A26; }
@media (max-width: 480px) {
  .qzk-board { gap: 6px; }
  .qzk-mcard { min-height: 76px; }
  .qzk-mlabel { font-size: 9.5px; }
}

/* ═══ Đĩa ăn lành mạnh trực quan (nutrition) ═══ */
.nutri-plate-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.nutri-plate { width: 150px; height: 150px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(#9CAF88 0% 50%, #C9A86A 50% 75%, #C1694F 75% 100%); border: 5px solid #F1E9DB; box-shadow: 0 8px 20px rgba(46, 42, 38, .12); position: relative; }
.nutri-plate::after { content: ''; position: absolute; inset: 32%; border-radius: 50%; background: #FAF6EF; border: 2px solid #F1E9DB; }
.nutri-plate-legend { display: grid; gap: 8px; flex: 1; min-width: 190px; }
.nutri-plate-leg { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; line-height: 1.45; }
.nutri-plate-dot { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; transform: translateY(1px); }
@media (max-width: 480px) { .nutri-plate { width: 120px; height: 120px; margin: 0 auto; } }

/* ═══ Bảng đọc chỉ số (checkup) ═══ */
.chk-tbl { display: grid; gap: 0; margin-top: 8px; }
.chk-tbl-row { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #2E2A261A; font-size: 13.5px; line-height: 1.5; }
.chk-tbl-row:last-child { border-bottom: none; }
.chk-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; transform: translateY(1px); }
.chk-tbl-range { font-weight: 700; }
.chk-tbl-label { color: #2E2A26B3; margin-left: auto; text-align: right; }
.chk-tbl-foot { font-size: 12px; color: #2E2A2680; line-height: 1.65; margin-top: 8px; font-style: italic; }


/* ═══════════ TỦ THUỐC GIA ĐÌNH ═══════════ */
.th-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.th-tab { padding: 14px 10px; border-radius: 16px; border: 2px solid #E8DFCE; background: #fff; font-family: inherit; font-size: 15px; font-weight: 800; color: #2E2A2699; cursor: pointer; transition: all .15s ease; }
.th-tab:hover { border-color: #C9A86A; }
.th-tab-on { background: #2E2A26; border-color: #2E2A26; color: #FAF6EF; }
.th-tabs-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 520px) { .th-tabs-3 { grid-template-columns: 1fr; } }
.th-chip-sel { background: #C1694F !important; border-color: #9E4F38 !important; color: #fff !important; }

/* ── Drill sơ cứu ── */
.fa-opt { display: block; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 8px; border: 2px solid #E8DFCE; border-radius: 12px; background: #fff; font-family: inherit; font-size: 14px; font-weight: 600; color: #2E2A26; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.fa-opt:hover:not(:disabled) { border-color: #C9A86A; }
.fa-opt:disabled { cursor: default; opacity: .85; }
.fa-opt-right { border-color: #759062 !important; background: rgba(156, 175, 136, 0.18) !important; opacity: 1 !important; }
.fa-opt-wrong { border-color: #B03A2E !important; background: rgba(176, 58, 46, 0.10) !important; }

/* ── Dashboard Sức khỏe của tôi ── */
.mh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.mh-tile { display: block; background: #fff; border: 1px solid #F1E9DB; border-radius: 18px; padding: 18px 20px; text-decoration: none; color: #2E2A26; box-shadow: 0 1px 2px rgba(46, 42, 38, 0.05); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.mh-tile:hover { transform: translateY(-2px); border-color: #C9A86A; box-shadow: 0 6px 18px rgba(46, 42, 38, 0.08); }
.mh-tile-head { font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.mh-line { font-size: 13.5px; line-height: 1.6; font-weight: 600; color: #2E2A26D9; }
.mh-line-muted { color: #2E2A2666; font-weight: 500; font-style: italic; }
.mh-date { font-size: 11px; color: #2E2A2666; margin-top: 8px; }
.mh-cta { font-size: 12.5px; font-weight: 800; color: #9E4F38; margin-top: 8px; }
.mh-tile-empty { background: rgba(255, 255, 255, 0.6); border-style: dashed; }

/* ── Bản đồ cơ thể ── */
.bm-stage { perspective: 900px; }
.bm-tilt { transform-style: preserve-3d; transition: transform .25s ease; will-change: transform; }
#bm-svg { width: 100%; height: auto; display: block; }
.bm-spot { cursor: pointer; outline: none; }
.bm-halo { opacity: 0; transition: opacity .2s ease; transform-origin: center; transform-box: fill-box; animation: bmPulse 2.4s ease-in-out infinite; }
.bm-dot { fill: #ffffff; stroke: #C1694F; stroke-width: 2; opacity: 0.92; transition: all .2s ease; transform-origin: center; transform-box: fill-box; }
.bm-emoji { font-size: 13px; pointer-events: none; user-select: none; }
.bm-spot:hover .bm-dot, .bm-spot:focus .bm-dot { fill: #FDEEE8; transform: scale(1.18); }
.bm-spot:hover .bm-halo, .bm-spot:focus .bm-halo { opacity: 1; }
.bm-spot-on .bm-dot { fill: #C1694F; stroke: #9E4F38; transform: scale(1.22); }
.bm-spot-on .bm-halo { opacity: 1; }
@keyframes bmPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.bm-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.bm-card { background: #fff; border: 1px solid #F1E9DB; border-radius: 18px; padding: 22px; box-shadow: 0 1px 2px rgba(46, 42, 38, 0.05); animation: bmIn .3s ease both; }
@keyframes bmIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.bm-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.bm-card-ico { font-size: 34px; line-height: 1; }
.bm-card-title { font-weight: 800; font-size: 19px; font-family: 'Playfair Display', serif; }
.bm-card-sub { font-size: 12.5px; color: #2E2A2699; }
.bm-sym { border: 1px solid #F1E9DB; border-radius: 14px; margin-bottom: 10px; overflow: hidden; background: #FCFAF5; }
.bm-sym[open] { background: #fff; border-color: #E4D5BA; }
.bm-sym-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer; list-style: none; font-weight: 700; font-size: 14.5px; }
.bm-sym-head::-webkit-details-marker { display: none; }
.bm-sym-ico { font-size: 20px; }
.bm-sym-title { flex: 1; }
.bm-sym[open] .fa-chev { transform: rotate(180deg); }
.bm-sym-body { padding: 2px 16px 16px; }
@media (prefers-reduced-motion: reduce) {
  .bm-halo { animation: none; }
  .bm-tilt { transition: none; }
  .bm-card { animation: none; }
}

/* ── Máy giữ nhịp ép tim ── */
.fa-cpr-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0 6px; }
.fa-cpr-circle { width: 110px; height: 110px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 44px; background: radial-gradient(circle at 35% 30%, #E28A70, #C1694F 60%, #9E4F38); box-shadow: 0 6px 24px rgba(193, 105, 79, 0.45); }
.fa-cpr-beat { animation: faCprBeat 0.24s ease-out; }
@keyframes faCprBeat { 0% { transform: scale(1); } 40% { transform: scale(1.22); box-shadow: 0 6px 34px rgba(193, 105, 79, 0.65); } 100% { transform: scale(1); } }
.fa-cpr-count { font-weight: 800; font-size: 15px; color: #9E4F38; font-variant-numeric: tabular-nums; }
.fa-cpr-swap { font-weight: 900; font-size: 15px; color: #fff; background: #B03A2E; padding: 8px 16px; border-radius: 12px; animation: faCprFlash 0.5s steps(2) infinite; }
@keyframes faCprFlash { 50% { opacity: 0.55; } }

/* ── Đĩa ăn Việt ── */
.mn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; }
.mn-item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border: 1.5px solid #F1E9DB; border-radius: 14px; background: #FCFAF5; font-family: inherit; cursor: pointer; transition: border-color .15s ease, transform .15s ease, background .15s ease; }
.mn-item:hover { border-color: #C9A86A; background: #fff; transform: translateY(-1px); }
.mn-item-ico { font-size: 22px; }
.mn-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mn-item-body b { font-size: 13.5px; line-height: 1.3; }
.mn-item-body small { font-size: 11.5px; color: #2E2A2680; }
.mn-item-add { width: 24px; height: 24px; border-radius: 50%; background: #9CAF8830; color: #759062; font-weight: 900; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mn-item-pop { animation: mnPop 0.28s ease; }
@keyframes mnPop { 40% { transform: scale(0.96); background: #9CAF8826; border-color: #9CAF88; } }
.mn-plate { display: flex; flex-wrap: wrap; gap: 8px; min-height: 34px; }
.mn-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; border: 1.5px solid #C9A86A66; background: #C9A86A1A; font-family: inherit; font-size: 13px; font-weight: 700; color: #2E2A26; cursor: pointer; animation: mnPop 0.28s ease; transition: border-color .15s ease; }
.mn-chip:hover { border-color: #C1694F; }
.mn-chip b { color: #9E4F38; }
.mn-chip-x { width: 18px; height: 18px; border-radius: 50%; background: #C1694F22; color: #9E4F38; font-weight: 900; font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.mn-step { width: 26px; height: 26px; min-width: 26px; border-radius: 50%; border: 0; cursor: pointer; font-family: inherit; font-weight: 900; font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; transition: filter .12s ease; }
.mn-step:hover { filter: brightness(0.94); }
.mn-step:active { transform: scale(0.92); }
.mn-minus { background: #C1694F26; color: #9E4F38; }
.mn-plus { background: #7A986226; color: #4F6A3A; }
[data-theme="dark"] .mn-minus { background: rgba(232, 166, 141, 0.16); color: #E8A68D; }
[data-theme="dark"] .mn-plus { background: rgba(143, 196, 130, 0.16); color: #9FCB8A; }
.mn-fav-btn { min-height: 40px; padding: 8px 14px; border-radius: 12px; border: 1px solid rgba(201, 168, 106, 0.5); background: rgba(201, 168, 106, 0.12); color: #8A6A2F; font-weight: 700; font-size: 13px; cursor: pointer; transition: background .15s ease; }
.mn-fav-btn:hover { background: rgba(201, 168, 106, 0.22); }
.mn-fav-row { display: inline-flex; align-items: center; gap: 4px; margin: 0 6px 6px 0; }
.mn-fav-load { padding: 6px 11px; border-radius: 999px 4px 4px 999px; border: 1px solid rgba(201, 168, 106, 0.45); background: rgba(201, 168, 106, 0.1); color: #6b5426; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.mn-fav-load:hover { background: rgba(201, 168, 106, 0.2); }
.mn-fav-del { min-width: 30px; min-height: 30px; border-radius: 4px 999px 999px 4px; border: 1px solid rgba(180, 69, 50, 0.35); background: rgba(193, 105, 79, 0.1); color: #9E4F38; font-weight: 800; cursor: pointer; }
.mn-fav-del:hover { background: rgba(193, 105, 79, 0.2); }
[data-theme="dark"] .mn-fav-btn { color: #D9BE86; border-color: rgba(217, 190, 134, 0.4); background: rgba(217, 190, 134, 0.1); }
[data-theme="dark"] .mn-fav-load { color: #D9BE86; border-color: rgba(217, 190, 134, 0.35); background: rgba(217, 190, 134, 0.1); }
[data-theme="dark"] .mn-fav-del { color: #E8A68D; border-color: rgba(232, 166, 141, 0.35); background: rgba(232, 166, 141, 0.1); }
.mn-bar { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #9CAF88, #759062); transition: width .5s cubic-bezier(.22, 1, .36, 1), background .3s ease; }
.mn-bar-warn { background: linear-gradient(90deg, #C9A86A, #B08D3E); }
.mn-bar-over { background: linear-gradient(90deg, #C1694F, #B03A2E); }
@media (prefers-reduced-motion: reduce) { .mn-item-pop, .mn-chip { animation: none; } .mn-bar { transition: none; } }
.th-drop { display: flex; align-items: center; gap: 14px; padding: 18px; border: 2px dashed #C9A86A88; border-radius: 16px; background: #C9A86A0D; cursor: pointer; transition: background .15s ease, border-color .15s ease; font-size: 14px; line-height: 1.5; }
.th-drop:hover { background: #C9A86A1A; border-color: #C9A86A; }
.th-drop-ico { font-size: 2rem; }
.th-drop small { color: #2E2A2699; }
.th-preview { width: 100%; max-height: 340px; object-fit: contain; border-radius: 14px; border: 1px solid #F1E9DB; background: #FAF6EF; }
.th-mic { width: 56px; height: 56px; border-radius: 50%; border: 2px solid #C1694F; background: #C1694F14; font-size: 1.5rem; cursor: pointer; flex-shrink: 0; transition: all .15s ease; }
.th-mic:hover { background: #C1694F26; transform: scale(1.05); }
.th-mic:disabled { opacity: .4; cursor: not-allowed; }
.th-mic-on { background: #C1694F; animation: thPulse 1.2s ease infinite; }
@keyframes thPulse { 0%, 100% { box-shadow: 0 0 0 0 #C1694F55; } 50% { box-shadow: 0 0 0 12px #C1694F00; } }
.th-mono-name { font-family: 'Playfair Display', serif; font-size: 1.45rem; font-weight: 800; line-height: 1.3; margin: 6px 0; }
.th-rx { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.th-rx-yes { background: #B23A4818; color: #B23A48; border: 1px solid #B23A4855; }
.th-rx-no { background: #9CAF8826; color: #5D7350; border: 1px solid #9CAF8877; }
.th-speak-btn { margin-top: 10px; padding: 9px 18px; border-radius: 999px; border: 2px solid #759062; background: #fff; color: #5D7350; font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer; transition: all .15s ease; }
.th-speak-btn:hover { background: #9CAF8822; }
.th-drug-chip, .th-otc-chip { cursor: pointer; font-family: inherit; }
.th-drug-chip:hover, .th-otc-chip:hover { border-color: #C1694F; color: #9E4F38; }


/* ═══════════ TỰ SINH: CHỐNG CHỮ CHÌM Ở GIAO DIỆN TỐI (mọi trang) ═══════════
   Nhận diện MỌI màu "mực" trung tính tối (kể cả hex 8 ký tự & rgba),
   giữ nguyên màu nhấn (terracotta/gold/sage). Vùng preview #export-canvas
   (ec-*) được loại trừ để LUÔN sáng khi xuất ảnh. */
[data-theme="dark"] .home-feats li,
[data-theme="dark"] .mbti-opt-face,
[data-theme="dark"] .mbti-text,
[data-theme="dark"] .mbti-list li,
[data-theme="dark"] .mbti-lucky-name,
[data-theme="dark"] .mbti-pair-name,
[data-theme="dark"] .mbti-pair-why,
[data-theme="dark"] .form-label,
[data-theme="dark"] #app .text-charcoal\/60,
[data-theme="dark"] #app input,
[data-theme="dark"] #app select,
[data-theme="dark"] .radio-face,
[data-theme="dark"] .check-face,
[data-theme="dark"] .icon-card-label,
[data-theme="dark"] .mental-summary,
[data-theme="dark"] .mental-q,
[data-theme="dark"] .mental-opt span,
[data-theme="dark"] .mental-meaning,
[data-theme="dark"] .mental-tool-name,
[data-theme="dark"] .mental-tool-step,
[data-theme="dark"] .mk-name,
[data-theme="dark"] .mk-overview,
[data-theme="dark"] .mk-list li,
[data-theme="dark"] .mk-therapy-name,
[data-theme="dark"] .mk-therapy-how,
[data-theme="dark"] .mk-panic li,
[data-theme="dark"] .mk-cond-summary,
[data-theme="dark"] .mk-level-desc,
[data-theme="dark"] .src-topic,
[data-theme="dark"] .bg-thumb span,
[data-theme="dark"] .nutrient-name,
[data-theme="dark"] .nutrient-line,
[data-theme="dark"] .mbti-howto li,
[data-theme="dark"] .mbti-part-title,
[data-theme="dark"] .mbti-nav-ghost,
[data-theme="dark"] .nutri-input,
[data-theme="dark"] .nutri-stat b,
[data-theme="dark"] .nutri-macro-name,
[data-theme="dark"] .nutri-micro-name,
[data-theme="dark"] .well-day-body,
[data-theme="dark"] .xnav-item,
[data-theme="dark"] .qz-mode-body b,
[data-theme="dark"] .qz-hud-item,
[data-theme="dark"] .qz-claim,
[data-theme="dark"] .qz-verdict,
[data-theme="dark"] .qz-explain,
[data-theme="dark"] .lib-group-title,
[data-theme="dark"] .lib-card-name,
[data-theme="dark"] .fa-title,
[data-theme="dark"] .bp-meter-head,
[data-theme="dark"] .bp-missing-item,
[data-theme="dark"] .bp-title,
[data-theme="dark"] .bp-desc,
[data-theme="dark"] .br-phase,
[data-theme="dark"] .hb-name,
[data-theme="dark"] .qzk-label,
[data-theme="dark"] .qzk-chip,
[data-theme="dark"] .qzk-mlabel,
[data-theme="dark"] .chk-tbl-label,
[data-theme="dark"] .fa-opt,
[data-theme="dark"] .mh-tile,
[data-theme="dark"] .mh-line,
[data-theme="dark"] .mn-chip {
  color: #E9E0D1 !important;
}
[data-theme="dark"] .mbti-lucky-note,
[data-theme="dark"] .mbti-axis-labels,
[data-theme="dark"] .mbti-axis-desc,
[data-theme="dark"] .mbti-source,
[data-theme="dark"] .tab-btn,
[data-theme="dark"] .mental-badge,
[data-theme="dark"] .mental-tool-for,
[data-theme="dark"] .mk-therapy-for,
[data-theme="dark"] .mk-note,
[data-theme="dark"] .src-source,
[data-theme="dark"] .zoom-btn,
[data-theme="dark"] .mode-btn,
[data-theme="dark"] .nutrient-role,
[data-theme="dark"] .nutrient-note,
[data-theme="dark"] .mbti-step-no,
[data-theme="dark"] .mbti-step-name,
[data-theme="dark"] .mbti-part-desc,
[data-theme="dark"] .mbti-career-why,
[data-theme="dark"] .nutri-label,
[data-theme="dark"] .nutri-radio-row small,
[data-theme="dark"] .nutri-stat span,
[data-theme="dark"] .nutri-macro-pct,
[data-theme="dark"] .nutri-micro-food,
[data-theme="dark"] .num-sum-label,
[data-theme="dark"] .qz-mode-body small,
[data-theme="dark"] .lib-card-desc,
[data-theme="dark"] .last-btn-clear,
[data-theme="dark"] .hb-meta,
[data-theme="dark"] .qzk-ghint,
[data-theme="dark"] .chk-tbl-foot,
[data-theme="dark"] .th-tab,
[data-theme="dark"] .bm-card-sub,
[data-theme="dark"] .mn-item-body small,
[data-theme="dark"] .th-drop small {
  color: #B4A995 !important;
}
[data-theme="dark"] .mbti-q-num,
[data-theme="dark"] #app input::placeholder,
[data-theme="dark"] .mbti-step-count,
[data-theme="dark"] .nutri-micro-food i,
[data-theme="dark"] .num-sum-hint,
[data-theme="dark"] .fa-chev,
[data-theme="dark"] .hb-del,
[data-theme="dark"] .hb-dow,
[data-theme="dark"] .hb-mark,
[data-theme="dark"] .mh-line-muted,
[data-theme="dark"] .mh-date {
  color: #A59A86 !important; /* nâng tương phản trên nền thẻ tối đạt WCAG AA (~5:1) */
}


/* ═══════════ TỰ SINH-BG: LẬT NỀN SÁNG → NÂU TỐI Ở GIAO DIỆN TỐI ═══════════
   Mọi component nền kem/trắng (hàng bảng, chip, thẻ nhỏ) chuyển nền #3A2E24
   + viền #4A3B2F khi dark — hết cảnh "chữ sáng trên nền be". Preview export
   (ec-*) và mẫu phôi nền (bg-thumb) giữ nguyên. */
[data-theme="dark"] .home-hero,
[data-theme="dark"] .home-card,
[data-theme="dark"] .home-card-soon,
[data-theme="dark"] .mbti-q,
[data-theme="dark"] .mbti-opt-face,
[data-theme="dark"] .mbti-result,
[data-theme="dark"] .mbti-block,
[data-theme="dark"] .mbti-block-lucky,
[data-theme="dark"] .login-card,
[data-theme="dark"] .mbti-result .mbti-block,
[data-theme="dark"] .radio-face,
[data-theme="dark"] .check-face,
[data-theme="dark"] .check-face::before,
[data-theme="dark"] .icon-card-face,
[data-theme="dark"] .illust-preview,
[data-theme="dark"] .mental-test,
[data-theme="dark"] .mental-badge-urgent,
[data-theme="dark"] .mental-opt span,
[data-theme="dark"] .mental-result-box.mental-level-urgent,
[data-theme="dark"] .mk-card,
[data-theme="dark"] .mk-cond,
[data-theme="dark"] .mk-level-high,
[data-theme="dark"] .mk-myth,
[data-theme="dark"] .mbti-step,
[data-theme="dark"] .mbti-part-card,
[data-theme="dark"] .mbti-nav-ghost,
[data-theme="dark"] .mbti-career-group,
[data-theme="dark"] .nutri-input,
[data-theme="dark"] .nutri-radio-face,
[data-theme="dark"] .nutri-stat,
[data-theme="dark"] .nutri-bmi-dot,
[data-theme="dark"] .nutri-macro-row,
[data-theme="dark"] .nutri-micro-row,
[data-theme="dark"] .num-sum-card,
[data-theme="dark"] .num-cell,
[data-theme="dark"] .well-day,
[data-theme="dark"] .xnav-item,
[data-theme="dark"] .qz-mode,
[data-theme="dark"] .qz-hud-item,
[data-theme="dark"] .qz-question,
[data-theme="dark"] .lib-card,
[data-theme="dark"] .fa-card,
[data-theme="dark"] .fa-summary:hover,
[data-theme="dark"] .last-btn-clear,
[data-theme="dark"] .bp-meter,
[data-theme="dark"] .bp-body,
[data-theme="dark"] .br-stage,
[data-theme="dark"] .hb-card,
[data-theme="dark"] .hb-del,
[data-theme="dark"] .hb-day,
[data-theme="dark"] .qzk-choice,
[data-theme="dark"] .qzk-chip,
[data-theme="dark"] .qzk-group,
[data-theme="dark"] .qzk-mcard,
[data-theme="dark"] .qzk-mcard-up,
[data-theme="dark"] .nutri-plate::after,
[data-theme="dark"] .th-tab,
[data-theme="dark"] .fa-opt,
[data-theme="dark"] .mh-tile,
[data-theme="dark"] .mh-tile-empty,
[data-theme="dark"] .bm-card,
[data-theme="dark"] .bm-sym,
[data-theme="dark"] .bm-sym[open],
[data-theme="dark"] .mn-item,
[data-theme="dark"] .mn-item:hover,
[data-theme="dark"] .th-preview,
[data-theme="dark"] .th-speak-btn {
  background: #3A2E24 !important;
  border-color: #4A3B2F !important;
}

/* ═══════════ TINH CHỈNH GIAO DIỆN TỐI THEO SPEC UI/UX (đặt CUỐI để thắng các khối tự sinh) ═══════════ */

/* 1) Hộp CẢNH BÁO KHẨN CẤP: giữ tín hiệu đỏ (bị khối lật-nền quét nhầm sang nâu) */
[data-theme="dark"] .mental-badge-urgent { background: #46201D !important; border-color: #7A3A33 !important; color: #F5A9A0 !important; }
[data-theme="dark"] .mental-result-box.mental-level-urgent { background: #402522 !important; border-color: #6B3A32 !important; }
[data-theme="dark"] .mental-level-urgent .mental-proto-title { color: #F5A9A0 !important; }
[data-theme="dark"] .mk-level-high { background: #402522 !important; border-color: #6B3A32 !important; }

/* 2) Nhãn tên phôi nền: chữ nằm TRÊN ảnh phôi sáng → giữ mực tối + đệm sáng */
[data-theme="dark"] .bg-thumb span { color: #2E2A26 !important; background: rgba(250, 246, 239, 0.88); border-radius: 6px; padding: 1px 6px; }

/* 3) Bảng vi chất & macro — tương phản WCAG AAA trên nền hàng #3A2E24 */
[data-theme="dark"] .nutri-micro-name, [data-theme="dark"] .nutri-macro-name { color: #FDFBF7 !important; }
[data-theme="dark"] .nutri-micro-val { color: #E5C173 !important; }
[data-theme="dark"] .nutri-macro-num { color: #A9C79A !important; }
[data-theme="dark"] .nutri-micro-food { color: #D4CFC9 !important; font-weight: 500; line-height: 1.6; }
[data-theme="dark"] .nutri-micro-food i { color: #B3AA9E !important; }
[data-theme="dark"] .nutri-macro-pct { color: #B3AA9E !important; }
[data-theme="dark"] .nutri-micro-row { padding: 11px 14px; gap: 12px; }
[data-theme="dark"] .nutri-micro-table { gap: 8px; }

/* 4) Ô nhập & thẻ chọn trên nền hàng mới — viền rõ hơn một nấc */
[data-theme="dark"] .nutri-input:focus, [data-theme="dark"] .radio-face:hover, [data-theme="dark"] .check-face:hover { border-color: #6B5A45 !important; }


/* ═══════════ TỰ SINH-ACCENT: SÁNG HÓA ACCENT TỐI Ở GIAO DIỆN TỐI (WCAG AA) ═══════════
   Terracotta/sage/gold/đỏ đậm dùng làm chữ → phiên bản sáng cùng tông màu.
   Preview export (ec-*) giữ nguyên. */
[data-theme="dark"] .home-badge-live,
[data-theme="dark"] .mbti-chip,
[data-theme="dark"] .mental-badge-done,
[data-theme="dark"] .mental-rev-tag,
[data-theme="dark"] .mental-scoring-note em,
[data-theme="dark"] .mental-scoring-note.mental-scoring-good,
[data-theme="dark"] .mental-proto-title,
[data-theme="dark"] .mental-tool-head,
[data-theme="dark"] .mk-sub,
[data-theme="dark"] .mk-myth-v,
[data-theme="dark"] .nutrient-line strong,
[data-theme="dark"] .mbti-step.is-done .mbti-step-no,
[data-theme="dark"] .nutri-stat-hl b,
[data-theme="dark"] .nutri-macro-num,
[data-theme="dark"] .chk-freq,
[data-theme="dark"] .qz-btn-true,
[data-theme="dark"] .bp-desc b,
[data-theme="dark"] .br-count,
[data-theme="dark"] .hb-day-on .hb-mark,
[data-theme="dark"] .qzk-flash,
[data-theme="dark"] .th-rx-no,
[data-theme="dark"] .th-speak-btn {
  color: #A9C79A !important;
}
[data-theme="dark"] .home-badge-new,
[data-theme="dark"] .home-cta,
[data-theme="dark"] .mbti-part,
[data-theme="dark"] .mbti-block-title,
[data-theme="dark"] .mbti-axis-labels .mbti-axis-win,
[data-theme="dark"] .symptom-group-title,
[data-theme="dark"] .icon-card-ico,
[data-theme="dark"] .tab-btn.tab-active,
[data-theme="dark"] .illust-preview .illust-cap,
[data-theme="dark"] .mental-badge-urgent,
[data-theme="dark"] .mental-prompt,
[data-theme="dark"] .mental-qnum,
[data-theme="dark"] .mental-level-urgent .mental-proto-title,
[data-theme="dark"] .mental-seek-box .mental-tool-step,
[data-theme="dark"] .mk-head,
[data-theme="dark"] .mk-concern,
[data-theme="dark"] .mk-concern strong,
[data-theme="dark"] .mk-myth-x,
[data-theme="dark"] .src-group,
[data-theme="dark"] .mbti-stat-chip,
[data-theme="dark"] .mbti-step.is-now .mbti-step-name,
[data-theme="dark"] .mbti-part-kicker,
[data-theme="dark"] .nutri-warn,
[data-theme="dark"] .xnav-item:hover,
[data-theme="dark"] .qz-hud-streak,
[data-theme="dark"] .qz-btn-false,
[data-theme="dark"] .fa-donts li::before,
[data-theme="dark"] .bp-missing-item b,
[data-theme="dark"] .bp-tag,
[data-theme="dark"] .hb-meta b,
[data-theme="dark"] .qzk-flash-bad,
[data-theme="dark"] .mh-cta,
[data-theme="dark"] .fa-cpr-count,
[data-theme="dark"] .mn-chip b,
[data-theme="dark"] .mn-chip-x,
[data-theme="dark"] .th-rx-yes,
[data-theme="dark"] .th-drug-chip:hover,
[data-theme="dark"] .th-otc-chip:hover {
  color: #F2A69E !important;
}
[data-theme="dark"] .home-badge-soon,
[data-theme="dark"] .mbti-chip-gold,
[data-theme="dark"] .mbti-fun-tag,
[data-theme="dark"] .mbti-lucky-num,
[data-theme="dark"] .mental-badge-partial,
[data-theme="dark"] .mental-scoring-note,
[data-theme="dark"] .mental-incomplete {
  color: #DDB671 !important;
}
[data-theme="dark"] .mbti-career-field,
[data-theme="dark"] .nutri-micro-val,
[data-theme="dark"] .num-cell,
[data-theme="dark"] .qz-cat,
[data-theme="dark"] .qz-source,
[data-theme="dark"] .lib-card-host,
[data-theme="dark"] .fa-src,
[data-theme="dark"] .last-banner b,
[data-theme="dark"] .bp-meter-head b,
[data-theme="dark"] .bp-time,
[data-theme="dark"] .hb-cheer {
  color: #E8A68D !important;
}
[data-theme="dark"] .chk-src {
  color: #85C7BC !important;
}

/* ═══════════ HỆ SỐ LIỆU & NHỊP ĐỌC (spec UI/UX — áp cả 2 giao diện) ═══════════ */

/* 1) Số bảng thẳng hàng: mọi chữ số cùng độ rộng trên toàn site */
body { font-variant-numeric: tabular-nums; }

/* 2) Số liệu quan trọng nổi bật tuyệt đối trên nền tối */
[data-theme="dark"] .nutri-stat b,
[data-theme="dark"] .num-cell b,
[data-theme="dark"] .chk-tbl-range,
[data-theme="dark"] .hb-name b,
[data-theme="dark"] .qz-hud-item b { color: #FDFBF7 !important; font-weight: 700; }

/* 3) Nhịp thở văn bản: line-height tối thiểu 1.5 cho câu chữ (trừ nhãn ngắn) */
.mental-q, .mental-meaning, .mk-therapy-how, .mk-myth-v, .nutrient-line, .src-source { line-height: 1.55; }
.mental-proto li, .mental-tool-step { line-height: 1.5; }
.check-face { line-height: 1.4; }
.icon-card-label { line-height: 1.35; }
.src-topic { line-height: 1.45; }

/* 4) Không gian nghỉ quanh cụm số liệu */
.nutri-stat { padding: 14px 12px; }
.chk-tbl-row { padding: 9px 0; }

/* ═══════════ HỆ FONT SỐ LIỆU (spec đọc nhanh) ═══════════
   Playfair Display đẹp cho TIÊU ĐỀ CHỮ nhưng chữ số trang trí khó đọc
   nhanh. Mọi khối HIỂN THỊ SỐ chuyển sans đậm + tabular lining:
   06:30 → 21:15, kcal, BMR/TDEE, số chủ đạo, biểu đồ ngày sinh.
   (Bản export ec-* giữ nguyên serif — layout in ấn đã chốt.) */
.mbti-hero-code, .nutri-stat b, .num-sum-value, .num-cell {
  font-family: "Be Vietnam Pro", "Plus Jakarta Sans", sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0.02em;
}
.mbti-hero-code { font-weight: 800; }
.nutri-stat b, .num-sum-value { font-weight: 800; }
.num-cell { font-weight: 700; }

/* ═══════════ MOTION — vi tương tác (đi cùng motion.js) ═══════════ */

/* Reveal-on-scroll: motion.js gắn .mo-reveal rồi .mo-in khi vào khung nhìn.
   Không có JS → không có class → nội dung hiện tĩnh bình thường. */
.mo-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.mo-reveal.mo-in { opacity: 1; transform: none; }

/* Nhấn nút: co 3% trong 120ms — phản hồi xúc giác tức thì */
button:not(:disabled), .la-btn, .check-face, .radio-face, .mbti-chip { transition: transform 0.12s ease; }
button:not(:disabled):active, .la-btn:active, .check-card:active .check-face,
.radio-card:active .radio-face, .mbti-chip:active { transform: scale(0.97); }
/* UI đợt 5 — con trỏ tay NHẤT QUÁN cho mọi phần tử bấm được, dù trang tự đặt class gì */
button:not(:disabled), .la-btn, .check-face, .radio-face, .mbti-chip, [role="button"] { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }

/* Bàn phím điều hướng: viền focus rõ, không phá thiết kế chuột */
:focus-visible { outline: 2px solid rgba(193, 105, 79, 0.55); outline-offset: 2px; border-radius: 4px; }
/* UI đợt 4 — ring focus sáng hơn trên nền tối cho đủ tương phản (khớp cách la-hit làm sáng ở dark) */
[data-theme="dark"] :focus-visible { outline-color: rgba(232, 166, 141, 0.72); }
/* Cuộn tới neo #id mượt, đồng bộ với các scrollIntoView JS (reduced-motion tự tắt bên dưới) */
html { scroll-behavior: smooth; }

/* Chuyển trang crossfade mượt (Chrome/Edge mới; trình duyệt khác tự bỏ qua) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; }

/* Người dùng tắt chuyển động → tất cả tĩnh */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; } /* UI đợt 4 — tắt cuộn mượt khi người dùng yêu cầu giảm chuyển động */
  .mo-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  button:not(:disabled):active, .la-btn:active { transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ═══════════ TÌM KIẾM TOÀN CỤC (U1) + MENU CHUYÊN MỤC (U2) ═══════════ */

/* ── Nút trong header (đồng bộ với nút Trang chủ bg-cream/10) ── */
.lah-right { display: flex; align-items: center; gap: 8px; position: relative; }
.lah-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(250, 246, 239, 0.1); border: 1px solid rgba(250, 246, 239, 0.2);
  color: inherit; padding: 10px 13px; border-radius: 12px;
  font: inherit; font-weight: 600; font-size: 14px; line-height: 1; cursor: pointer;
  transition: background 0.15s ease;
}
.lah-btn:hover { background: rgba(250, 246, 239, 0.2); }
.lah-btn i, .lah-btn svg { width: 16px; height: 16px; flex: none; }
.lah-kbd {
  font-family: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 6px;
  background: rgba(250, 246, 239, 0.12); border: 1px solid rgba(250, 246, 239, 0.25);
}
@media (max-width: 700px) {
  .lah-label, .lah-kbd { display: none; } /* mobile: chỉ icon cho gọn */
  .lah-btn { padding: 10px 11px; }
}

/* ── Menu Chuyên mục thả xuống ── */
.lan-panel[hidden] { display: none; } /* BẮT BUỘC: display:grid bên dưới sẽ đè [hidden] của trình duyệt */
.lan-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
  width: min(92vw, 420px); max-height: min(70vh, 520px); overflow: auto;
  background: #FFFDF9; border: 1px solid #EADFCE; border-radius: 16px;
  box-shadow: 0 18px 44px rgba(46, 42, 38, 0.22);
  padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.lan-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; color: #2E2A26; font-size: 13px; font-weight: 600;
  line-height: 1.35; text-decoration: none;
}
.lan-item:hover { background: #F5EDDF; }
.lan-item.cur { background: #F1E9DB; outline: 1px solid #DCCFB8; }
.lan-item i, .lan-item svg { width: 16px; height: 16px; flex: none; color: #9E4F38; }
@media (max-width: 480px) { .lan-panel { grid-template-columns: 1fr; } }
[data-theme="dark"] .lan-panel { background: #241C15; border-color: #4A3B2F; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5); }
[data-theme="dark"] .lan-item { color: #E9E0D1; }
[data-theme="dark"] .lan-item:hover { background: #3A2E24; }
[data-theme="dark"] .lan-item.cur { background: #3A2E24; outline-color: #4A3B2F; }
[data-theme="dark"] .lan-item i, [data-theme="dark"] .lan-item svg { color: #E8A68D; }

/* Tiêu đề nhóm domain trong menu Chuyên mục (taxonomy) — trải hết 2 cột */
.lan-group { grid-column: 1 / -1; margin: 0; padding: 11px 12px 3px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(46, 42, 38, 0.5); }
.lan-group:first-child { padding-top: 3px; }
[data-theme="dark"] .lan-group { color: rgba(233, 227, 214, 0.5); }

/* Breadcrumb tự động (Module 4) — dải điều hướng mảnh dưới header sticky */
.la-crumb { padding: 9px 16px 0; }
@media (min-width: 640px) { .la-crumb { padding: 10px 24px 0; } }
.la-crumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 12.5px; color: rgba(46, 42, 38, 0.6); }
.la-crumb li { display: inline-flex; align-items: center; gap: 5px; }
.la-crumb a { color: #9E4F38; font-weight: 600; text-decoration: none; }
.la-crumb a:hover, .la-crumb a:focus-visible { text-decoration: underline; }
.la-crumb-sep { color: rgba(46, 42, 38, 0.3); }
.la-crumb-dom { color: rgba(46, 42, 38, 0.7); }
.la-crumb-cur { font-weight: 600; color: rgba(46, 42, 38, 0.85); }
[data-theme="dark"] .la-crumb ol { color: rgba(233, 227, 214, 0.55); }
[data-theme="dark"] .la-crumb a { color: #E8A68D; }
[data-theme="dark"] .la-crumb-sep { color: rgba(233, 227, 214, 0.3); }
[data-theme="dark"] .la-crumb-dom { color: rgba(233, 227, 214, 0.72); }
[data-theme="dark"] .la-crumb-cur { color: rgba(233, 227, 214, 0.9); }

/* ── Overlay tìm kiếm ── */
.las-lock { overflow: hidden; }
.las-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(24, 18, 12, 0.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 9vh 16px 16px;
}
.las-backdrop[hidden] { display: none; }
.las-box {
  width: min(620px, 100%); max-height: 74vh; display: flex; flex-direction: column;
  background: #FFFDF9; border: 1px solid #EADFCE; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(20, 15, 10, 0.35);
  animation: las-pop 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes las-pop { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.las-inputwrap { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid #EADFCE; }
.las-mag { font-size: 20px; line-height: 1; color: #9E4F38; }
.las-input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  font: inherit; font-size: 16px; font-weight: 500; color: #2E2A26;
}
.las-input::placeholder { color: rgba(46, 42, 38, 0.45); }
.las-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 2px; border-bottom: 1px solid #EADFC9; }
.las-tab { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; border: 1.5px solid transparent; background: #F1E9DB; color: #6B5B4A; cursor: pointer; transition: all 0.13s ease; }
.las-tab:hover { background: #EADFC9; }
.las-tab.on { background: #9E4F38; color: #FBF6EC; }
.las-tabn { font-variant-numeric: lining-nums tabular-nums; font-size: 11px; opacity: 0.8; }
.las-tab.on .las-tabn { opacity: 0.95; }
[data-theme="dark"] .las-tabs { border-bottom-color: #4A3B2F; }
[data-theme="dark"] .las-tab { background: #3A2E24; color: #C9BEAC; }
[data-theme="dark"] .las-tab:hover { background: #4A3B2F; }
[data-theme="dark"] .las-tab.on { background: #E0A188; color: #241C15; }
.las-list { overflow: auto; padding: 8px; overscroll-behavior: contain; }
.las-item {
  display: flex; align-items: baseline; gap: 8px; width: 100%;
  padding: 10px 12px; border-radius: 12px; text-decoration: none;
  color: #2E2A26; font-size: 14px; line-height: 1.45;
}
.las-item.act, .las-item:hover { background: #F5EDDF; }
.las-n {
  font-family: "Be Vietnam Pro", "Plus Jakarta Sans", sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: 800; font-size: 12.5px; color: #9E4F38; flex: none;
}
.las-t { font-weight: 600; }
.las-d { font-size: 12px; color: rgba(46, 42, 38, 0.6); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.las-c {
  font-family: "Be Vietnam Pro", "Plus Jakarta Sans", sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 12px; font-weight: 700; color: #759062; flex: none;
}
.las-badge {
  margin-left: auto; flex: none; font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
  background: #F1E9DB; color: #6B5B4A; max-width: 34%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 560px) { .las-badge { display: none; } .las-d { display: none; } }
.las-empty { padding: 22px 18px; font-size: 13.5px; color: rgba(46, 42, 38, 0.65); }
.las-empty-h {
  padding: 10px 12px 4px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: rgba(46, 42, 38, 0.5);
}
.las-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px; }
.las-mod {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; color: #2E2A26; font-size: 13px; font-weight: 600;
  line-height: 1.35; text-decoration: none;
}
.las-mod:hover { background: #F5EDDF; }
.las-mod i, .las-mod svg { width: 16px; height: 16px; flex: none; color: #9E4F38; }
@media (max-width: 480px) { .las-grid { grid-template-columns: 1fr; } }
.las-hint {
  padding: 9px 18px; border-top: 1px solid #EADFCE;
  font-size: 11px; font-weight: 600; color: rgba(46, 42, 38, 0.5);
  font-variant-numeric: lining-nums tabular-nums;
}

/* ── Tối ── */
[data-theme="dark"] .las-box { background: #241C15; border-color: #4A3B2F; }
[data-theme="dark"] .las-inputwrap, [data-theme="dark"] .las-hint { border-color: #4A3B2F; }
[data-theme="dark"] .las-input { color: #F4EFE7; }
[data-theme="dark"] .las-input::placeholder { color: #8E8574; }
[data-theme="dark"] .las-mag { color: #E8A68D; }
[data-theme="dark"] .las-item { color: #E9E0D1; }
[data-theme="dark"] .las-item.act, [data-theme="dark"] .las-item:hover { background: #3A2E24; }
[data-theme="dark"] .las-n { color: #E8A68D; }
[data-theme="dark"] .las-d { color: #B4A995; }
[data-theme="dark"] .las-c { color: #A9C79A; }
[data-theme="dark"] .las-badge { background: #3A2E24; color: #B4A995; }
[data-theme="dark"] .las-empty, [data-theme="dark"] .las-empty-h, [data-theme="dark"] .las-hint { color: #8E8574; }
[data-theme="dark"] .las-mod { color: #E9E0D1; }
[data-theme="dark"] .las-mod:hover { background: #3A2E24; }
[data-theme="dark"] .las-mod i, [data-theme="dark"] .las-mod svg { color: #E8A68D; }

/* Người dùng tắt chuyển động → overlay hiện tức thì */
@media (prefers-reduced-motion: reduce) {
  .las-box { animation: none; }
}

/* ═══════════ ĐỢT 3 — M1 TILT 3D · M3 QUẢ CẦU THỞ ═══════════ */

/* M1: motion.js gắn .mo-tilt khi con trỏ vào thẻ — transition cho mượt */
.mo-tilt { transition: transform 0.18s ease; will-change: transform; }

/* M3: nâng vòng tròn thở thành quả cầu 3D — THUẦN CSS, breathe.js giữ nguyên
   (scale hít/thở vẫn do JS đặt trên .br-circle; vành xoay nằm ở ::after riêng) */
.br-circle {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 70% 76%, rgba(93, 115, 80, 0.3), rgba(93, 115, 80, 0) 44%),
    radial-gradient(circle at 50% 50%, rgba(156, 175, 136, 0.55), rgba(156, 175, 136, 0.22) 58%, rgba(156, 175, 136, 0.08) 78%, rgba(156, 175, 136, 0.04));
  border: 2px solid rgba(117, 144, 98, 0.4);
  box-shadow:
    inset -14px -18px 34px rgba(93, 115, 80, 0.26),
    inset 10px 12px 26px rgba(255, 255, 255, 0.5),
    0 18px 44px rgba(117, 144, 98, 0.24);
}
/* vệt sáng specular — chấm phản quang của khối cầu */
.br-circle::before {
  content: '';
  position: absolute; left: 17%; top: 12%; width: 32%; height: 22%;
  border-radius: 999px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
  filter: blur(2px);
}
/* vành khí quyển xoay chậm quanh cầu */
.br-circle::after {
  content: '';
  position: absolute; inset: -7%;
  border-radius: 999px;
  background: conic-gradient(from 0deg,
    rgba(156, 175, 136, 0) 0deg, rgba(156, 175, 136, 0.4) 60deg, rgba(156, 175, 136, 0) 130deg,
    rgba(201, 168, 106, 0.28) 220deg, rgba(156, 175, 136, 0) 300deg);
  -webkit-mask: radial-gradient(closest-side, transparent 85%, #000 88%);
  mask: radial-gradient(closest-side, transparent 85%, #000 88%);
  animation: br-orbit 14s linear infinite;
}
@keyframes br-orbit { to { transform: rotate(360deg); } }
/* quầng sáng thở phía sau (vẽ trước anh em → luôn nằm dưới chữ và cầu) */
.br-circle-wrap::before {
  content: '';
  position: absolute; inset: -10%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(156, 175, 136, 0.2), rgba(156, 175, 136, 0) 66%);
  animation: br-halo 7s ease-in-out infinite;
}
@keyframes br-halo { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

[data-theme="dark"] .br-circle {
  background:
    radial-gradient(circle at 32% 26%, rgba(233, 224, 209, 0.3), rgba(233, 224, 209, 0) 36%),
    radial-gradient(circle at 70% 76%, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0) 44%),
    radial-gradient(circle at 50% 50%, rgba(169, 199, 154, 0.4), rgba(169, 199, 154, 0.16) 58%, rgba(169, 199, 154, 0.06) 78%, rgba(169, 199, 154, 0.03));
  border-color: rgba(169, 199, 154, 0.45);
  box-shadow:
    inset -14px -18px 34px rgba(0, 0, 0, 0.42),
    inset 10px 12px 26px rgba(233, 224, 209, 0.12),
    0 18px 44px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .br-circle::before { background: radial-gradient(closest-side, rgba(244, 239, 231, 0.5), rgba(244, 239, 231, 0)); }
[data-theme="dark"] .br-circle-wrap::before { background: radial-gradient(circle, rgba(169, 199, 154, 0.16), rgba(169, 199, 154, 0) 66%); }

/* tắt chuyển động → cầu đứng yên, không vành xoay, không quầng nhấp nháy */
@media (prefers-reduced-motion: reduce) {
  .br-circle::after, .br-circle-wrap::before { animation: none; }
  .mo-tilt { transition: none; }
}

/* ═══════════ MĂNG-SÉT ĐỌC NHANH ═══════════
   Đoạn giới thiệu / miễn trừ trên khung rộng bị kéo dài cả trăm ký tự
   mỗi dòng — mắt khó bám dòng. Trần ~74ch theo chuẩn đọc editorial.
   (Chỉ chạm typography — KHÔNG đổi chuỗi nào, từ điển an toàn.) */
main p[id$="-intro"], main p[id$="-disclaimer"], #hb-science { max-width: 74ch; }

/* ═══════════ .hidden PHẢI LUÔN THẮNG ═══════════
   tw.css (nạp trước) định nghĩa .hidden{display:none} — mọi class tùy chỉnh
   có display:flex/grid trong file này (nạp sau) sẽ ĐÈ mất nó (đã dính:
   .fa-cpr-stage, .illust-preview lộ ra khi phải ẩn). Chốt bằng !important. */
.hidden { display: none !important; }

/* Deep-link tìm kiếm: mục được trỏ tới nháy viền nhấn 2,6s rồi trở lại thường */
.la-hit { outline: 3px solid rgba(193, 105, 79, 0.75); outline-offset: 3px; border-radius: 12px; animation: la-hit-fade 2.6s ease forwards; }
[data-theme="dark"] .la-hit { outline-color: rgba(232, 166, 141, 0.85); }
@keyframes la-hit-fade { 0%, 55% { outline-color: rgba(193, 105, 79, 0.75); } 100% { outline-color: rgba(193, 105, 79, 0); } }
[data-theme="dark"] .la-hit { animation: none; } /* dark giữ viền tĩnh 2,6s (JS gỡ class) — tránh keyframes ghi đè màu light */

/* ═══════════ TOAST + CONFIRM + NÚT LÊN ĐẦU (ui.js — U4) ═══════════ */
.lat-wrap {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: min(92vw, 460px); pointer-events: none;
}
.lat-toast {
  pointer-events: auto; max-width: 100%;
  background: #2E2A26; color: #FDFBF7;
  padding: 11px 16px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; line-height: 1.5;
  box-shadow: 0 10px 30px rgba(20, 15, 10, 0.35);
  animation: lat-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.lat-ok { background: #3E4A36; color: #DDEBD2; }
.lat-err { background: #4A2A28; color: #F5C9C2; }
.lat-out { opacity: 0; transition: opacity 0.4s ease; }
@keyframes lat-in { from { opacity: 0; transform: translateY(10px); } }
[data-theme="dark"] .lat-toast { background: #3A2E24; color: #F4EFE7; border: 1px solid #4A3B2F; }
[data-theme="dark"] .lat-ok { background: #2E3A28; color: #C9E3B8; }
[data-theme="dark"] .lat-err { background: #402522; color: #F5A9A0; }

/* Thẻ báo lỗi cố định khi nạp dữ liệu thất bại (LA_FATAL) */
.la-fatal {
  max-width: 32rem; margin: 2.5rem auto; padding: 1.5rem 1.25rem;
  border: 1px solid var(--creamdark, #E7DECF); border-radius: 1rem;
  background: #FFFDF9; text-align: center;
}
.la-fatal-title { font-weight: 700; font-size: 1.05rem; color: #2E2A26; margin-bottom: 0.4rem; }
.la-fatal-msg { font-size: 0.9rem; color: rgba(46, 42, 38, 0.75); line-height: 1.55; margin-bottom: 1rem; }
.la-fatal-btn {
  display: inline-block; padding: 0.6rem 1.4rem; border-radius: 0.75rem;
  background: #B5654B; color: #fff; font-weight: 600; font-size: 0.9rem; border: 0; cursor: pointer;
}
.la-fatal-btn:hover { background: #9E5540; }
.la-fatal-detail { margin-top: 0.9rem; font-size: 0.72rem; color: rgba(46, 42, 38, 0.5); word-break: break-word; }
[data-theme="dark"] .la-fatal { background: #241C15; border-color: #4A3B2F; }
[data-theme="dark"] .la-fatal-title { color: #F4EFE7; }
[data-theme="dark"] .la-fatal-msg { color: #C9BEAC; }
[data-theme="dark"] .la-fatal-detail { color: #8E8574; }

.lac-backdrop {
  position: fixed; inset: 0; z-index: 130;
  background: rgba(24, 18, 12, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.lac-box {
  width: min(420px, 100%); background: #FFFDF9; border: 1px solid #EADFCE;
  border-radius: 18px; padding: 22px;
  box-shadow: 0 24px 60px rgba(20, 15, 10, 0.35);
  animation: lat-in 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.lac-msg { font-size: 14.5px; font-weight: 600; line-height: 1.6; color: #2E2A26; white-space: pre-line; margin-bottom: 18px; }
.lac-row { display: flex; gap: 10px; justify-content: flex-end; }
.lac-btn {
  padding: 10px 18px; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 700;
  background: #F1E9DB; color: #2E2A26; border: 1px solid #DCCFB8; cursor: pointer;
}
.lac-btn:hover { background: #E9DEC9; }
.lac-yes { background: #C1694F; border-color: #C1694F; color: #fff; }
.lac-yes:hover { background: #9E4F38; }
[data-theme="dark"] .lac-box { background: #241C15; border-color: #4A3B2F; }
[data-theme="dark"] .lac-msg { color: #F4EFE7; }
[data-theme="dark"] .lac-btn { background: #3A2E24; color: #E9E0D1; border-color: #4A3B2F; }
[data-theme="dark"] .lac-btn:hover { background: #46382B; }
[data-theme="dark"] .lac-yes { background: #E8A68D; border-color: #E8A68D; color: #241C15; }
[data-theme="dark"] .lac-yes:hover { background: #F0B89F; }

.la-top {
  position: fixed; right: 18px; bottom: 20px; z-index: 90;
  width: 46px; height: 46px; border-radius: 999px;
  background: #2E2A26; color: #FDFBF7; border: 1px solid rgba(253, 251, 247, 0.2);
  font-size: 20px; font-weight: 800; cursor: pointer;
  box-shadow: 0 10px 26px rgba(20, 15, 10, 0.3);
  transition: transform 0.15s ease, opacity 0.2s ease;
}
.la-top:hover { transform: translateY(-3px); }
.la-top[hidden] { display: none; }
[data-theme="dark"] .la-top { background: #E8A68D; color: #241C15; border-color: transparent; }

@media (prefers-reduced-motion: reduce) {
  .lat-toast, .lac-box { animation: none; }
  .la-top { transition: none; }
}

/* ═══════════ IN ẤN (U5) — mang danh sách khám / lịch ngày đi in ═══════════ */
@media print {
  /* giấu mọi khung điều khiển — chỉ còn nội dung */
  la-header, la-footer, .la-toggles, .la-toggles-fixed, .la-top, .lat-wrap, .lac-backdrop,
  .las-backdrop, .lan-panel, .xnav-grid, .float-ico, .lux-blob, .blob, .ambient,
  button, .mo-reveal { display: none !important; }
  section[class*="mb-10"] > .xnav-grid { display: none !important; }
  body, main { background: #fff !important; color: #000 !important; }
  main { max-width: 100% !important; padding: 0 !important; }
  main * { box-shadow: none !important; }
  .mo-reveal { opacity: 1 !important; transform: none !important; display: revert !important; }
  a { color: #000 !important; text-decoration: none !important; }
  /* thẻ nội dung không bị cắt ngang trang giấy */
  .bg-white, [class*="rounded-2xl"], .mh-tile, .mbti-career-group { break-inside: avoid; }
}

/* ═══════════ TIẾN BỘ THEO THỜI GIAN (myhealth — Đợt C) ═══════════ */
.mh-trend-title { font-family: "Playfair Display", serif; font-size: 19px; font-weight: 700; margin-bottom: 14px; }
.mh-trend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .mh-trend-grid { grid-template-columns: 1fr; } }
.mh-trend-cell { background: rgba(156, 175, 136, 0.07); border: 1px solid #F1E9DB; border-radius: 14px; padding: 14px 16px; }
.mh-trend-label { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(46, 42, 38, 0.55); margin-bottom: 6px; }
.mh-trend-num { font-size: 13px; color: rgba(46, 42, 38, 0.7); margin-bottom: 8px; }
.mh-trend-num b {
  font-family: "Be Vietnam Pro", "Plus Jakarta Sans", sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 21px; font-weight: 800; color: #2E2A26; margin-right: 4px;
}
.mh-trend-delta { font-weight: 800; color: #9E4F38; font-variant-numeric: tabular-nums; }
.mh-spark { width: 100%; height: 56px; display: block; }
.mh-spark-w { color: #C1694F; }
.mh-spark-k { color: #759062; }
.mh-trend-note { font-size: 12.5px; color: rgba(46, 42, 38, 0.55); margin-top: 10px; line-height: 1.6; }
.mh-trend-note b { font-variant-numeric: tabular-nums; }
.mh-hb-bars { display: flex; gap: 5px; align-items: flex-end; height: 62px; margin-top: 6px; }
.mh-hb-col { flex: 1; height: 100%; display: flex; align-items: flex-end; background: rgba(46, 42, 38, 0.06); border-radius: 6px; overflow: hidden; }
.mh-hb-fill { width: 100%; background: #9CAF88; border-radius: 6px 6px 0 0; }
.mh-hb-col.today .mh-hb-fill { background: #C1694F; }
[data-theme="dark"] .mh-trend-cell { background: rgba(169, 199, 154, 0.06); border-color: #4A3B2F; }
[data-theme="dark"] .mh-trend-label, [data-theme="dark"] .mh-trend-note { color: #8E8574; }
[data-theme="dark"] .mh-trend-num { color: #B4A995; }
[data-theme="dark"] .mh-trend-num b { color: #F4EFE7; }
[data-theme="dark"] .mh-trend-delta { color: #E8A68D; }
[data-theme="dark"] .mh-spark-w { color: #E8A68D; }
[data-theme="dark"] .mh-spark-k { color: #A9C79A; }
[data-theme="dark"] .mh-hb-col { background: rgba(233, 224, 209, 0.07); }
[data-theme="dark"] .mh-hb-fill { background: #A9C79A; }
[data-theme="dark"] .mh-hb-col.today .mh-hb-fill { background: #E8A68D; }

/* Kéo-thả ảnh vào ô chụp thuốc — viền sáng lên khi rê tới */
.th-drop-hot { border-color: #C1694F !important; background: rgba(193, 105, 79, 0.08) !important; }
[data-theme="dark"] .th-drop-hot { border-color: #E8A68D !important; background: rgba(232, 166, 141, 0.1) !important; }

/* Màn "chưa nhận ra thuốc" — chip từ đọc được + link tra ngoài */
.th-guess-label { font-size: 12px; font-weight: 700; margin: 12px 0 6px; color: rgba(46, 42, 38, 0.6); }
.th-guess-chip { text-transform: uppercase; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.th-ext-link { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 700; color: #9E4F38; text-decoration: underline; }
[data-theme="dark"] .th-guess-label { color: #B4A995; }
[data-theme="dark"] .th-ext-link { color: #E8A68D; }

/* ═══ TRỢ LÝ AI (tha-) — thẻ cài đặt key + khung hỏi tiếp ═══ */
.tha-card { border-color: rgba(201, 168, 106, 0.45); }
.tha-h { font-weight: 700; font-size: 13.5px; margin: 10px 0 4px; color: #4a3f35; }
.tha-note { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(0, 0, 0, 0.15); font-size: 11.5px; line-height: 1.6; font-style: italic; opacity: 0.75; }
.tha-msgs { max-height: 380px; overflow-y: auto; display: grid; gap: 8px; padding: 4px 0; }
.tha-msgs:empty { display: none; }
.tha-m { border-radius: 14px; padding: 10px 12px; font-size: 13.5px; line-height: 1.65; max-width: 92%; }
.tha-m-u { background: rgba(193, 105, 79, 0.08); border: 1px solid rgba(193, 105, 79, 0.2); justify-self: end; }
.tha-m-b { background: rgba(156, 175, 136, 0.1); border: 1px solid rgba(156, 175, 136, 0.28); justify-self: start; }
.tha-m-err { background: rgba(180, 69, 50, 0.08); border-color: rgba(180, 69, 50, 0.4); color: #b44532; }
.tha-row { display: flex; gap: 8px; margin-top: 10px; align-items: stretch; }
.tha-q { flex: 1; min-height: 52px; resize: vertical; }
.tha-send { padding: 10px 18px; border-radius: 12px; background: #c1694f; color: #fff; font-weight: 600; font-size: 13.5px; border: 0; cursor: pointer; transition: background 0.2s; }
.tha-send:hover { background: #9e4f38; }
.tha-send:disabled { opacity: 0.5; cursor: wait; }
.mh-export-btn { padding: 10px 18px; border-radius: 12px; border: 1px solid rgba(193, 105, 79, 0.5); color: #a2503a; font-weight: 600; font-size: 13.5px; background: rgba(193, 105, 79, 0.06); cursor: pointer; min-height: 44px; transition: background 0.2s; }
.mh-export-btn:hover { background: rgba(193, 105, 79, 0.14); }
[data-theme="dark"] .mh-export-btn { color: #e8a98f; border-color: rgba(232, 169, 143, 0.4); background: rgba(232, 169, 143, 0.08); }
.tha-del { padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(180, 69, 50, 0.45); color: #b44532; font-weight: 600; font-size: 13px; background: transparent; cursor: pointer; }
.tha-attach { font-size: 12px; margin-top: 6px; }
.tha-attach-x { text-decoration: underline; font-weight: 600; cursor: pointer; background: none; border: 0; font-size: 12px; color: inherit; }
.tha-nudge { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(0, 0, 0, 0.12); }
.tha-key-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tha-key-row input { flex: 1; min-width: 200px; }
.tha-guide summary { font-size: 13px; font-weight: 600; cursor: pointer; color: #9e4f38; }
.tha-link { text-decoration: underline; font-weight: 600; color: #9e4f38; }
[data-theme="dark"] .tha-h { color: #e9e0d1; }
[data-theme="dark"] .tha-m-u { background: rgba(193, 105, 79, 0.16); border-color: rgba(193, 105, 79, 0.4); }
[data-theme="dark"] .tha-m-b { background: rgba(156, 175, 136, 0.12); border-color: rgba(156, 175, 136, 0.35); }
[data-theme="dark"] .tha-m-err { color: #e8a68d; }
[data-theme="dark"] .tha-note { border-top-color: rgba(255, 255, 255, 0.18); }
[data-theme="dark"] .tha-nudge { border-top-color: rgba(255, 255, 255, 0.15); }
[data-theme="dark"] .tha-guide summary, [data-theme="dark"] .tha-link { color: #e8a68d; }
[data-theme="dark"] .tha-del { color: #e8a68d; border-color: rgba(232, 166, 141, 0.45); }

/* ═══ PHIẾU TRƯỚC BUỔI TƯ VẤN (it-) ═══ */
.it-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: rgba(74, 63, 53, 0.6); margin: 2px 0 5px; }
.it-area { min-height: 62px; resize: vertical; margin-bottom: 12px; }
[data-theme="dark"] .it-label { color: rgba(233, 224, 209, 0.6); }

/* ═══ SKELETON — mount rỗng lấp lánh trong lúc chờ dữ liệu JSON ═══ */
main p[id$="-intro"]:empty, main p[id$="-disclaimer"]:empty, ul[id$="-howto"]:empty, div[id$="-chips"]:empty, #drug-browse:empty, #inter-picker:empty {
  min-height: 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.05) 25%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.05) 75%);
  background-size: 200% 100%;
  animation: la-skel 1.2s linear infinite;
}
ul[id$="-howto"]:empty, #drug-browse:empty, #inter-picker:empty { min-height: 48px; }
@keyframes la-skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
[data-theme="dark"] main p[id$="-intro"]:empty, [data-theme="dark"] main p[id$="-disclaimer"]:empty, [data-theme="dark"] ul[id$="-howto"]:empty, [data-theme="dark"] div[id$="-chips"]:empty, [data-theme="dark"] #drug-browse:empty, [data-theme="dark"] #inter-picker:empty {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
}
@media (prefers-reduced-motion: reduce) {
  main p[id$="-intro"]:empty, main p[id$="-disclaimer"]:empty, ul[id$="-howto"]:empty, div[id$="-chips"]:empty, #drug-browse:empty, #inter-picker:empty { animation: none; }
}

/* ═══ LỊCH UỐNG THUỐC (ts-) ═══ */
.ts-row { border: 1px dashed rgba(0, 0, 0, 0.15); border-radius: 12px; padding: 10px 12px; }
.ts-name { font-weight: 600; font-size: 13.5px; margin-bottom: 7px; }
[data-theme="dark"] .ts-row { border-color: rgba(255, 255, 255, 0.18); }
.ts-taken { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(0, 0, 0, 0.1); }
.ts-taken-lab { font-size: 12px; font-weight: 600; color: rgba(0, 0, 0, 0.5); }
.ts-tick { min-height: 34px; padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(60, 130, 90, 0.4); background: rgba(60, 130, 90, 0.06); color: #3c825a; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background 0.15s, transform 0.12s; }
.ts-tick:active { transform: scale(0.96); }
.ts-tick-on { background: #3c825a; border-color: #2f6a49; color: #fff; }
[data-theme="dark"] .ts-taken { border-top-color: rgba(255, 255, 255, 0.14); }
[data-theme="dark"] .ts-taken-lab { color: rgba(255, 255, 255, 0.55); }
[data-theme="dark"] .ts-tick { color: #8fd3ac; border-color: rgba(143, 211, 172, 0.4); background: rgba(143, 211, 172, 0.08); }
[data-theme="dark"] .ts-tick-on { background: #3c825a; border-color: #4f9e70; color: #fff; }

/* ═══ NÚT ÂM DẪN NHỊP (breathe) ═══ */
.br-sound { cursor: pointer; }

/* ═══ CHIP CÀI APP PWA (la-pwa) ═══ */
.la-pwa { position: fixed; left: 14px; bottom: 14px; z-index: 60; display: flex; align-items: stretch; gap: 6px; max-width: min(92vw, 420px); }
.la-pwa-go { border: none; cursor: pointer; border-radius: 999px; padding: 11px 16px; background: #2E2A26; color: #FAF6EF; font-size: 12.5px; font-weight: 600; line-height: 1.45; text-align: left; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28); }
.la-pwa-x { border: none; cursor: pointer; border-radius: 999px; width: 34px; background: #2E2A26; color: #FAF6EF; font-size: 13px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28); }
.la-pwa-go:hover, .la-pwa-x:hover { background: #46403A; }
[data-theme="dark"] .la-pwa-go, [data-theme="dark"] .la-pwa-x { background: #FAF6EF; color: #2E2A26; }
[data-theme="dark"] .la-pwa-go:hover, [data-theme="dark"] .la-pwa-x:hover { background: #E8DFD2; }

/* ═══ ĐA HỒ SƠ (pf-) ═══ */
.pf-del { padding-left: 9px; padding-right: 9px; color: #B23A48; }

/* ═══ NHẬT KÝ HUYẾT ÁP & ĐƯỜNG HUYẾT (B1) ═══ */
.bp-block { border: 1px dashed rgba(0, 0, 0, 0.12); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.bp-big { font-size: 22px; font-weight: 800; margin-top: 2px; }
.bp-unit { font-size: 12px; font-weight: 600; opacity: 0.6; }
.bp-cat { font-size: 13.5px; font-weight: 700; margin-top: 4px; }
.bp-spark { margin-top: 8px; }
.bp-src { font-style: italic; opacity: 0.85; }
[data-theme="dark"] .bp-block { border-color: rgba(255, 255, 255, 0.16); }

/* ═══ BÁO ĐANG OFFLINE (C2) ═══ */
.la-offline {
  position: fixed; left: 50%; bottom: 14px;
  transform: translateX(-50%) translateY(160%);
  z-index: 65; max-width: 92vw;
  padding: 9px 16px; border-radius: 999px;
  background: #7A4A2E; color: #FDF6EF;
  font-size: 12.5px; font-weight: 600; text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.3s ease; pointer-events: none;
}
.la-offline.show { transform: translateX(-50%) translateY(0); }

/* ═══ VÙNG CHẠM DỄ BẤM (C5) — tránh bấm nhầm trên điện thoại ═══ */
button, a, label, input, select, .mbti-chip, .th-chip { touch-action: manipulation; }
.mbti-chip, .th-chip { min-height: 40px; display: inline-flex; align-items: center; }

/* ═══ CHIP HAY CẦN NHẤT (C6) ═══ */
.fa-quick-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(45, 40, 37, 0.15); background: rgba(255, 255, 255, 0.8); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background 0.15s ease; touch-action: manipulation; }
.fa-quick-chip:hover { background: #F3E7D8; }
[data-theme="dark"] .fa-quick-chip { background: #26211A; border-color: #3B342A; color: #EAE2D4; }

/* ═══ IN POSTER SƠ CỨU DÁN TƯỜNG (C3) — chỉ khi bấm nút In (body.fa-print) ═══ */
@media print {
  body.fa-print * { visibility: hidden; }
  body.fa-print #fa-list, body.fa-print #fa-list * { visibility: visible; }
  body.fa-print #fa-list { position: absolute; left: 0; top: 0; width: 100%; }
  body.fa-print .fa-card { break-inside: avoid; page-break-inside: avoid; border: 1px solid #999; border-radius: 8px; margin-bottom: 10px; padding: 8px 10px; }
  body.fa-print .fa-chev, body.fa-print .fa-summary { list-style: none; }
  body.fa-print .fa-title { font-size: 17px; font-weight: 800; }
  body.fa-print .fa-steps, body.fa-print .fa-donts { font-size: 13px; }
  body.fa-print .fa-src { font-size: 11px; color: #333; }
}

/* ═══ IN BẢN TỔNG HỢP SỨC KHỎE CHO BÁC SĨ — chỉ khi bấm In (body.mh-print) ═══ */
#mh-print { position: absolute; left: -10000px; top: 0; } /* trên màn hình: đẩy ra ngoài, không display:none để in vẫn thấy */
@media print {
  body.mh-print * { visibility: hidden; }
  body.mh-print #mh-print, body.mh-print #mh-print * { visibility: visible; }
  body.mh-print #mh-print { left: 0; top: 0; width: 100%; padding: 0 4px; color: #111; }
  body.mh-print #mh-print h1 { font-size: 18px; font-weight: 800; margin: 0 0 12px; }
  body.mh-print #mh-print table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  body.mh-print #mh-print th, body.mh-print #mh-print td { border: 1px solid #999; padding: 4px 8px; text-align: left; }
  body.mh-print #mh-print thead th { background: #eee; }
  body.mh-print #mh-print tr { break-inside: avoid; page-break-inside: avoid; }
  body.mh-print .mh-print-src { font-size: 11px; color: #444; margin-top: 12px; }
}

/* ═══ IN CHỈ PHIẾU TƯ VẤN — khi bấm nút In phiếu (body.it-print) ═══ */
@media print {
  body.it-print * { visibility: hidden; }
  body.it-print #it-card, body.it-print #it-card * { visibility: visible; }
  body.it-print #it-card { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; border: 0; }
  body.it-print #it-card button { display: none; } /* ẩn nút Sao chép/In/Xóa trên bản in */
}

/* ═══ TỦ THUỐC THẬT + HẠN DÙNG (B2) ═══ */
.tc-row { display: flex; align-items: center; gap: 10px; border: 1px solid rgba(0, 0, 0, 0.10); border-radius: 12px; padding: 10px 12px; }
.tc-row.tc-expired { border-color: rgba(178, 58, 72, 0.55); background: rgba(178, 58, 72, 0.06); }
.tc-row.tc-soon { border-color: rgba(201, 130, 31, 0.5); background: rgba(201, 130, 31, 0.06); }
.tc-info { flex: 1; min-width: 0; }
.tc-name { font-weight: 600; font-size: 13.5px; }
.tc-meta { font-size: 12px; margin-top: 2px; }
.tc-badge { font-weight: 800; }
.tc-exp { opacity: 0.7; }
[data-theme="dark"] .tc-row { border-color: rgba(255, 255, 255, 0.14); }

/* ═══════════════════════════════════════════════════════════════
   VI CHẤT & HẤP THU — micro.js (Module 8). Accent xanh lá dinh dưỡng.
   ═══════════════════════════════════════════════════════════════ */
.mc-bionote { color: rgba(46, 42, 38, 0.6); }
.mc-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mc-cat { font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: rgba(79, 122, 70, 0.09); color: #3D6136; border: 1px solid rgba(79, 122, 70, 0.26); cursor: pointer; transition: background 0.13s ease; }
.mc-cat:hover { background: rgba(79, 122, 70, 0.18); }
.mc-cat.on { background: #4F7A46; color: #fff; border-color: #4F7A46; }
.mc-foods { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px dashed rgba(46, 42, 38, 0.14); }
.mc-food { font-size: 12.5px; font-weight: 600; padding: 6px 13px; border-radius: 10px; background: rgba(201, 168, 106, 0.1); color: #6B5836; border: 1px solid rgba(201, 168, 106, 0.28); cursor: pointer; transition: background 0.13s ease; }
.mc-food:hover { background: rgba(201, 168, 106, 0.22); }
.mc-food.on { background: #C9A86A; color: #2E2A26; border-color: #C9A86A; }
.mc-card-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.mc-name { font-family: "Playfair Display", serif; font-size: 1.3rem; font-weight: 700; color: #2E2A26; }
.mc-cat-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #4F7A46; background: rgba(79, 122, 70, 0.1); padding: 3px 10px; border-radius: 999px; }
.mc-per { font-size: 11.5px; color: rgba(46, 42, 38, 0.5); font-style: italic; margin: 2px 0 12px; }
.mc-macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.mc-macro { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 10px; background: rgba(46, 42, 38, 0.035); }
.mc-macro-v { font-size: 16px; font-weight: 800; color: #2E2A26; font-variant-numeric: tabular-nums; }
.mc-macro-v small { font-size: 10.5px; font-weight: 600; color: rgba(46, 42, 38, 0.5); }
.mc-macro-l { font-size: 11px; color: rgba(46, 42, 38, 0.6); }
.mc-gi-row { display: flex; gap: 8px; margin-bottom: 14px; }
.mc-gi-chip { font-size: 12px; font-weight: 600; color: rgba(46, 42, 38, 0.7); background: rgba(46, 42, 38, 0.05); padding: 5px 12px; border-radius: 999px; }
.mc-gi-chip b { color: #4F7A46; border-bottom: 1px dotted rgba(79, 122, 70, 0.5); cursor: help; }
.mc-tablewrap { overflow-x: auto; margin-bottom: 12px; }
.mc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mc-table th { text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: rgba(46, 42, 38, 0.5); padding: 6px 10px; border-bottom: 1.5px solid rgba(46, 42, 38, 0.12); white-space: nowrap; }
.mc-table th [data-term] { border-bottom: 1px dotted rgba(46, 42, 38, 0.4); cursor: help; }
.mc-table td { padding: 7px 10px; border-bottom: 1px solid rgba(46, 42, 38, 0.07); color: rgba(46, 42, 38, 0.85); }
.mc-td-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mc-abs { font-weight: 700; color: #4F7A46; }
.mc-na { color: rgba(46, 42, 38, 0.3); }
.mc-note { font-size: 12.5px; line-height: 1.6; color: rgba(46, 42, 38, 0.7); background: rgba(79, 122, 70, 0.06); border-left: 3px solid rgba(79, 122, 70, 0.4); border-radius: 8px; padding: 8px 11px; margin: 10px 0; }
.mc-src { font-size: 11.5px; color: rgba(46, 42, 38, 0.55); margin-top: 8px; }
.mc-src span { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 10.5px; }
.mc-rev-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: rgba(46, 42, 38, 0.55); margin-bottom: 6px; }
.mc-select { width: 100%; max-width: 320px; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.mc-rev-explain { font-size: 12.5px; line-height: 1.6; color: rgba(46, 42, 38, 0.72); margin: 14px 0 6px; }
.mc-rev-explain b { color: #4F7A46; }
.mc-rev-explain [data-term] { border-bottom: 1px dotted rgba(79, 122, 70, 0.5); cursor: help; }
.mc-rev-flag { color: #A65A2E; background: rgba(201, 120, 60, 0.08); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.mc-rev-bionote { font-size: 12px; line-height: 1.6; color: rgba(46, 42, 38, 0.6); font-style: italic; margin-bottom: 12px; }
.mc-rev-list { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.mc-rev-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(46, 42, 38, 0.03); border: 1px solid rgba(46, 42, 38, 0.06); }
.mc-rev-rank { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #4F7A46; color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.mc-rev-main { flex: 1; min-width: 0; }
.mc-rev-topline { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mc-rev-food { font-size: 14px; font-weight: 700; color: #2E2A26; }
.mc-rev-cat { font-size: 10.5px; color: rgba(46, 42, 38, 0.5); white-space: nowrap; }
.mc-rev-bar { height: 7px; border-radius: 999px; background: rgba(79, 122, 70, 0.12); overflow: hidden; margin: 6px 0 6px; }
.mc-rev-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6FA05F, #4F7A46); }
.mc-rev-nums { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 12px; }
.mc-rev-abs { color: rgba(46, 42, 38, 0.75); }
.mc-rev-abs b { font-size: 14px; font-weight: 800; color: #4F7A46; font-variant-numeric: tabular-nums; }
.mc-rev-detail { font-size: 11.5px; color: rgba(46, 42, 38, 0.55); font-variant-numeric: tabular-nums; }
[data-theme="dark"] .mc-bionote { color: rgba(233, 227, 214, 0.6); }
[data-theme="dark"] .mc-cat { background: rgba(122, 168, 110, 0.12); color: #A6C79C; border-color: rgba(122, 168, 110, 0.3); }
[data-theme="dark"] .mc-cat:hover { background: rgba(122, 168, 110, 0.22); }
[data-theme="dark"] .mc-cat.on { background: #5B8C5A; color: #14160F; border-color: #5B8C5A; }
[data-theme="dark"] .mc-foods { border-bottom-color: rgba(255, 255, 255, 0.12); }
[data-theme="dark"] .mc-food { background: rgba(201, 168, 106, 0.12); color: #E4C892; border-color: rgba(228, 200, 146, 0.28); }
[data-theme="dark"] .mc-food:hover { background: rgba(201, 168, 106, 0.24); }
[data-theme="dark"] .mc-food.on { background: #C9A86A; color: #2A211A; border-color: #C9A86A; }
[data-theme="dark"] .mc-name, [data-theme="dark"] .mc-macro-v { color: #EBE3D6; }
[data-theme="dark"] .mc-cat-tag { color: #A6C79C; background: rgba(122, 168, 110, 0.14); }
[data-theme="dark"] .mc-per { color: rgba(233, 227, 214, 0.5); }
[data-theme="dark"] .mc-macro { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .mc-macro-v small, [data-theme="dark"] .mc-macro-l { color: rgba(233, 227, 214, 0.55); }
[data-theme="dark"] .mc-gi-chip { color: rgba(233, 227, 214, 0.72); background: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .mc-gi-chip b, [data-theme="dark"] .mc-abs, [data-theme="dark"] .mc-rev-explain b, [data-theme="dark"] .mc-rev-abs b { color: #7FBEA0; }
[data-theme="dark"] .mc-table th { color: rgba(233, 227, 214, 0.5); border-bottom-color: rgba(255, 255, 255, 0.14); }
[data-theme="dark"] .mc-table td { color: rgba(233, 227, 214, 0.82); border-bottom-color: rgba(255, 255, 255, 0.07); }
[data-theme="dark"] .mc-na { color: rgba(233, 227, 214, 0.3); }
[data-theme="dark"] .mc-note { color: rgba(233, 227, 214, 0.72); background: rgba(122, 168, 110, 0.09); border-left-color: rgba(122, 168, 110, 0.5); }
[data-theme="dark"] .mc-src, [data-theme="dark"] .mc-rev-bionote { color: rgba(233, 227, 214, 0.55); }
[data-theme="dark"] .mc-rev-label { color: rgba(233, 227, 214, 0.55); }
[data-theme="dark"] .mc-rev-explain { color: rgba(233, 227, 214, 0.72); }
[data-theme="dark"] .mc-rev-flag { color: #E0A188; background: rgba(224, 161, 136, 0.1); }
[data-theme="dark"] .mc-rev-row { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.07); }
[data-theme="dark"] .mc-rev-rank { background: #5B8C5A; color: #14160F; }
[data-theme="dark"] .mc-rev-food { color: #EBE3D6; }
[data-theme="dark"] .mc-rev-cat, [data-theme="dark"] .mc-rev-detail { color: rgba(233, 227, 214, 0.5); }
[data-theme="dark"] .mc-rev-abs { color: rgba(233, 227, 214, 0.75); }
[data-theme="dark"] .mc-rev-bar { background: rgba(122, 168, 110, 0.15); }
[data-theme="dark"] .mc-rev-fill { background: linear-gradient(90deg, #7FBEA0, #5B8C5A); }
.mc-rev-abs-l { margin-left: 5px; }
[data-theme="dark"] .mc-rev-abs-l { color: rgba(233, 227, 214, 0.75); }

/* ═══════════════════════════════════════════════════════════════
   XỬ TRÍ TRIỆU CHỨNG — trieuchung.js (Module 9). Màu phân tầng đỏ/hổ phách/xanh.
   ═══════════════════════════════════════════════════════════════ */
.tt-howto { color: #A05A2C; background: rgba(224, 138, 60, 0.09); border-left: 3px solid rgba(224, 138, 60, 0.5); border-radius: 8px; padding: 8px 12px; }
.tt-pick-lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: rgba(46, 42, 38, 0.55); margin-bottom: 12px; }
.tt-sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.tt-sym { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border-radius: 14px; background: rgba(62, 124, 116, 0.06); border: 1px solid rgba(62, 124, 116, 0.22); cursor: pointer; transition: background 0.13s ease, transform 0.1s ease; text-align: center; }
.tt-sym:hover { background: rgba(62, 124, 116, 0.14); transform: translateY(-1px); }
.tt-sym-ico { font-size: 26px; line-height: 1; }
.tt-sym-name { font-size: 13px; font-weight: 600; color: #2E4A52; }
.tt-step-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tt-sym-title { font-family: "Playfair Display", serif; font-size: 1.35rem; font-weight: 700; color: #2E2A26; }
.tt-crumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.tt-crumb { font-size: 11px; font-weight: 600; color: #4E7A46; background: rgba(91, 140, 90, 0.12); padding: 3px 9px; border-radius: 999px; }
/* màn hỏi */
.tt-screen { border-radius: 14px; padding: 16px; border: 1px solid; }
.tt-screen-red { background: rgba(193, 105, 79, 0.06); border-color: rgba(193, 105, 79, 0.3); }
.tt-screen-amber { background: rgba(224, 138, 60, 0.06); border-color: rgba(224, 138, 60, 0.3); }
.tt-screen-h { font-family: "Playfair Display", serif; font-size: 1.08rem; font-weight: 700; color: #2E2A26; margin-bottom: 10px; }
.tt-list { list-style: none; display: grid; gap: 6px; margin: 0 0 14px; padding: 0; }
.tt-list li { position: relative; padding-left: 22px; font-size: 13.5px; line-height: 1.55; color: rgba(46, 42, 38, 0.85); }
.tt-list li::before { position: absolute; left: 0; top: 1px; font-size: 13px; }
.tt-list-red li::before { content: "🚩"; }
.tt-list-amber li::before { content: "•"; color: #E08A3C; font-weight: 900; left: 6px; }
.tt-list-green li::before { content: "✓"; color: #5B8C5A; font-weight: 900; }
.tt-q { font-size: 14.5px; font-weight: 700; color: #2E2A26; margin-bottom: 12px; }
.tt-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.tt-choice { flex: 1; min-width: 160px; font-size: 14px; font-weight: 700; padding: 13px 16px; border-radius: 12px; cursor: pointer; border: 1.5px solid; transition: transform 0.1s ease, background 0.13s ease; }
.tt-choice:hover { transform: translateY(-1px); }
.tt-choice-yes { background: rgba(193, 105, 79, 0.12); color: #A8412C; border-color: rgba(193, 105, 79, 0.5); }
.tt-choice-yes:hover { background: rgba(193, 105, 79, 0.2); }
.tt-choice-no { background: #fff; color: rgba(46, 42, 38, 0.7); border-color: rgba(46, 42, 38, 0.2); }
.tt-choice-no:hover { background: rgba(46, 42, 38, 0.04); }
/* kết quả */
.tt-result { border-radius: 14px; padding: 18px; border: 1.5px solid; }
.tt-res-red { background: rgba(178, 58, 72, 0.08); border-color: rgba(178, 58, 72, 0.5); }
.tt-res-amber { background: rgba(224, 138, 60, 0.08); border-color: rgba(224, 138, 60, 0.5); }
.tt-res-green { background: rgba(91, 140, 90, 0.08); border-color: rgba(91, 140, 90, 0.45); }
.tt-res-title { font-family: "Playfair Display", serif; font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.tt-res-red .tt-res-title { color: #B23A48; }
.tt-res-amber .tt-res-title { color: #C0722C; }
.tt-res-green .tt-res-title { color: #4E7A46; }
.tt-res-action { font-size: 14px; line-height: 1.6; font-weight: 600; color: #2E2A26; margin-bottom: 12px; }
.tt-res-red .tt-res-action { font-size: 15px; }
.tt-res-lbl { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: rgba(46, 42, 38, 0.55); margin-bottom: 6px; }
.tt-safety { font-size: 12.5px; line-height: 1.6; color: rgba(46, 42, 38, 0.72); background: rgba(46, 42, 38, 0.04); border-radius: 8px; padding: 9px 12px; margin-top: 12px; }
.tt-src { font-size: 11.5px; color: rgba(46, 42, 38, 0.55); margin: 12px 0 4px; }
.tt-src span { font-weight: 700; }
.tt-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.tt-btn-ghost { font-size: 12.5px; font-weight: 600; padding: 8px 14px; border-radius: 10px; background: transparent; color: rgba(46, 42, 38, 0.65); border: 1px solid rgba(46, 42, 38, 0.18); cursor: pointer; transition: background 0.13s ease; }
.tt-btn-ghost:hover { background: rgba(46, 42, 38, 0.05); }
/* dark */
[data-theme="dark"] .tt-howto { color: #E0A188; background: rgba(224, 161, 136, 0.1); border-left-color: rgba(224, 161, 136, 0.5); }
[data-theme="dark"] .tt-pick-lbl, [data-theme="dark"] .tt-res-lbl { color: rgba(233, 227, 214, 0.55); }
[data-theme="dark"] .tt-sym { background: rgba(127, 190, 178, 0.1); border-color: rgba(127, 190, 178, 0.28); }
[data-theme="dark"] .tt-sym:hover { background: rgba(127, 190, 178, 0.2); }
[data-theme="dark"] .tt-sym-name { color: #9CC3D8; }
[data-theme="dark"] .tt-sym-title, [data-theme="dark"] .tt-screen-h, [data-theme="dark"] .tt-q, [data-theme="dark"] .tt-res-action { color: #EBE3D6; }
[data-theme="dark"] .tt-crumb { color: #A6C79C; background: rgba(122, 168, 110, 0.16); }
[data-theme="dark"] .tt-screen-red { background: rgba(232, 130, 143, 0.08); border-color: rgba(232, 130, 143, 0.35); }
[data-theme="dark"] .tt-screen-amber { background: rgba(224, 161, 136, 0.08); border-color: rgba(224, 161, 136, 0.35); }
[data-theme="dark"] .tt-list li { color: rgba(233, 227, 214, 0.82); }
[data-theme="dark"] .tt-choice-yes { background: rgba(232, 130, 143, 0.14); color: #E8828F; border-color: rgba(232, 130, 143, 0.5); }
[data-theme="dark"] .tt-choice-no { background: rgba(255, 255, 255, 0.04); color: rgba(233, 227, 214, 0.7); border-color: rgba(255, 255, 255, 0.2); }
[data-theme="dark"] .tt-choice-no:hover { background: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .tt-res-red { background: rgba(232, 130, 143, 0.1); border-color: rgba(232, 130, 143, 0.5); }
[data-theme="dark"] .tt-res-amber { background: rgba(224, 161, 136, 0.1); border-color: rgba(224, 161, 136, 0.5); }
[data-theme="dark"] .tt-res-green { background: rgba(122, 168, 110, 0.1); border-color: rgba(122, 168, 110, 0.45); }
[data-theme="dark"] .tt-res-red .tt-res-title { color: #E8828F; }
[data-theme="dark"] .tt-res-amber .tt-res-title { color: #E0A188; }
[data-theme="dark"] .tt-res-green .tt-res-title { color: #A6C79C; }
[data-theme="dark"] .tt-safety { color: rgba(233, 227, 214, 0.72); background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .tt-src { color: rgba(233, 227, 214, 0.55); }
[data-theme="dark"] .tt-btn-ghost { color: rgba(233, 227, 214, 0.65); border-color: rgba(255, 255, 255, 0.18); }
[data-theme="dark"] .tt-btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }

/* ═══════════════════════════════════════════════════════════════
   GHI CHÚ TÍNH KHOA HỌC MBTI — mbti-validity.js (Module 10). Tông học thuật slate.
   ═══════════════════════════════════════════════════════════════ */
.mv-card { background: rgba(74, 85, 104, 0.05); border: 1px solid rgba(74, 85, 104, 0.22); border-left: 4px solid #5A6B87; border-radius: 14px; overflow: hidden; }
.mv-sum { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; font-weight: 700; }
.mv-sum::-webkit-details-marker { display: none; }
.mv-sum::after { content: "▸"; margin-left: auto; color: rgba(74, 85, 104, 0.6); font-size: 14px; transition: transform 0.15s ease; }
.mv-card[open] .mv-sum::after { transform: rotate(90deg); }
.mv-badge { font-size: 20px; line-height: 1; }
.mv-sum-t { font-family: "Playfair Display", serif; font-size: 1.05rem; color: #3A4A63; }
.mv-body { padding: 0 16px 16px; }
.mv-lead { font-size: 13px; line-height: 1.7; color: rgba(46, 42, 38, 0.75); margin-bottom: 12px; }
.mv-list { list-style: none; display: grid; gap: 12px; margin: 0; padding: 0; }
.mv-point { padding-left: 14px; border-left: 2px solid rgba(90, 107, 135, 0.28); }
.mv-pt-title { font-size: 13.5px; font-weight: 700; color: #2E2A26; margin-bottom: 2px; }
.mv-pt-body { font-size: 13px; line-height: 1.65; color: rgba(46, 42, 38, 0.78); }
.mv-pt-src { font-size: 11px; color: rgba(46, 42, 38, 0.5); margin-top: 3px; font-style: italic; }
.mv-pt-src span { font-weight: 700; font-style: normal; text-transform: uppercase; letter-spacing: 0.03em; }
.mv-framing { font-size: 12.5px; line-height: 1.7; color: #3A4A63; background: rgba(90, 107, 135, 0.08); border-radius: 8px; padding: 10px 12px; margin-top: 14px; }
/* dark */
[data-theme="dark"] .mv-card { background: rgba(140, 158, 190, 0.08); border-color: rgba(140, 158, 190, 0.24); border-left-color: #8C9EBE; }
[data-theme="dark"] .mv-sum-t { color: #B9C6DD; }
[data-theme="dark"] .mv-sum::after { color: rgba(185, 198, 221, 0.6); }
[data-theme="dark"] .mv-lead { color: rgba(233, 227, 214, 0.75); }
[data-theme="dark"] .mv-point { border-left-color: rgba(140, 158, 190, 0.3); }
[data-theme="dark"] .mv-pt-title { color: #EBE3D6; }
[data-theme="dark"] .mv-pt-body { color: rgba(233, 227, 214, 0.78); }
[data-theme="dark"] .mv-pt-src { color: rgba(233, 227, 214, 0.5); }
[data-theme="dark"] .mv-framing { color: #B9C6DD; background: rgba(140, 158, 190, 0.1); }

/* ═══════════════════════════════════════════════════════════════
   BIỂU ĐỒ THAM KHẢO NGỦ & VẬN ĐỘNG — wellness-chart.js (Module 11).
   ═══════════════════════════════════════════════════════════════ */
.wc-card { background: #fff; border: 1px solid var(--creamdark, #E7DCC8); border-radius: 16px; padding: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.wc-head { display: flex; align-items: center; gap: 9px; }
.wc-badge { font-size: 20px; line-height: 1; }
.wc-title { font-family: "Playfair Display", serif; font-size: 1.2rem; font-weight: 700; color: #2E2A26; }
.wc-sub { font-size: 12.5px; line-height: 1.6; color: rgba(46, 42, 38, 0.6); margin: 4px 0 16px; }
.wc-block { padding-top: 14px; margin-top: 6px; border-top: 1px dashed rgba(46, 42, 38, 0.12); }
.wc-block:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.wc-h { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: #2E2A26; margin-bottom: 12px; }
.wc-row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px; margin-bottom: 9px; }
.wc-row-lbl { font-size: 12px; font-weight: 700; color: rgba(46, 42, 38, 0.62); font-variant-numeric: tabular-nums; }
.wc-track { position: relative; height: 11px; border-radius: 999px; background: rgba(46, 42, 38, 0.07); overflow: hidden; }
.wc-fill { position: absolute; top: 0; height: 100%; border-radius: 999px; }
.wc-sleep { background: linear-gradient(90deg, #6D77B0, #4E5A96); }
.wc-mod { background: linear-gradient(90deg, #6FA05F, #4F7A46); }
.wc-vig { background: linear-gradient(90deg, #E0A24C, #D07E2C); }
.wc-step { background: linear-gradient(90deg, #5AA6A0, #3E7C74); }
.wc-row-val { font-size: 12px; font-weight: 600; color: rgba(46, 42, 38, 0.82); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wc-u { font-size: 10.5px; font-weight: 500; color: rgba(46, 42, 38, 0.5); }
.wc-axis { display: flex; justify-content: space-between; margin: 2px 0 4px 62px; font-size: 10px; color: rgba(46, 42, 38, 0.45); font-variant-numeric: tabular-nums; position: relative; }
.wc-axis-u { position: absolute; right: -2px; top: 12px; }
.wc-strength { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(46, 42, 38, 0.78); margin-top: 12px; }
.wc-chip { font-size: 11px; font-weight: 700; color: #4F7A46; background: rgba(79, 122, 70, 0.12); padding: 3px 10px; border-radius: 999px; }
.wc-src { font-size: 11px; color: rgba(46, 42, 38, 0.5); margin-top: 10px; }
.wc-src span { font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
/* dark */
[data-theme="dark"] .wc-card { background: #2A211A; border-color: #4A3B2F; }
[data-theme="dark"] .wc-title, [data-theme="dark"] .wc-h { color: #EBE3D6; }
[data-theme="dark"] .wc-sub { color: rgba(233, 227, 214, 0.6); }
[data-theme="dark"] .wc-block { border-top-color: rgba(255, 255, 255, 0.12); }
[data-theme="dark"] .wc-row-lbl { color: rgba(233, 227, 214, 0.62); }
[data-theme="dark"] .wc-track { background: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .wc-row-val { color: rgba(233, 227, 214, 0.82); }
[data-theme="dark"] .wc-u, [data-theme="dark"] .wc-axis { color: rgba(233, 227, 214, 0.45); }
[data-theme="dark"] .wc-strength { color: rgba(233, 227, 214, 0.78); }
[data-theme="dark"] .wc-chip { color: #A6C79C; background: rgba(122, 168, 110, 0.16); }
[data-theme="dark"] .wc-src { color: rgba(233, 227, 214, 0.5); }

/* ═══════════════════════════════════════════════════════════════
   ĐƯỜNG TĂNG TRƯỞNG TRẺ EM — growth.js (Module 12).
   ═══════════════════════════════════════════════════════════════ */
.gr-sexrow { display: flex; justify-content: flex-start; margin-bottom: 14px; }
.gr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 6px; }
.gr-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: rgba(46, 42, 38, 0.6); }
.gr-result { margin-top: 14px; }
.gr-hint { font-size: 13px; color: rgba(46, 42, 38, 0.55); font-style: italic; padding: 6px 0; }
.gr-outrange { font-size: 13px; line-height: 1.65; color: #A05A2C; background: rgba(224, 138, 60, 0.09); border-left: 3px solid rgba(224, 138, 60, 0.5); border-radius: 8px; padding: 10px 13px; }
.gr-verdict { border: 1px solid; border-radius: 12px; padding: 16px; }
.gr-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.gr-num { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 10px; background: rgba(46, 42, 38, 0.035); }
.gr-num-v { font-size: 19px; font-weight: 800; color: #2E2A26; font-variant-numeric: tabular-nums; }
.gr-num-l { font-size: 10.5px; color: rgba(46, 42, 38, 0.55); text-transform: uppercase; letter-spacing: 0.03em; }
.gr-label { font-family: "Playfair Display", serif; font-size: 1.2rem; font-weight: 700; text-align: center; margin: 4px 0 14px; }
.gr-bar { position: relative; display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin-bottom: 4px; }
.gr-seg { display: block; height: 100%; }
.gr-marker { position: absolute; top: -4px; width: 3px; height: 20px; background: #2E2A26; border-radius: 2px; transform: translateX(-50%); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.gr-scale { display: flex; justify-content: space-between; font-size: 10px; color: rgba(46, 42, 38, 0.45); font-variant-numeric: tabular-nums; margin-bottom: 12px; }
.gr-note { font-size: 12.5px; line-height: 1.6; color: rgba(46, 42, 38, 0.7); background: rgba(91, 141, 184, 0.07); border-left: 3px solid rgba(91, 141, 184, 0.4); border-radius: 8px; padding: 8px 11px; margin: 4px 0 10px; }
.gr-src { font-size: 11.5px; color: rgba(46, 42, 38, 0.55); }
.gr-src span { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 10.5px; }
.gr-export { width: 100%; margin-top: 12px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid rgba(46, 42, 38, 0.15); font-weight: 600; font-size: 13.5px; color: rgba(46, 42, 38, 0.8); cursor: pointer; transition: background 0.13s ease; }
.gr-export:hover { background: rgba(46, 42, 38, 0.04); }
/* dark */
[data-theme="dark"] .gr-field { color: rgba(233, 227, 214, 0.6); }
[data-theme="dark"] .gr-outrange { color: #E0A188; background: rgba(224, 161, 136, 0.1); border-left-color: rgba(224, 161, 136, 0.5); }
[data-theme="dark"] .gr-num { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .gr-num-v { color: #EBE3D6; }
[data-theme="dark"] .gr-num-l, [data-theme="dark"] .gr-scale { color: rgba(233, 227, 214, 0.5); }
[data-theme="dark"] .gr-note { color: rgba(233, 227, 214, 0.72); background: rgba(127, 160, 190, 0.1); border-left-color: rgba(127, 160, 190, 0.5); }
[data-theme="dark"] .gr-src { color: rgba(233, 227, 214, 0.55); }
[data-theme="dark"] .gr-marker { background: #EBE3D6; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5); }
[data-theme="dark"] .gr-export { background: #2A211A; border-color: #4A3B2F; color: rgba(233, 227, 214, 0.8); }
[data-theme="dark"] .gr-export:hover { background: #33281f; }
