/**
 * YTHUAT-AI — Chatbox CSS v23
 * v23 (22/04/2026): TRIAL 10 CÂU — thêm .cbx-trial-modal-* (modal hết trial, 2 options subscribe/mua lẻ)
 * v22 (22/04/2026): BỎ QUOTA EXPORT/SHARE + layout 2 cards
 *   - Xóa .cbx-share-toast-quota (5 dòng)
 *   - Xóa toàn bộ .cbx-quota-modal-* (60 dòng dead CSS)
 *   - Thêm .cbx-plan-grid-2 cho layout 2 cards (Xanh + Ô long)
 * v20 (21/04/2026): Share link UI — pulse nút, toast copy URL, quota modal
 */

.cbx-page {
  display: flex; flex-direction: column; height: 88vh; min-height: 520px;
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #fff; color: #0f172a;
  border-radius: 12px; border: 1px solid #e2e8f0;
  overflow: hidden; position: relative;
}

/* ─── Messages area ──────────────────────────── */
.cbx-msgs-area { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.cbx-msgs-area::-webkit-scrollbar { width: 6px; }
.cbx-msgs-area::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.3); border-radius: 3px; }
.cbx-msgs-area::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.5); }
.cbx-msgs-area::-webkit-scrollbar-track { background: transparent; }
.cbx-msgs-area { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,0.3) transparent; }

