/* ===== AI SAMPLE – NAMESPACE RIÊNG ===== */
.mon-ai-samples {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* BOX CHUNG */
.mon-ai-box {
  border-radius: 10px;
  padding: 16px 18px;
  line-height: 1.6;
  position: relative;
}

/* HEADER */
.mon-ai-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.mon-ai-title {
  font-weight: 700;
  font-size: 16px;
}

.mon-ai-time {
  font-size: 13px;
  color: #666;
}

.mon-ai-play {
  margin-left: auto;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
}

/* ANSWER TEXT */
.mon-ai-answer {
  font-size: 15px;
  color: #111;
  margin-bottom: 12px;
}

/* ===== EXPERT STYLE ===== */
.mon-ai-expert {
  background: #f0f7ff;
  border: 1px solid #b7d9ff;
}

.mon-ai-expert .mon-ai-title {
  color: #0b5ed7;
}

/* ===== BASED STYLE ===== */
.mon-ai-based {
  background: #fff6ec;
  border: 1px solid #ffd7a3;
}

.mon-ai-based .mon-ai-title {
  color: #c77700;
}

/* ===== PHRASE TABLE ===== */
.mon-ai-phrase-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.mon-ai-phrase-table th {
  text-align: left;
  background: #fafafa;
  border-bottom: 1px solid #ddd;
  padding: 8px;
}

.mon-ai-phrase-table td {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

/* ===============================
   AI LOADING – PROGRESS STYLE
================================ */

.ai-loading.ai-progress {
  max-width: 520px;
  margin: 24px auto;
  padding: 24px 20px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
  text-align: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto;
  animation: aiFadeIn .35s ease-out both;
}

/* ===============================
   % TEXT
================================ */

.ai-loading .ai-percent {
  font-size: 22px;
  font-weight: 600;
  color: #d92d2d;
  margin-bottom: 14px;
}

.ai-loading .ai-percent-num {
  font-size: 28px;
  font-weight: 700;
}

/* ===============================
   PROGRESS BAR
================================ */

.ai-loading .ai-bar {
  width: 100%;
  height: 12px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}

.ai-loading .ai-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    #ff4d4f,
    #ff7875,
    #ff4d4f
  );
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width .45s cubic-bezier(.4,0,.2,1);
  animation: ai-bar-shimmer 1.6s linear infinite;
}

/* ===============================
   DESCRIPTION TEXT
================================ */

.ai-loading .ai-text {
  font-size: 15px;
  color: #555;
  line-height: 1.5;
}

/* ===============================
   ANIMATIONS
================================ */

@keyframes ai-bar-shimmer {
  0%   { background-position:   0% 0%; }
  100% { background-position: 200% 0%; }
}

@keyframes aiFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===============================
   TOEIC Speaking Layout
   =============================== */

.toeic-controls .toeic-relisten-btn {
  background: #4f46e5;
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.toeic-controls .toeic-relisten-btn:hover {
  background: #4338ca;
  color: #fff;
}

.toeic-debug {
  margin-top: 16px;
  background: #6b7280;
  color: #fff;
}
.toeic-debug:hover { background: #4b5563; }

/* ===== Sóng âm khi ghi âm (Recording Wave) ===== */
.toeic-rec-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-left: 10px;
  vertical-align: middle;
}

.mon-pro-wave {
  width: 30px;
  height: 18px;
  overflow: hidden;
}

.toeic-timer {
  font-weight: 600;
  font-size: 15px;
  color: #374151;
  min-width: 30px;
}

/* [V3.1] Highlight màu */

#toeic-colored h3, #toeic-feedback h3 {
  margin-top: 20px;
  font-size: 20px;
  font-weight: 600;
  color: #000;
  padding-left: 8px;
}

#toeic-colored .toeic-original {
  background: #f9fafb;
  padding: 10px 12px;
  border-radius: 6px;
  font-style: italic;
}

#toeic-colored .toeic-colored-text {
  padding: 10px 12px;
  border-radius: 6px;
}

#toeic-feedback {
  background: #f8fafc;
  padding: 12px 14px;
  border-radius: 6px;
  margin-top: 10px;
  border-left: 3px solid #3b82f6;
  margin-bottom: 120px;
}

.toeic-response {
  background: #fdd2e2;
  padding: 12px 14px;
  border-radius: 6px;
  margin-top: 10px;
  border-left: 3px solid #ff0000;
}

.correct { color:#16a34a; font-weight:500; }
.word-ipa { color:#555; font-size:0.9em; margin-left:4px; }
.ai-word[data-type="missing"] { background: #e0f2ff; border-bottom: 2px dotted #2196f3; }
.ai-word[data-type="suggest"] { background: #e6ffe6; border-bottom: 2px solid #009900; }

.wrong-light {
  background-color: #fff3cd;  /* vàng nhạt */
  border-bottom: 2px dashed #f0ad4e;
  padding: 0 2px;
  border-radius: 3px;
  cursor: pointer;
  transition: background .2s;
}
.wrong-light:hover {
  background-color: #ffe082;
}
.wrong-original {  
  color: #ff0000;
  font-weight: 600;
}

.wrong-heavy {
  background-color: #d69da1;  /* đỏ nhạt */
  color: #000000;
  font-weight: 600;
  border-bottom: 2px solid #f44336;
  padding: 0 2px;
  border-radius: 3px;
  cursor: pointer;
  transition: background .2s;
}
.wrong-heavy:hover {
  background-color: #ffcdd2;
}

/* [V3.1] Popup luyện lại từ sai của AI (class tách riêng, không trùng popup voice) */

.toeic-word-popup .popup-status { margin-top:8px; font-size:14px; color:#444; min-height:20px; }
.toeic-word-popup .popup-status .wave { display:inline-block; width:10px; height:10px; background:#2563eb;
  border-radius:50%; margin-right:6px; vertical-align:middle; transition:opacity 0.3s; }
.toeic-word-popup .popup-status .time { font-weight:600; }
.toeic-word-popup .popup-status .done { color:#16a34a; font-weight:600; }

.toeic-word-popup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
}
.toeic-word-popup {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #fff; border-radius: 12px;
  padding: 18px 22px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  z-index: 9999; width: 260px;
}
.toeic-word-popup h3 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.toeic-word-popup .ipa { color: #2563eb; font-weight: 600; margin: 0 0 14px; }
.toeic-word-popup .word-popup-btns button {
  margin: 4px; padding: 8px 10px;
  border: none; border-radius: 6px;
  color: #fff; font-weight: 600;
  cursor: pointer; font-size: 14px;
}
.toeic-word-popup .popup-play-mine { background: #6b4dfc; }
.toeic-word-popup .popup-play-right { background: #4f46e5; }
.toeic-word-popup .popup-record { background: #0ea5e9; }
.toeic-word-popup .popup-close { background: #999; color:#fff; border-radius:50%; padding:4px 8px; }

/* Wrapper */
.toeic-wrapper {
  margin:0px auto;
  max-width: 1200px; /* giữ max width đồng bộ với theme */
  width: 100%;       /* để không bị co lại */
}

/* Nút Record đang ghi */
#toeic-record.recording {
  background:#dc2626 !important;
  border-color:#b91c1c !important;
  color:#fff;
}
.toeic-timer { margin-left:8px; font-weight:700; color:#dc2626; }
.toeic-preview { margin-top: 12px; display:block; }

/* Tabs trên cùng */
.toeic-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.toeic-tabs .tab {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  text-decoration: none;
  color: #111;
  font-weight: 500;
  transition: all 0.2s;
}
.toeic-tabs .tab:hover {
  background: #f3f4f6;
}
.toeic-tabs .tab.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* Layout chính: sidebar + main */
.toeic-layout {
  display: grid;
  grid-template-columns: 300px 1fr; /* Sidebar 300px, main chiếm hết phần còn lại */
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  min-height: 500px;
}


/* Sidebar Task */
.toeic-sidebar {
  border-right: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 16px;
    /* thêm 2 dòng này */
  max-height: 600px;      /* hoặc vh = % chiều cao màn hình */
  overflow-y: auto;       /* bật scroll dọc */
}

/* Optional: custom scrollbar cho pro hơn */
.toeic-sidebar::-webkit-scrollbar {
  width: 8px;
}
.toeic-sidebar::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 8px;
}
.toeic-sidebar::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 8px;
}
.toeic-sidebar::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

.toeic-task {
  margin-bottom: 18px;
}
.toeic-task h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #6b7280;
  text-transform: uppercase;
}
.toeic-task ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toeic-task li {
  margin-bottom: 6px;
}
.toeic-task .toeic-qbtn {
  width: 100%;
  text-align: center;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  transition: all 0.2s;
}
.toeic-task .toeic-qbtn:hover {
  background: #f3f4f6;
}
.toeic-task .toeic-qbtn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* Lock state */
.toeic-task.is-locked h4 {
  color: #94a3b8;
}
.mon-toeic-lock-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 5px;
  color: #94a3b8;
}
.toeic-task .toeic-qbtn.is-locked {
  color: #94a3b8;
  cursor: pointer;
  background: #f8fafc;
  border-color: #e2e8f0;
}
.toeic-task .toeic-qbtn.is-locked:hover {
  background: #f1f5f9;
  color: #64748b;
}

/* Free badge */
.mon-toeic-free-badge {
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: #22c55e;
  border-radius: 999px;
  padding: 2px 7px;
  line-height: 1.5;
}
.toeic-task.is-free h4 {
  color: inherit;
}
.toeic-task.is-free .toeic-qbtn {
  color: #111827;
}

/* Mon VIP Pro Lock Popup */
.mon-pro-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,.6);
  backdrop-filter: blur(4px);
  z-index: 99998;
}
.mon-pro-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  z-index: 99999;
  width: min(880px, calc(100% - 32px));
  background: #fff;
  color: #0f172a;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(2,6,23,.35);
  overflow: hidden;
  opacity: 0;
  transition: opacity .32s ease-out, transform .32s ease-out;
}
.mon-pro-head {
  padding: 24px 28px 16px;
  background: linear-gradient(120deg,#e0f2fe,#fef3c7);
  border-bottom: 1px solid #e2e8f0;
  position: relative;
}
.mon-pro-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7c2d12;
  background: #ffedd5;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  padding: 5px 10px;
  margin-bottom: 10px;
}
.mon-pro-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  color: #0f172a;
}
.mon-pro-body {
  padding: 20px 28px 24px;
}
.mon-pro-body p {
  margin: 0 0 12px;
  color: #475569;
  line-height: 1.65;
  font-size: 15px;
}
.mon-pro-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0 18px;
  color: #334155;
  font-size: 14px;
}
.mon-pro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mon-pro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
  border-radius: 11px;
  padding: 11px 18px;
  border: 1px solid transparent;
  transition: .2s ease;
  font-size: 14px;
  min-width: 160px;
}
.mon-pro-btn.primary {
  background: linear-gradient(135deg,#0ea5e9,#0369a1);
  color: #fff;
}
.mon-pro-btn.primary:hover { filter: brightness(1.06); }
.mon-pro-btn.ghost {
  border-color: #cbd5e1;
  color: #0f172a;
  background: #fff;
}
.mon-pro-btn.ghost:hover { background: #f8fafc; }
.mon-pro-btn.subtle {
  color: #334155;
  background: #f8fafc;
  border-color: #e2e8f0;
}
.mon-pro-btn.subtle:hover { background: #f1f5f9; }
.mon-pro-post {
  margin-top: 12px;
  font-size: 13px;
  color: #64748b;
}
.mon-pro-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.mon-pro-close:hover { color: #475569; background: rgba(0,0,0,.06); }
@media (max-width: 600px) {
  .mon-pro-head h2 { font-size: 18px; }
  .mon-pro-btn { width: 100%; }
}

/* Main Content */
.toeic-main {
  padding: 20px;
  background: #fff;
  min-width: 0;        /* 🔑 tránh bị grid co về 0 */
  flex-grow: 1;        /* phòng trường hợp grid biến thành flex */
  display: block;      /* đảm bảo section là block element */
  border: 1px solid red;
  position: relative;
}
.toeic-main h2 {
  margin-top: 0;
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
}
.toeic-main p {
  font-size: 16px;
  line-height: 1.6;
  color: #374151;
  margin-bottom: 16px;
}

/* Nút điều khiển */
.toeic-controls {
  display: flex;
  gap: 12px;
  margin: 14px 0;
}
.toeic-controls .btn {
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}
.toeic-controls .btn-primary {
  background: #2563eb;
  color: #fff;
  border: 1px solid #2563eb;
}
.toeic-controls .btn-primary:hover {
  background: #1e40af;
  color: #fff;
}
.toeic-controls .btn-secondary {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
}
.toeic-controls .btn-secondary:hover {
  background: #e5e7eb;
}


.toeic-controls .toeic-btn {
  background: #f9fafb;
  border: 1px solid #ddd;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.toeic-controls .toeic-btn.recording {
  background: #fee2e2;
  border-color: #f87171;
  color: #b91c1c;
}

.toeic-player {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f3f4f6;
  border: 1px solid #ddd;
  padding: 6px 12px;
  border-radius: 6px;
}
.toeic-player.hidden { display:none; }
.toeic-play {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}
.toeic-time {
  font-size: 14px;
  color: #374151;
}

/* [FIX] Nút “Tôi nói” hiển thị ngang hàng với NGHE/GHI ÂM */
.toeic-relisten-btn-inline {
  background: #4f46e5;
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 10px;
}

.toeic-relisten-btn-inline:hover {
  background: #4338ca;
}

/* Kết quả điểm */
#toeic-result {
  margin-top: 20px;
}

/* [FIX] Vòng tròn hiển thị đồng đều và căn giữa */
/* Vòng điểm */
.score-ring-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.score-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 140px;
  text-align: center;
}

.score-ring svg {
  width: 100%;
  height: auto;
}

.score-ring svg text {
  dominant-baseline: middle;
  fill: #111;
}

.toeic-total {
  text-align: center;
  font-weight: 700;
  margin-top: 15px;
  font-size: 18px;
}

/* =========================================================
   PREMIUM TOEIC SCORE UI – FIXED VERSION (Shield + Criteria)
========================================================= */

/* ======= Layout 2 cột ======= */
.toeic-score-box {
    display: flex;
    align-items: flex-start;
    gap: 36px;
    margin-bottom: 28px;
    width: 100%;
    flex-wrap: wrap;
}

/* ======= Badge khiên ======= */
.toeic-score-badge {
    width: 150px;
    height: 180px;
    border-radius: 20px 20px 80px 80px; /* trên vuông – dưới bo tròn */
    overflow: hidden;
    font-family: "Inter", sans-serif;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
}
/* ==== PHẦN DƯỚI MÀU XANH LÁ ==== */
.toeic-badge-bottom {
    background: #6cc04a;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;

    color: #fff; 
    font-size: 30px;
    font-weight: 700;

    border-radius: 0 0 80px 80px;
}

/* Số điểm */
.toeic-score-value {
    font-size: 34px;
    font-weight: 800;
}

/* Max Score */
.toeic-score-max {
    font-size: 22px;
    font-weight: 600;
    margin-left: 4px;
    opacity: 0.95;
}

/* label dưới badge */
.toeic-score-label {
    background: #00a6e8; /* xanh dương giống mẫu */
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 10px 0;
}

/* ======= RIGHT SIDE (criteria) ======= */
.toeic-score-right {
    flex: 1;
    max-width: 500px;
}

/* từng tiêu chí */
.toeic-criterion {
    margin-bottom: 20px;
}

.toeic-criterion span:first-child {
    font-weight: 600;
    color: #222;
    font-size: 15px;
}

.toeic-cri-val {
    float: right;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* progress bar */
.toeic-bar {
    width: 100%;
    height: 7px;
    background: #ebebeb;
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}

.toeic-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: #4caf50;
    transition: width 0.35s ease;
}

.toeic-bar-fill.yellow {
    background: #f8a22f;
}

/* tổng điểm part */
.toeic-part-total {
    margin-top: 18px;
    font-size: 15px;
    font-weight: 700;
    color: #333;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.toeic-level {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  padding: 10px;
  color: #ff0000;
}

.toeic-image-desc-box {
  border-top: 1px solid #e5e7eb;
  margin-top: 12px;
  padding-top: 14px;
}

.toeic-image-desc-box h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
}

.toeic-image-desc-content p {
  margin: 0 0 6px;
  color: #374151;
  line-height: 1.5;
}

/* RESPONSIVE */
@media (max-width: 680px) {
    .toeic-score-box {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .toeic-score-right {
        max-width: 100%;
        width: 100%;
    }
}

/* ===============================
   Popup chọn voice
   =============================== */
.toeic-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
}
body.single-toeic_speaking_test .toeic-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}
.toeic-popup-content {
  position: relative;
  z-index: 10000;
  max-width: 400px;
  margin: 20% auto;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.toeic-popup-content h3 {
  margin-top: 0;
  font-size: 18px;
}
.voice-choice {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
}
.voice-choice[data-voice*="Jenny"] {
  background: #f3f4f6;
}
.voice-choice[data-voice*="Guy"] {
  background: #e0f2fe;
}
.voice-choice:hover {
  background: #2563eb;
  color: #fff;
}

/* ===============================
   Gioi thieu chua co cau hoi
   =============================== */

.toeic-empty {
  padding: 0px 20px;
  color: #444;
  font-family: "Helvetica", sans-serif;
  max-height: 526px;
  overflow-y:auto;
}

.toeic-empty-img {
  width: 140px;
  opacity: 0.9;
  margin-bottom: 20px;
}

.toeic-empty h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #222;
}