/* ─── Welcome ────────────────────────────────── */
.cbx-welcome {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 18px 16px 16px; max-width: 800px; margin: 0 auto;
}
.cbx-hero-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cbx-hero-icon { font-size: 34px; line-height: 1; }
.cbx-hero-text { font-size: 22px; font-weight: 800; color: #0f172a; }
.cbx-subtext { font-size: 14px; color: #475569; line-height: 1.6; margin-bottom: 26px; }
.cbx-subtext strong { font-weight: 700; color: #0f172a; }

/* ─── Plan cards ─────────────────────────────── */
.cbx-plan-grid { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: 100%; }
/* v22 (22/04/2026): Grid 2 cards (Xanh + Ô long) — cards rộng hơn, max 2/hàng */
.cbx-plan-grid-2 .cbx-card { flex: 1 1 260px; max-width: 300px; }
.cbx-card {
  flex: 1 1 220px; max-width: 250px; padding: 14px 12px 12px;
  border-radius: 14px; border: 1.5px solid #e2e8f0; text-align: left; position: relative;
  display: flex; flex-direction: column;
}
.cbx-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  padding: 4px 16px; border-radius: 999px; color: #fff; font-size: 13px; font-weight: 700;
}
.cbx-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cbx-card-name { font-size: 15px; font-weight: 800; line-height: 1.2; }
.cbx-price-row { display: flex; align-items: baseline; gap: 2px; }
.cbx-card-price { font-size: 16px; font-weight: 800; color: #0f172a; }
.cbx-card-period { font-size: 12px; color: #475569; }
.cbx-tagline { font-size: 13px; font-weight: 600; line-height: 1.4; margin-bottom: 5px; }
.cbx-divider { height: 1px; background: #e2e8f0; margin: 0 0 5px; opacity: 0.5; }
.cbx-feats { display: flex; flex-direction: column; gap: 1px; margin-bottom: 8px; flex: 1; }
.cbx-feat { font-size: 13px; color: #334155; line-height: 1.45; display: flex; align-items: flex-start; gap: 4px; }
.cbx-card-btn {
  width: 100%; padding: 8px 0; border-radius: 9px;
  font-family: 'Be Vietnam Pro', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; border: 1.5px dashed; margin-top: auto;
}

/* ─── Chat thread ────────────────────────────── */
.cbx-thread { max-width: 720px; margin: 0 auto; padding: 8px 24px; }
.cbx-user-row { padding: 22px 0; border-bottom: 1px solid #f1f5f9; }
.cbx-asst-row { padding: 22px 0; border-bottom: 1px solid #f1f5f9; }
.cbx-row-inner { display: flex; align-items: flex-start; gap: 12px; }
.cbx-user-icon {
  width: 28px; height: 28px; border-radius: 50%; background: #0284C7; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}
.cbx-user-text { font-size: 17px; line-height: 1.9; color: #0f172a; font-weight: 500; flex: 1; word-wrap: break-word; }
.cbx-asst-icon {
  width: 28px; height: 28px; border-radius: 50%; background: #FFF3E0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; margin-top: 2px;
}
.cbx-asst-text { font-size: 17px; line-height: 2; color: #1e293b; flex: 1; word-wrap: break-word; white-space: pre-wrap; }
.cbx-error-text { color: #c62828; }

/* ─── Badge check ────────────────────────────── */
.cbx-badge-check {
  font-size: 12px; color: #16A34A; font-weight: 600;
  padding: 2px 0 0 40px;
}

/* ─── Mua lẻ prompt ──────────────────────────── */
.cbx-mua-le-row { padding: 8px 0 12px 40px; }
.cbx-mua-le-btn {
  font-family: 'Be Vietnam Pro', sans-serif; font-size: 13px; font-weight: 700;
  color: #E65100; background: #FFF3E0;
  border: 1.5px dashed #F57C00; border-radius: 9px;
  padding: 8px 20px; cursor: pointer;
}
.cbx-mua-le-btn:active { opacity: 0.7; }

/* ─── Banner HDSD (chưa login) ────────────────── */
.cbx-banner-hdsd {
  display: block; width: 100%; margin-top: 16px; padding: 14px 20px;
  background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
  border: 1.5px dashed #F57C00; border-radius: 12px;
  text-align: center; text-decoration: none; color: #E65100;
  font-size: 15px; line-height: 1.5;
}
.cbx-banner-hdsd strong { font-weight: 800; font-size: 16px; }
.cbx-banner-hdsd:hover { background: linear-gradient(135deg, #FFE0B2 0%, #FFCC80 100%); }

/* ─── Guest mode ─────────────────────────────── */
.cbx-guest .cbx-msgs-area { display: flex; align-items: center; justify-content: center; }

/* ─── Topbar (logged in) ─────────────────────── */
.cbx-topbar {
  display: flex; align-items: center; gap: 0;
  padding: 7px 12px 7px 14px; flex-shrink: 0;
  border-bottom: 1px solid #f1f5f9;
}
.cbx-toggle-btn {
  font-size: 16px; cursor: pointer; opacity: 0.5; flex-shrink: 0;
  margin-right: 6px; line-height: 1;
}
.cbx-toggle-btn:hover { opacity: 0.8; }
.cbx-topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: 6px; }
.cbx-icon-btn { display: inline-flex; align-items: center; line-height: 1; }
.cbx-icon-btn:hover { opacity: 0.7; }
.cbx-plan-badge { font-size: 22px; line-height: 1; }

/* ─── Folders bar (inline trong topbar) ─────────── */
.cbx-folders-bar {
  flex: 1; display: flex; align-items: center; gap: 5px;
  overflow-x: auto; min-width: 0;
  /* ẩn scrollbar nhưng vẫn scroll được */
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 2px;
  padding-right: 4px;
}
.cbx-folders-bar::-webkit-scrollbar { display: none; }

/* folder tab — giống nút Gọi Trà đá */
.cbx-folder-tab {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 14px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  background: #F0F9FF; color: #0284C7;
  border: 1.5px dashed #0284C7;
  transition: background 0.15s;
  flex-shrink: 0;
}
.cbx-folder-tab:hover { background: #E0F2FE; }
.cbx-folder-tab.active {
  background: #FFF3E0; color: #E65100;
  border: 1.5px solid #E65100;
}

/* nút xóa folder (chỉ non-default) */
.cbx-folder-del {
  font-size: 11px; line-height: 1; opacity: 0.6;
  cursor: pointer; padding: 0 0 0 2px;
  display: none;
}
.cbx-folder-tab:hover .cbx-folder-del { display: inline; }
.cbx-folder-tab.active .cbx-folder-del { display: inline; opacity: 0.8; }
.cbx-folder-del:hover { opacity: 1; }

/* nút thêm folder + */
.cbx-folder-add {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px dashed #94a3b8; background: transparent;
  color: #94a3b8; font-size: 16px; font-weight: 300;
  cursor: pointer; flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.cbx-folder-add:hover { border-color: #E65100; color: #E65100; }

/* inline input tạo folder */
.cbx-folder-input-wrap {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.cbx-folder-input {
  height: 26px; padding: 0 8px; border-radius: 8px;
  border: 1.5px solid #F57C00; outline: none;
  font-family: 'Be Vietnam Pro', sans-serif; font-size: 13px; font-weight: 600;
  color: #0f172a; background: #FFF8E1; width: 120px;
}
.cbx-folder-input:focus { border-color: #E65100; background: #fff; }
.cbx-folder-input-ok {
  width: 22px; height: 22px; border-radius: 50%;
  background: #0284C7; color: #fff; border: none;
  font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.cbx-folder-input-ok:hover { background: #0369a1; }
.cbx-folder-input-cancel {
  width: 22px; height: 22px; border-radius: 50%;
  background: #f1f5f9; color: #475569; border: none;
  font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.cbx-folder-input-cancel:hover { background: #e2e8f0; color: #0f172a; }

/* ─── Folder history view ────────────────────── */
.cbx-hist-group {
  max-width: 720px; margin: 0 auto; padding: 10px 24px;
  border-bottom: 1px solid #f1f5f9; position: relative;
}
.cbx-hist-q {
  font-size: 16px; font-weight: 600; color: #0f172a; margin-bottom: 6px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.cbx-hist-q-text { flex: 1; }
.cbx-hist-a { font-size: 16px; color: #334155; line-height: 1.9; white-space: pre-wrap; word-wrap: break-word; }
.cbx-hist-meta { font-size: 12px; color: #94a3b8; margin-top: 6px; }

/* nút move */
.cbx-move-btn {
  font-size: 13px; cursor: pointer; opacity: 0; flex-shrink: 0;
  background: none; border: none; padding: 0 2px;
  color: #475569; transition: opacity 0.15s;
}
.cbx-hist-group:hover .cbx-move-btn { opacity: 0.7; }
.cbx-move-btn:hover { opacity: 1 !important; color: #0284C7; }

/* nút xóa */
.cbx-del-btn {
  font-size: 13px; cursor: pointer; opacity: 0; flex-shrink: 0;
  background: none; border: none; padding: 0 2px;
  color: #475569; transition: opacity 0.15s;
}
.cbx-hist-group:hover .cbx-del-btn { opacity: 0.7; }
.cbx-del-btn:hover { opacity: 1 !important; color: #DC2626; }

/* move dropdown */
.cbx-move-dropdown {
  position: absolute; right: 24px; top: 32px; z-index: 20;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1); min-width: 160px; padding: 4px 0;
}
.cbx-move-opt {
  padding: 8px 16px; font-size: 13px; cursor: pointer; color: #334155;
}
.cbx-move-opt:hover { background: #f1f5f9; color: #0284C7; }

/* empty folder */
.cbx-hist-empty {
  text-align: center; padding: 60px 20px; color: #94a3b8; font-size: 15px;
}

/* ─── Loading dots ───────────────────────────── */
.cbx-dots { display: inline-flex; gap: 5px; padding: 4px 0; }
.cbx-dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: cbxBounce 1.2s infinite; }
.cbx-dot:nth-child(2) { animation-delay: 0.15s; }
.cbx-dot:nth-child(3) { animation-delay: 0.3s; }
.cbx-cursor { display: inline-block; width: 2px; height: 16px; background: #0284C7; margin-left: 2px; vertical-align: text-bottom; animation: cbxBlink .8s infinite; }

/* ─── Input area ─────────────────────────────── */
.cbx-input-area { flex-shrink: 0; padding: 8px 20px 12px; }
.cbx-input-box { max-width: 720px; margin: 0 auto; position: relative; }
.cbx-input-box textarea {
  width: 100%; min-height: 100px; max-height: 240px; padding: 12px 88px 12px 16px;
  border: 1px solid #e2e8f0; border-radius: 16px;
  font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
  font-size: 15px; line-height: 1.5; resize: none; outline: none;
  background: #fff; color: #0f172a;
  scrollbar-width: thin; scrollbar-color: rgba(148,163,184,0.3) transparent;
}
.cbx-input-box textarea::-webkit-scrollbar { width: 6px; }
.cbx-input-box textarea::-webkit-scrollbar-track { background: transparent; }
.cbx-input-box textarea::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.3); border-radius: 3px; }
.cbx-input-box textarea::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.5); }
.cbx-input-box textarea:focus { border-color: #0284C7; }
.cbx-send-btn {
  width: 34px; height: 34px;
  border-radius: 9px; border: none; background: #0284C7; color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.cbx-send-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.cbx-btn-group { position: absolute; right: 16px; bottom: 12px; display: flex; gap: 6px; align-items: center; }
.cbx-rocket-btn {
  width: 28px; height: 28px; border-radius: 7px;
  border: 1.5px dashed #E65100; background: #FFF3E0; color: #E65100;
  font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cbx-rocket-btn:active { opacity: 0.7; }

/* ─── Remain info ───────────────────────────── */
.cbx-remain { font-size: 13px; color: #475569; }

/* ─── Toast ───────────────────────────────────── */
.cbx-toast {
  position: absolute; bottom: 72px; left: 50%; transform: translateX(-50%);
  padding: 8px 18px; background: #1e293b; color: #fff; border-radius: 10px;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  animation: cbxToastIn .25s ease-out; z-index: 10;
}

/* ─── Animations ──────────────────────────────── */
@keyframes cbxBounce { 0%,60%,100% { transform: translateY(0); opacity: .3; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes cbxBlink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes cbxToastIn { from { transform: translateX(-50%) translateY(10px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }

/* ─── Welcome Screen animations ──────────────── */
.cbx-a-bounce { animation: cbxWBounce 1.6s ease-in-out infinite; }
.cbx-a-float { animation: cbxWFloat 2.4s ease-in-out infinite; }
.cbx-a-tilt { animation: cbxWTilt 2s ease-in-out infinite; }
.cbx-a-fall { animation: cbxWFall 2.8s ease-in-out infinite; }
.cbx-a-flutter { animation: cbxWFlutter 2s ease-in-out infinite; }
.cbx-a-rise { animation: cbxWRise 2s ease-out infinite; }
.cbx-a-pulse { animation: cbxWPulse 1.8s ease-in-out infinite; }
.cbx-a-spin { animation: cbxWSpin 3s linear infinite; }
.cbx-a-swing { animation: cbxWSwing 2s ease-in-out infinite; transform-origin: top center; }
.cbx-a-orbit { animation: cbxWOrbit 2.5s linear infinite; }

@keyframes cbxWBounce { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-24px) scale(1.1); } }
@keyframes cbxWFloat { 0%, 100% { transform: translateY(0) rotate(0deg); } 25% { transform: translateY(-12px) rotate(3deg); } 75% { transform: translateY(-6px) rotate(-3deg); } }
@keyframes cbxWTilt { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(15deg); } 75% { transform: rotate(-15deg); } }
@keyframes cbxWFall { 0% { transform: translateY(-20px) rotate(0deg); opacity: 0.3; } 50% { transform: translateY(8px) rotate(180deg); opacity: 1; } 100% { transform: translateY(-20px) rotate(360deg); opacity: 0.3; } }
@keyframes cbxWFlutter { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 25% { transform: translate(12px, -10px) rotate(8deg); } 50% { transform: translate(0, -18px) rotate(0deg); } 75% { transform: translate(-12px, -10px) rotate(-8deg); } }
@keyframes cbxWRise { 0% { transform: translateY(20px) scale(0.8); opacity: 0.3; } 60% { transform: translateY(-10px) scale(1.1); opacity: 1; } 100% { transform: translateY(0) scale(1); opacity: 0.9; } }
@keyframes cbxWPulse { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.2); opacity: 1; } }
@keyframes cbxWSpin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes cbxWSwing { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(12deg); } 75% { transform: rotate(-12deg); } }
@keyframes cbxWOrbit { 0% { transform: translate(0, 0); } 25% { transform: translate(14px, -14px); } 50% { transform: translate(0, -20px); } 75% { transform: translate(-14px, -14px); } 100% { transform: translate(0, 0); } }

/* ─── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
  .cbx-page { height: calc(100vh - 60px); border-radius: 0; border: none; }
  .cbx-plan-grid { flex-direction: column; align-items: center; }
  .cbx-card { max-width: 100%; }
  .cbx-thread { padding: 8px 16px; }
  .cbx-hist-group { padding: 6px 16px; }
}

/* ─── Export buttons in chat result ──────────── */
.cbx-export-row {
  display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap;
}
.cbx-export-btn {
  padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 500;
  border: none; background: transparent; color: #64748B;
  cursor: pointer; font-family: 'Be Vietnam Pro', sans-serif;
  transition: color 0.15s; text-decoration: none; display: inline-flex; align-items: center; gap: 3px;
}
.cbx-export-btn:hover { color: #0284C7; }

/* ═══════════════════════════════════════════════════════════════
   v20 (21/04/2026) — Share link UI: pulse animation + toast + modal
   ═══════════════════════════════════════════════════════════════ */

/* Nút Share & Xem web — v11.6 (21/04/2026): bỏ nền, bỏ border, chữ Xanh-Cam */
.cbx-export-btn.cbx-btn-share {
  color: #0284C7;
  font-weight: 600;
  background: transparent;
  border: none;
  padding: 3px 8px;
}
.cbx-export-btn.cbx-btn-share:hover {
  color: #E65100;
  background: transparent;
  border: none;
}

/* Hint badge "✨ đẹp" cạnh text nút */
.cbx-hint-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  background: #FEF3C7;
  color: #D97706;
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
  letter-spacing: 0.3px;
}
.cbx-export-btn.cbx-btn-share:hover .cbx-hint-badge {
  background: #fff;
  color: #D97706;
}

/* v11.6 (21/04/2026): BỎ pulse animation hoàn toàn — Bác yêu cầu bỏ box bao quanh nút.
   Giữ class để JS khỏi fail khi addClass/removeClass, nhưng không render hiệu ứng nào. */
.cbx-export-btn.cbx-btn-share.cbx-pulse {
  animation: none;
}

/* ─── Share toast (fixed bottom-right, chứa URL) ──────── */
.cbx-share-toast-box {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 380px;
  background: #fff;
  border: 2px solid #16A34A;
  border-radius: 12px;
  padding: 16px 40px 16px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  animation: cbxShareToastIn 0.3s ease-out;
  font-family: 'Be Vietnam Pro', sans-serif;
}
@keyframes cbxShareToastIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.cbx-share-toast-box.cbx-toast-out {
  animation: cbxShareToastOut 0.3s ease-in forwards;
}
@keyframes cbxShareToastOut {
  to { transform: translateX(20px); opacity: 0; }
}
.cbx-share-toast-title {
  font-size: 15px;
  font-weight: 700;
  color: #14532D;
  margin-bottom: 4px;
}
.cbx-share-toast-msg {
  font-size: 13px;
  color: #16A34A;
  margin-bottom: 10px;
}
.cbx-share-toast-url {
  font-size: 12px;
  font-family: 'Courier New', monospace;
  background: #F0FDF4;
  color: #166534;
  padding: 8px 10px;
  border-radius: 6px;
  word-break: break-all;
  border: 1px dashed #86EFAC;
  user-select: all;
}
.cbx-share-toast-input {
  width: 100%;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  background: #F0FDF4;
  color: #166534;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px dashed #86EFAC;
  box-sizing: border-box;
}
/* v22 (22/04/2026): XÓA .cbx-share-toast-quota — quota đã bỏ */
.cbx-share-toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #94A3B8;
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
}
.cbx-share-toast-close:hover {
  background: #F1F5F9;
  color: #1E293B;
}

@media (max-width: 768px) {
  .cbx-share-toast-box {
    right: 12px;
    left: 12px;
    bottom: 12px;
    max-width: none;
  }
}

/* v22 (22/04/2026): XÓA toàn bộ .cbx-quota-modal-* — quota đã bỏ, function _showQuotaExceededModal đã xóa trong JS */

/* Quy chuẩn nút v4 — TĨNH = viền cam + nền xanh + chữ xanh */
.cbx-btn-tinh {
  border: 2px solid #F57C00;
  background: #F0FDF4;
  color: #16A34A;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Be Vietnam Pro', sans-serif;
  transition: all 0.15s;
}
.cbx-btn-tinh:hover {
  border-color: #E65100;
  background: #DCFCE7;
  color: #15803D;
}

/* Quy chuẩn nút v4 — ĐỘNG = viền xanh + nền cam + chữ cam */
.cbx-btn-dong {
  border: 2px solid #16A34A;
  background: #FFF3E0;
  color: #E65100;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Be Vietnam Pro', sans-serif;
  transition: all 0.15s;
}
.cbx-btn-dong:hover {
  border-color: #15803D;
  background: #FFE0B2;
  color: #BF360C;
}

/* Sizes */
.cbx-btn-l { padding: 12px 24px; font-size: 15px; min-height: 44px; }
.cbx-btn-m { padding: 9px 18px; font-size: 14px; min-height: 38px; }
.cbx-btn-s { padding: 6px 14px; font-size: 13px; min-height: 32px; }

/* ═══ v23 (22/04/2026) — Trial exhausted modal (10 câu hết) ═══ */
.cbx-trial-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 10001; padding: 20px;
  animation: cbxTrialFadeIn 0.2s ease-out;
}
@keyframes cbxTrialFadeIn { from { opacity: 0; } to { opacity: 1; } }
.cbx-trial-modal-box {
  background: #fff; border-radius: 16px;
  padding: 28px 32px; max-width: 480px; width: 100%;
  text-align: center; position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  font-family: 'Be Vietnam Pro', sans-serif;
  animation: cbxTrialScaleIn 0.25s ease-out;
}
@keyframes cbxTrialScaleIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cbx-trial-modal-icon { font-size: 48px; margin-bottom: 8px; line-height: 1; }
.cbx-trial-modal-title { font-size: 18px; font-weight: 700; color: #D97706; margin: 0 0 6px; line-height: 1.4; }
.cbx-trial-modal-msg { font-size: 14px; color: #475569; margin: 0 0 20px; }
.cbx-trial-modal-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.cbx-trial-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid #E2E8F0; border-radius: 10px;
  background: #F8FAFC;
}
.cbx-trial-option-icon { font-size: 28px; flex-shrink: 0; }
.cbx-trial-option-text { flex: 1; text-align: left; font-size: 13px; color: #334155; line-height: 1.5; }
.cbx-trial-option-text strong { color: #0F172A; font-size: 14px; }
.cbx-trial-option-text span { color: #64748B; font-size: 12px; }
.cbx-trial-modal-close {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border: none; background: transparent;
  color: #94A3B8; font-size: 16px; cursor: pointer; border-radius: 4px; line-height: 1;
}
.cbx-trial-modal-close:hover { background: #F1F5F9; color: #1E293B; }
@media (max-width: 480px) {
  .cbx-trial-modal-box { padding: 20px 18px; }
  .cbx-trial-option { flex-direction: column; text-align: center; gap: 6px; }
  .cbx-trial-option-text { text-align: center; }
}

/* ═══════════════════════════════════════════════════════════════════
   v12 (24/04/2026) — TOGGLE SUY NGHĨ SÂU (Trà xanh ↔ Thảo mộc)
   Thay thế nút ⬆️ Nâng cấp ở topbar phải.
   Tắt = Trà xanh (medium) · Bật = Thảo mộc (deep, suy nghĩ sâu)
   Theo quy chuẩn nút v4:
     OFF (tĩnh)  → .cbx-btn-tinh (viền cam · nền xanh · chữ xanh)
     ON  (động)  → .cbx-btn-dong (viền xanh · nền cam · chữ cam)
   ═══════════════════════════════════════════════════════════════════ */
.cbx-deep-toggle {
  white-space: nowrap;
  user-select: none;
}
.cbx-deep-toggle[aria-pressed="true"] .cbx-deep-label::before {
  content: "✓ ";
}

/* v12b1 (24/04/2026) — Shimmer nhẹ khi Suy nghĩ sâu ON (chạy vô hạn, OFF dừng)
   Gradient xanh lá → xanh sáng → xanh lá chạy từ trái sang phải, nhẹ nhàng không lòe loẹt. */
@keyframes cbxDeepShimmer {
  0%   { background-position: 200% 50%; }
  100% { background-position: -200% 50%; }
}
.cbx-deep-toggle[aria-pressed="true"] .cbx-deep-label {
  background: linear-gradient(90deg, #16A34A 0%, #16A34A 40%, #4ADE80 50%, #16A34A 60%, #16A34A 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: cbxDeepShimmer 3.5s linear infinite;
}

/* v12 (24/04/2026) — Lưu ý phạm vi chủ đề ở welcome screen */
.cbx-scope-note {
  margin-top: 20px;
  padding: 10px 16px;
  max-width: 640px;
  font-size: 13px; color: #64748B; text-align: center; line-height: 1.6;
  background: #FFFBEB; border: 1px solid #FCD34D; border-radius: 8px;
}
.cbx-scope-note strong { color: #92400E; }

/* ═══════════════════════════════════════════════════════════════════
   v12 (24/04/2026) — DEEP EXHAUSTED STATE + BUY EXTRA MODAL
   Nút Suy nghĩ sâu khi hết quota → style cảnh báo, click mở modal mua.
   ═══════════════════════════════════════════════════════════════════ */
.cbx-deep-toggle.cbx-deep-exhausted {
  background: #FEF2F2 !important;
  border-color: #DC2626 !important;
  color: #991B1B !important;
  cursor: pointer;
}
.cbx-deep-toggle.cbx-deep-exhausted:hover {
  background: #FEE2E2 !important;
  border-color: #B91C1C !important;
}
.cbx-deep-toggle.cbx-deep-exhausted::after {
  content: " 💰";
  font-size: 11px;
}
.cbx-deep-toggle.cbx-deep-exhausted .cbx-deep-label::before {
  content: "";  /* Bỏ dấu ✓ khi disabled */
}

/* Modal mua thêm Thảo mộc — tái dụng .cbx-trial-modal-* từ v23 */
.cbx-buy-extra-form {
  display: flex; flex-direction: column; gap: 12px;
  margin: 16px 0 20px;
  padding: 16px; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 10px;
}
.cbx-buy-extra-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cbx-buy-extra-label {
  font-size: 14px; font-weight: 600; color: #1E293B;
}
.cbx-buy-extra-input {
  width: 90px; padding: 8px 12px;
  border: 2px solid #E2E8F0; border-radius: 8px;
  font-family: inherit; font-size: 16px; font-weight: 700; color: #E65100; text-align: center;
  transition: border-color 0.15s;
}
.cbx-buy-extra-input:focus {
  outline: none; border-color: #F57C00;
}
.cbx-buy-extra-preview {
  font-size: 13px; color: #475569; text-align: center;
}
.cbx-buy-extra-preview strong {
  color: #E65100; font-size: 18px; margin: 0 4px;
}
.cbx-buy-extra-actions {
  display: flex; gap: 10px; justify-content: center;
}
@media (max-width: 480px) {
  .cbx-buy-extra-actions { flex-direction: column; }
  .cbx-buy-extra-actions button { width: 100%; }
}