.toeic-empty p {
  font-size: 15px;
  color: #666;
  margin: 5px 0;
}

.toeic-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin: 30px auto;
  max-width: 700px;
}

.toeic-feature {
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  transition: all 0.3s ease;
}

.toeic-feature:hover {
  background: #f0f9ff;
  border-color: #cce5ff;
}

.toeic-feature .icon {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
}

.toeic-note {
  font-size: 14px;
  margin-top: 30px;
  color: #0073e6;
  font-weight: 500;
}

/* Voice choice rows */
.voice-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
}

.voice-choice {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  background: #f3f4f6;
  transition: background .2s;
}

.voice-choice:hover {
  background: #2563eb;
  color: #fff;
}

.voice-preview {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.voice-preview:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* ===== Sample Answer Box ===== */
.toeic-sample-wrap {
  margin: 16px 0;
  padding: 12px 14px;
  border-left: 4px solid #2563eb;
  background: #f8fafc;
  border-radius: 6px;
}

/* ===== Sample Answer Button – Clean Pro ===== */
.toeic-sample-wrap .toeic-show-sample {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 8px 14px;
  margin: 12px 0;

  background: #0034ff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;

  font-size: 13px;
  font-weight: 600;
  color: #d9e5ff;

  cursor: pointer;
  transition: all 0.2s ease;
}

/* Icon sách nhẹ */
.toeic-sample-wrap .toeic-show-sample::before {
  content: "📘";
  font-size: 14px;
}

/* Hover nhẹ – không gây chú ý quá */
.toeic-sample-wrap .toeic-show-sample:hover {
  background: #ff0000;
  border-color: #c7d2fe;
  color: #ffffff;
}

.toeic-sample-inner {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  background: #ffffff;
  border-radius: 6px;
  border: 1px dashed #dbeafe;
  font-size: 15px;
  line-height: 1.6;
  color: #374151;
}


/* --- Toggle button: ẩn desktop, hiện mobile --- */
.toeic-sidebar-toggle, .toeic-close { display: none !important; }
@media (max-width: 768px) {
  .toeic-sidebar-toggle {
    display: inline-block !important;
    background: #2563eb; color:#fff;
    padding: 10px 14px; border-radius: 6px;
    font-size: 14px; margin-bottom: 12px; cursor: pointer;
  }
}

/* --- Drawer & overlay (mobile) --- */
@media (max-width: 768px) {
  .toeic-layout { display:block;}

  /* Overlay nền tối */
  .toeic-overlay{
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
    z-index: 9998;
  }
  .toeic-overlay.active{ opacity:1; pointer-events:auto; }

  /* Sidebar ở dạng drawer */
  .toeic-sidebar{
    position: fixed;
    top: 0; left: 0;
    height: 100dvh;              /* tốt cho iOS */
    width: 82vw; max-width: 380px;
    background: #fff;
    z-index: 9999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 2px 0 18px rgba(0,0,0,.2);
    transform: translateX(-105%);   /* Ẩn mặc định */
    visibility: hidden;
    transition: transform .28s ease, visibility 0s .28s;
    padding: 18px 16px 24px;
  }
  .toeic-sidebar.active{
    transform: translateX(0);
    visibility: visible;
    transition: transform .28s ease;
  }

  /* Nút đóng trong sidebar */
  .toeic-close{
    display: block !important;
    position: sticky; top: 0; right: 0;
    float: right;
    margin: -6px -6px 8px 0;
    width: 36px; height: 36px; line-height: 36px;
    text-align: center;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff; color:#111; font-size: 18px;
    z-index: 1;
  }
}

/* Khóa cuộn khi drawer mở */
html.toeic-locked, body.toeic-locked { overflow: hidden; touch-action: none; }

