/* ==========================================================================
   LỊCH SỬ STUDIO V14 — LỚP GIAO DIỆN TINH GỌN + PHÒNG LUYỆN THI
   Nạp SAU styles/v7.css: chỉ tinh chỉnh token, mật độ hiển thị và bổ sung
   thành phần mới. Không xoá lớp cũ để giữ tương thích ngược.
   ========================================================================== */

:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --surface-2: #F2EFE8;
  --surface-hover: #E9E4DA;
  --ink: #16191E;
  --ink-muted: #4F5562;
  --ink-faint: #727A86;
  --border: #E6E1D6;
  --border-strong: #D2CBBB;

  --accent: #A12A22;
  --accent-hover: #86211A;
  --accent-soft: rgba(161, 42, 34, 0.08);
  --gold: #8A6116;
  --gold-soft: rgba(138, 97, 22, 0.10);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-xs: 0 1px 2px rgba(22, 25, 30, 0.04);
  --shadow-sm: 0 2px 8px rgba(22, 25, 30, 0.06);
  --shadow-md: 0 8px 24px rgba(22, 25, 30, 0.08);

  --font-sans: "Be Vietnam Pro", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-display: "Be Vietnam Pro", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

  --ex-good: #13734C;
  --ex-good-soft: rgba(19, 115, 76, 0.10);
  --ex-mid: #A36108;
  --ex-mid-soft: rgba(163, 97, 8, 0.11);
  --ex-bad: #B42318;
  --ex-bad-soft: rgba(180, 35, 24, 0.09);
}

[data-theme="dark"] {
  --bg: #0E1116;
  --surface: #151A21;
  --surface-2: #1C232D;
  --surface-hover: #242D39;
  --ink: #F1EEE8;
  --ink-muted: #B3BAC4;
  --ink-faint: #828C98;
  --border: #252E3A;
  --border-strong: #354253;
  --accent: #E6625A;
  --accent-hover: #EE7A72;
  --accent-soft: rgba(230, 98, 90, 0.14);

  --ex-good: #3DD39B;
  --ex-good-soft: rgba(61, 211, 155, 0.14);
  --ex-mid: #F5B83D;
  --ex-mid-soft: rgba(245, 184, 61, 0.14);
  --ex-bad: #F27166;
  --ex-bad-soft: rgba(242, 113, 102, 0.14);
}

body {
  font-size: 14.5px;
  line-height: 1.58;
  background: var(--bg);
  font-feature-settings: "tnum" 0;
}

.font-display { letter-spacing: -0.02em; }

/* ---------- Thanh điều hướng gọn hơn ---------- */
.topbar { height: 54px; }
.topbar-inner { height: 54px; }
.nav-btn {
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  font-size: 0.79rem;
}
.nav-btn.active { background: var(--ink); color: var(--surface); }
[data-theme="dark"] .nav-btn.active { background: var(--ink); color: var(--bg); }
.nav-btn-exam { color: var(--accent); }
.nav-btn-exam:not(.active)::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
.brand-seal { border-radius: 9px; }

/* ---------- Thẻ, nút, khoảng cách ---------- */
.card { border-radius: var(--radius-md); }
.btn { border-radius: 9px; min-height: 38px; }
.btn-sm { min-height: 32px; }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn:focus-visible, .ex-opt:focus-visible, .ex-chip:focus-visible, .ex-mode:focus-visible,
.nav-btn:focus-visible, .pill-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.portal-card { padding: 0; overflow: hidden; gap: 0; border-radius: var(--radius-lg); }
.portal-card > div:first-child { padding: 0 1.15rem 0.2rem; }
.portal-card .portal-card-foot { margin: 0 1.15rem 1rem; }
.portal-card h2 { font-size: 1.08rem !important; }
.portal-cover {
  height: 120px;
  margin: 0 -1.15rem 0.85rem;
  background: var(--surface-2) center 35% / cover no-repeat;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.portal-cover::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.28) 100%);
}
.portal-card .portal-card-head .badge { margin-top: 2.55rem; }
.portal-cover-credit {
  position: absolute; right: 0.5rem; top: 0.4rem; z-index: 1;
  background: rgba(0,0,0,0.38); padding: 0.05rem 0.4rem; border-radius: 4px;
  font-size: 0.62rem; color: rgba(255,255,255,0.88); letter-spacing: 0.01em;
}
.portal-card .portal-card-head { margin-top: -2.3rem; position: relative; z-index: 1; }
.portal-card .portal-icon-box { background: var(--surface); box-shadow: var(--shadow-sm); }
.portal-grid-4 { gap: 0.9rem; }

/* Era tabs có ảnh nền thật */
.era-tab-card { overflow: hidden; position: relative; min-height: 92px; }
.era-tab-card.has-photo { color: #fff; border-color: transparent; justify-content: flex-end; }
.era-tab-card.has-photo .era-bg {
  position: absolute; inset: 0; background: center / cover no-repeat;
  transition: transform 0.3s ease;
}
.era-tab-card.has-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,12,16,0.15) 0%, rgba(10,12,16,0.78) 100%);
}
.era-tab-card.has-photo > *:not(.era-bg) { position: relative; z-index: 1; }
.era-tab-card.has-photo .font-display,
.era-tab-card.has-photo span { color: #fff !important; }
.era-tab-card.has-photo .badge { background: rgba(255,255,255,0.18); color: #fff; border-color: transparent; backdrop-filter: blur(4px); }
.era-tab-card.has-photo:hover .era-bg { transform: scale(1.04); }
.era-tab-card.has-photo.active { box-shadow: 0 0 0 2.5px var(--accent), var(--shadow-sm); }

.era-photo-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0; overflow: hidden;
  border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface);
  margin-bottom: 1rem;
}
.era-photo-hero .svg-era-hero { margin: 0; border: none; border-radius: 0; border-left: 4px solid var(--accent); }
.era-photo-fig { position: relative; margin: 0; min-height: 180px; background: var(--surface-2); cursor: zoom-in; }
.era-photo-fig img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.era-photo-fig figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 0.5rem 0.65rem;
  font-size: 0.68rem; line-height: 1.35; color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.72) 60%);
}
@media (max-width: 760px) {
  .era-photo-hero { grid-template-columns: 1fr; }
  .era-photo-fig { min-height: 170px; order: -1; }
}

/* Trang chủ: ảnh tư liệu trong ngày lấp khoảng trống của hero */
.home-hero-main { position: relative; }
.home-daily-photo {
  display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 0.75rem; align-items: center;
  padding: 0.55rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: zoom-in; text-align: left; width: 100%;
}
.home-daily-photo img { width: 132px; height: 84px; object-fit: cover; border-radius: 6px; }
.home-daily-photo .hdp-label { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.home-daily-photo .hdp-cap { font-size: 0.8rem; line-height: 1.4; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.home-daily-photo .hdp-src { font-size: 0.66rem; color: var(--ink-faint); margin-top: 0.15rem; }
@media (max-width: 480px) {
  .home-daily-photo { grid-template-columns: 96px minmax(0,1fr); }
  .home-daily-photo img { width: 96px; height: 72px; }
}

/* Bộ sưu tập ảnh bổ sung: credit rõ ràng */
.photo-credit-line { font-size: 0.68rem; color: var(--ink-faint); line-height: 1.35; }
.photo-credit-line a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ==========================================================================
   PHÒNG LUYỆN THI
   ========================================================================== */
.ex-root { display: flex; flex-direction: column; gap: 0.9rem; }
.ex-muted { color: var(--ink-muted); }
.ex-eyebrow { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); }
.ex-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; margin: 0.15rem 0 0.25rem; }
.ex-lead { font-size: 0.86rem; color: var(--ink-muted); max-width: 62ch; }
.ex-section-title { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 0.55rem; }
.ex-link { background: none; border: none; color: var(--ink-muted); font-weight: 700; font-size: 0.74rem; cursor: pointer; padding: 0 0.2rem; text-decoration: underline; text-underline-offset: 2px; }
.ex-link.active { color: var(--accent); text-decoration: none; }

.ex-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1.1rem 1.2rem; border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 55%),
    var(--surface);
  border: 1px solid var(--border);
}
.ex-goal { display: flex; align-items: center; gap: 0.75rem; }
.ex-goal-num { font-size: 1.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ex-goal-num span { font-size: 0.9rem; color: var(--ink-faint); font-weight: 700; }
.ex-goal-label { font-size: 0.74rem; color: var(--ink-muted); font-weight: 600; }
.ex-goal-set { font-size: 0.72rem; color: var(--ink-faint); margin-top: 0.15rem; }

.ex-ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 6; }
.ex-ring-fg { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }

.ex-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.6rem 0.85rem; border-radius: var(--radius-md);
  background: var(--gold-soft); border: 1px solid rgba(138, 97, 22, 0.22); font-size: 0.84rem;
}
.ex-banner > span:first-child { display: inline-flex; align-items: center; gap: 0.45rem; }
.ex-banner-actions { display: flex; gap: 0.35rem; }

.ex-stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem; }
@media (max-width: 760px) { .ex-stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ex-stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.7rem 0.85rem; min-width: 0;
}
.ex-stat-val { font-size: 1.4rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ex-stat-label { font-size: 0.76rem; font-weight: 700; color: var(--ink); margin-top: 0.15rem; }
.ex-stat-sub { font-size: 0.7rem; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-stat-good .ex-stat-val { color: var(--ex-good); }
.ex-stat-warn .ex-stat-val { color: var(--ex-mid); }
.ex-stat-bad .ex-stat-val { color: var(--ex-bad); }
.ex-stat-fire .ex-stat-val { color: var(--accent); }

.ex-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 0.9rem; align-items: start; }
@media (max-width: 980px) { .ex-layout { grid-template-columns: 1fr; } }
.split-active .ex-layout { grid-template-columns: 1fr; }

.ex-card-head { display: flex; gap: 0.7rem; align-items: flex-start; margin-bottom: 0.85rem; }
.ex-card-head h2 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.015em; }
.ex-card-head p { font-size: 0.8rem; color: var(--ink-muted); }
.ex-ic {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--border);
}
.ex-ic-accent { background: var(--accent); color: #fff; border-color: transparent; }

.ex-mock { padding: 1.05rem 1.1rem; border-top: 3px solid var(--accent); }
.ex-form { display: flex; flex-direction: column; gap: 0.75rem; }
.ex-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.ex-field-label { font-size: 0.72rem; font-weight: 700; color: var(--ink-muted); }
.ex-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
@media (max-width: 520px) { .ex-field-row { grid-template-columns: 1fr; } }
.ex-chips { display: flex; flex-wrap: wrap; gap: 0.32rem; }
.ex-chip {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-muted);
  border-radius: 999px; padding: 0.28rem 0.7rem; font-size: 0.77rem; font-weight: 600; cursor: pointer;
  transition: all 0.14s ease; white-space: nowrap;
}
.ex-chip:hover { border-color: var(--ink); color: var(--ink); }
.ex-chip.active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.ex-mock-foot {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 0.75rem; flex-wrap: wrap;
  margin-top: 0.95rem; padding-top: 0.85rem; border-top: 1px solid var(--border); font-size: 0.78rem;
}

.ex-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
@media (max-width: 520px) { .ex-modes { grid-template-columns: 1fr; } }
.ex-mode {
  display: flex; gap: 0.65rem; align-items: flex-start; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.75rem 0.8rem; cursor: pointer; min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.ex-mode:hover:not(.is-disabled) { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.ex-mode:hover:not(.is-disabled) .ex-ic { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.ex-mode.is-disabled { opacity: 0.6; cursor: default; }
.ex-mode-body { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; }
.ex-mode-title { font-weight: 800; font-size: 0.88rem; display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.ex-mode-badge { font-size: 0.66rem; font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 0.05rem 0.42rem; border-radius: 999px; }
.ex-mode-desc { font-size: 0.75rem; color: var(--ink-muted); line-height: 1.42; }

.ex-recent { padding: 0.95rem 1.05rem; }
.ex-recent-list, .ex-weak { display: flex; flex-direction: column; }
.ex-recent-row, .ex-weak-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.65rem; align-items: center;
  padding: 0.5rem 0; border-top: 1px solid var(--border); font-size: 0.82rem;
}
.ex-recent-row:first-child, .ex-weak-row:first-child { border-top: none; }
.ex-recent-label { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-recent-row .ex-muted { font-size: 0.74rem; white-space: nowrap; }
.ex-weak-actions { display: flex; gap: 0.3rem; }
@media (max-width: 560px) {
  .ex-recent-row { grid-template-columns: auto minmax(0, 1fr); }
  .ex-recent-row .ex-muted { grid-column: 2; }
  .ex-weak-row { grid-template-columns: auto minmax(0, 1fr); }
  .ex-weak-actions { grid-column: 1 / -1; }
}
.ex-score-pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 2.6rem;
  font-weight: 800; font-size: 0.8rem; padding: 0.18rem 0.45rem; border-radius: 7px; font-variant-numeric: tabular-nums;
}
.ex-score-pill.big { font-size: 1.15rem; padding: 0.3rem 0.7rem; border-radius: 10px; }
.ex-score-pill.good { background: var(--ex-good-soft); color: var(--ex-good); }
.ex-score-pill.mid { background: var(--ex-mid-soft); color: var(--ex-mid); }
.ex-score-pill.bad { background: var(--ex-bad-soft); color: var(--ex-bad); }

/* ---------- Phiên làm bài ---------- */
.ex-sbar {
  position: sticky; top: 62px; z-index: 30;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.65rem; background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.ex-sbar-mid { min-width: 0; }
.ex-sbar-label { font-size: 0.78rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 0.25rem; }
.ex-progress { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ex-progress > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.3s ease; }
.ex-sbar-right { display: flex; align-items: center; gap: 0.45rem; }
.ex-score-live { font-size: 0.76rem; font-weight: 700; color: var(--ex-good); white-space: nowrap; }
.ex-timer {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.55rem; border-radius: 8px;
  background: var(--surface-2); font-variant-numeric: tabular-nums; font-size: 0.88rem;
}
.ex-timer b { font-weight: 800; }
.ex-timer-warn { background: var(--ex-bad-soft) !important; color: var(--ex-bad) !important; animation: exPulse 1s ease-in-out infinite; }
@keyframes exPulse { 50% { opacity: 0.65; } }
@media (max-width: 600px) {
  .ex-sbar { grid-template-columns: auto minmax(0, 1fr); top: 58px; }
  .ex-sbar-right { grid-column: 1 / -1; justify-content: flex-end; }
  .ex-sbar-label { font-size: 0.74rem; }
}

.ex-session-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 0.9rem; align-items: start; margin-top: 0.9rem; }
@media (max-width: 920px) { .ex-session-grid { grid-template-columns: 1fr; } }
.split-active .ex-session-grid { grid-template-columns: 1fr; }
.ex-qcard { padding: 1.15rem 1.2rem; }
.ex-qmeta { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.ex-qnum { font-weight: 800; font-size: 0.86rem; margin-right: 0.15rem; }
.ex-qnum span { color: var(--ink-faint); font-weight: 700; }
.ex-badge-btn { border: none; cursor: pointer; font: inherit; font-size: 0.72rem; font-weight: 700; }
.ex-badge-btn:hover { filter: brightness(0.95); text-decoration: underline; }
.ex-qtext { font-size: 1.08rem; line-height: 1.5; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 0.25rem; }
.ex-qloc { font-size: 0.76rem; color: var(--ink-faint); margin-bottom: 0.3rem; }
.ex-options { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.85rem; }
.ex-opt {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 0.65rem; align-items: center;
  width: 100%; text-align: left; padding: 0.62rem 0.75rem; border-radius: 10px;
  background: var(--surface); border: 1.5px solid var(--border); cursor: pointer;
  font-size: 0.9rem; line-height: 1.45; color: var(--ink);
  transition: border-color 0.12s ease, background 0.12s ease;
}
.ex-opt:hover:not([disabled]) { border-color: var(--ink-faint); background: var(--surface-2); }
.ex-opt-key {
  width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border); font-weight: 800; font-size: 0.8rem; color: var(--ink-muted);
}
.ex-opt.is-chosen { border-color: var(--ink); background: var(--surface-2); }
.ex-opt.is-chosen .ex-opt-key { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.ex-opt.is-correct { border-color: var(--ex-good); background: var(--ex-good-soft); }
.ex-opt.is-correct .ex-opt-key { background: var(--ex-good); color: #fff; border-color: transparent; }
.ex-opt.is-wrong { border-color: var(--ex-bad); background: var(--ex-bad-soft); }
.ex-opt.is-wrong .ex-opt-key { background: var(--ex-bad); color: #fff; border-color: transparent; }
.ex-opt.is-dim { opacity: 0.6; }
.ex-opt[disabled] { cursor: default; }
.ex-opt-mark { display: inline-flex; color: currentColor; }
.ex-opt.is-correct .ex-opt-mark { color: var(--ex-good); }
.ex-opt.is-wrong .ex-opt-mark { color: var(--ex-bad); }

.ex-explain { margin-top: 0.85rem; padding: 0.75rem 0.85rem; border-radius: 10px; font-size: 0.86rem; line-height: 1.55; }
.ex-explain.good { background: var(--ex-good-soft); border: 1px solid color-mix(in srgb, var(--ex-good) 30%, transparent); }
.ex-explain.bad { background: var(--ex-bad-soft); border: 1px solid color-mix(in srgb, var(--ex-bad) 28%, transparent); }
.ex-explain-head { font-weight: 800; margin-bottom: 0.25rem; }
.ex-explain.good .ex-explain-head { color: var(--ex-good); }
.ex-explain.bad .ex-explain-head { color: var(--ex-bad); }
.ex-explain-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.55rem; }

.ex-qnav { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ex-qnav-mid { display: flex; gap: 0.2rem; }
.ex-kbd-hint { font-size: 0.7rem; color: var(--ink-faint); margin-top: 0.6rem; }
.ex-kbd-hint kbd {
  font: inherit; font-size: 0.66rem; font-weight: 700; padding: 0.05rem 0.32rem; border-radius: 4px;
  border: 1px solid var(--border-strong); background: var(--surface-2);
}
@media (hover: none) { .ex-kbd-hint { display: none; } }

.ex-side { display: flex; flex-direction: column; gap: 0.75rem; position: sticky; top: 128px; }
@media (max-width: 920px) { .ex-side { position: static; } }
.ex-navgrid-card, .ex-side-tip, .ex-drawer { padding: 0.85rem 0.9rem; }
.ex-navgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 0.3rem; }
.ex-nav-cell {
  height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  font-size: 0.78rem; font-weight: 700; color: var(--ink-muted); cursor: pointer; position: relative;
  font-variant-numeric: tabular-nums;
}
.ex-nav-cell:hover { border-color: var(--ink-faint); }
.ex-nav-cell.answered { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.ex-nav-cell.right { background: var(--ex-good); color: #fff; border-color: var(--ex-good); }
.ex-nav-cell.wrong { background: var(--ex-bad); color: #fff; border-color: var(--ex-bad); }
.ex-nav-cell.current { box-shadow: 0 0 0 2px var(--accent); }
.ex-nav-cell.flagged::after {
  content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--ex-mid);
}
.ex-legend { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.6rem; font-size: 0.68rem; color: var(--ink-muted); }
.ex-legend span { display: inline-flex; align-items: center; gap: 0.25rem; }
.ex-legend .lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; border: 1px solid var(--border); }
.ex-legend .lg.answered { background: var(--ink); }
.ex-legend .lg.flagged { background: var(--ex-mid); border-radius: 50%; }
.ex-legend .lg.right { background: var(--ex-good); }
.ex-legend .lg.wrong { background: var(--ex-bad); }
.ex-side-tip p { font-size: 0.78rem; line-height: 1.5; }

.ex-drawer { border-top: 3px solid var(--accent); }
.ex-drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.25rem; }
.ex-drawer-head .btn { min-height: 28px; padding: 0.1rem 0.4rem; }
.ex-drawer-title { font-weight: 700; font-size: 0.84rem; line-height: 1.4; margin-bottom: 0.2rem; }
.ex-branches { padding-left: 1.15rem; font-size: 0.8rem; line-height: 1.5; display: flex; flex-direction: column; gap: 0.18rem; }
.ex-pitfall {
  margin-top: 0.55rem; font-size: 0.77rem; line-height: 1.5; padding: 0.5rem 0.6rem; border-radius: 8px;
  background: var(--ex-mid-soft); border-left: 3px solid var(--ex-mid);
}
.ex-drawer-actions { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.6rem; }

/* ---------- Kết quả ---------- */
.ex-result-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(220px, 300px); gap: 1.2rem; align-items: center;
  padding: 1.15rem 1.25rem;
}
@media (max-width: 900px) { .ex-result-head { grid-template-columns: auto minmax(0, 1fr); } .ex-result-cats { grid-column: 1 / -1; } }
@media (max-width: 520px) { .ex-result-head { grid-template-columns: 1fr; justify-items: start; } }
.ex-result-score { position: relative; width: 112px; height: 112px; }
.ex-result-score .ex-ring-fg { stroke-width: 8; }
.ex-result-score .ex-ring-bg { stroke-width: 8; }
.ex-result-score.good .ex-ring-fg { stroke: var(--ex-good); }
.ex-result-score.mid .ex-ring-fg { stroke: var(--ex-mid); }
.ex-result-score.bad .ex-ring-fg { stroke: var(--ex-bad); }
.ex-result-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.ex-result-num span { font-size: 0.8rem; color: var(--ink-faint); margin-left: 1px; margin-top: 0.55rem; }
.ex-result-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.6rem; align-items: center; }

.ex-bar { margin-bottom: 0.5rem; }
.ex-bar-top { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.75rem; margin-bottom: 0.2rem; }
.ex-bar-top span:first-child { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-bar-top span:last-child { color: var(--ink-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ex-bar-track { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ex-bar-fill { height: 100%; border-radius: 99px; }
.ex-bar-fill.good { background: var(--ex-good); }
.ex-bar-fill.mid { background: var(--ex-mid); }
.ex-bar-fill.bad { background: var(--ex-bad); }

.ex-review { display: flex; flex-direction: column; gap: 0.6rem; }
.ex-review-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.55rem; }
.ex-review-item { padding: 0.85rem 1rem; border-left: 3px solid var(--border-strong); }
.ex-review-item.good { border-left-color: var(--ex-good); }
.ex-review-item.bad { border-left-color: var(--ex-bad); }
.ex-review-q { font-weight: 700; font-size: 0.9rem; line-height: 1.5; }
.ex-review-ans { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.45rem; }
.ex-ans { display: flex; gap: 0.35rem; align-items: flex-start; font-size: 0.83rem; line-height: 1.45; }
.ex-ans svg { flex-shrink: 0; margin-top: 2px; }
.ex-ans.good { color: var(--ex-good); font-weight: 600; }
.ex-ans.bad { color: var(--ex-bad); }
.ex-review-explain { font-size: 0.8rem; color: var(--ink-muted); line-height: 1.55; margin-top: 0.4rem; }
.ex-empty { padding: 1.2rem; text-align: center; color: var(--ink-muted); font-size: 0.86rem; }

/* ---------- Vấn đáp ---------- */
.ex-backbar { display: flex; align-items: center; gap: 0.5rem; }
.ex-backbar-title { font-weight: 800; font-size: 0.9rem; }
.ex-oral-setup { padding: 1.05rem 1.1rem; border-top: 3px solid var(--accent); }
.ex-oral-q { padding: 1.05rem 1.15rem; }
.ex-oral-title { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.32; margin: 0.2rem 0 0.25rem; }
.ex-oral-phase { display: flex; gap: 0.3rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.ex-phase { font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-faint); }
.ex-phase.active { background: var(--accent); color: #fff; }
.ex-phase.done { background: var(--ex-good-soft); color: var(--ex-good); }
.ex-oral-timerbox { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; margin-top: 0.85rem; }
.ex-oral-timer { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; padding: 0 0.3rem; border-radius: 8px; }
.ex-oral-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ex-oral-track > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width 1s linear; }
.ex-oral-timerbox .ex-muted { font-size: 0.74rem; }
@media (max-width: 520px) { .ex-oral-timerbox { grid-template-columns: auto minmax(0, 1fr); } .ex-oral-timerbox .ex-muted { display: none; } }
.ex-oral-work { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.ex-oral-score { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.6rem; font-size: 0.84rem; color: var(--ink-muted); flex-wrap: wrap; }
.ex-oral-review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.9rem; align-items: start; }
.ex-oral-review > .card { padding: 1rem 1.05rem; }
@media (max-width: 900px) { .ex-oral-review { grid-template-columns: 1fr; } }
.split-active .ex-oral-review { grid-template-columns: 1fr; }
.ex-checklist { display: flex; flex-direction: column; gap: 0.35rem; }
.ex-check {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 0.55rem; align-items: center;
  padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; font-size: 0.85rem;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.ex-check input { position: absolute; opacity: 0; pointer-events: none; }
.ex-check-box {
  width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; color: transparent;
}
.ex-check.on { background: var(--ex-good-soft); border-color: color-mix(in srgb, var(--ex-good) 35%, transparent); }
.ex-check.on .ex-check-box { background: var(--ex-good); border-color: var(--ex-good); color: #fff; }
.ex-check:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.ex-check-auto { font-size: 0.66rem; font-weight: 700; padding: 0.08rem 0.42rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-faint); white-space: nowrap; }
.ex-check-auto.hit { background: var(--info-soft); color: var(--info); }
.ex-oral-overview { font-size: 0.84rem; line-height: 1.6; }
.ex-concl { padding-left: 1.1rem; font-size: 0.8rem; line-height: 1.55; display: flex; flex-direction: column; gap: 0.2rem; }
.ex-mytext { margin-top: 0.8rem; font-size: 0.8rem; }
.ex-mytext summary { cursor: pointer; font-weight: 700; color: var(--ink-muted); }
.ex-mytext pre {
  white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 0.8rem; line-height: 1.55;
  background: var(--surface-2); border-radius: 8px; padding: 0.6rem 0.7rem; margin-top: 0.4rem; max-height: 260px; overflow: auto;
}

/* ---------- Niên biểu & Ghép cặp ---------- */
.ex-tl-play, .ex-mt-play { padding: 1.05rem 1.1rem; border-top: 3px solid var(--accent); }
.ex-tl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.9rem; }
@media (max-width: 820px) { .ex-tl-grid { grid-template-columns: 1fr; } }
.split-active .ex-tl-grid { grid-template-columns: 1fr; }
.ex-tl-pool { display: flex; flex-direction: column; gap: 0.38rem; }
.ex-tl-ev {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 0.55rem; align-items: start; text-align: left;
  padding: 0.5rem 0.6rem; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface);
  font-size: 0.82rem; line-height: 1.45; cursor: pointer; color: var(--ink);
}
.ex-tl-ev:hover:not([disabled]) { border-color: var(--ink-faint); }
.ex-tl-ev.picked { border-color: var(--ink); background: var(--surface-2); }
.ex-tl-no {
  width: 26px; height: 26px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--surface); font-weight: 800; font-size: 0.76rem; flex-shrink: 0;
}
.ex-tl-no.empty { background: transparent; border: 1.5px dashed var(--border-strong); }
.ex-tl-answer { list-style: none; display: flex; flex-direction: column; gap: 0.38rem; }
.ex-tl-answer .slot {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 0.55rem; align-items: start;
  padding: 0.5rem 0.6rem; border-radius: 9px; border: 1px solid var(--border); font-size: 0.82rem; line-height: 1.45; background: var(--surface-2);
}
.ex-tl-answer .slot.empty { background: transparent; border-style: dashed; }
.ex-tl-answer .slot.good { background: var(--ex-good-soft); border-color: color-mix(in srgb, var(--ex-good) 35%, transparent); }
.ex-tl-answer .slot.good .ex-tl-no { background: var(--ex-good); }
.ex-tl-answer .slot.bad { background: var(--ex-bad-soft); border-color: color-mix(in srgb, var(--ex-bad) 35%, transparent); }
.ex-tl-answer .slot.bad .ex-tl-no { background: var(--ex-bad); }
.ex-tl-key { padding-left: 1.15rem; display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.8rem; margin-top: 0.35rem; }

.ex-mt-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 0.6rem; }
@media (max-width: 640px) { .ex-mt-grid { grid-template-columns: 1fr 1fr; gap: 0.4rem; } }
.ex-mt-col { display: flex; flex-direction: column; gap: 0.38rem; }
.ex-mt-item {
  text-align: left; padding: 0.55rem 0.65rem; border-radius: 9px; border: 1.5px solid var(--border);
  background: var(--surface); font-size: 0.82rem; line-height: 1.42; cursor: pointer; color: var(--ink); min-height: 48px;
  transition: border-color 0.12s ease, background 0.12s ease, opacity 0.2s ease;
}
.ex-mt-item:hover:not([disabled]) { border-color: var(--ink-faint); }
.ex-mt-item.sel { border-color: var(--ink); background: var(--surface-2); box-shadow: 0 0 0 1px var(--ink); }
.ex-mt-item.done { border-color: color-mix(in srgb, var(--ex-good) 40%, transparent); background: var(--ex-good-soft); color: var(--ex-good); opacity: 0.75; cursor: default; }
.ex-mt-item.bad { border-color: var(--ex-bad); background: var(--ex-bad-soft); animation: exShake 0.3s ease; }
@keyframes exShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.ex-picklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.45rem; margin-top: 0.7rem; }
.ex-pick {
  display: flex; flex-direction: column; gap: 0.2rem; text-align: left; padding: 0.6rem 0.7rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--ink);
}
.ex-pick:hover { border-color: var(--accent); }
.ex-pick.active { border-color: var(--accent); background: var(--accent-soft); }
.ex-pick-title { font-size: 0.8rem; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ex-pick-meta { font-size: 0.7rem; color: var(--ink-faint); display: flex; gap: 0.45rem; align-items: center; }
.ex-pick-meta b.good { color: var(--ex-good); }
.ex-pick-meta b.mid { color: var(--ex-mid); }

/* ---------- Sổ lỗi sai & thống kê ---------- */
.ex-mk-item { padding: 0.75rem 0; border-top: 1px solid var(--border); }
.ex-mk-item:first-of-type { border-top: none; }
.ex-mk-ans { margin-top: 0.4rem; font-size: 0.82rem; }
.ex-mk-ans summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: 0.78rem; }
.ex-mk-ans .ex-ans { margin-top: 0.35rem; }

.ex-stats-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.9rem; align-items: start; }
.ex-stats-grid > .card { padding: 1rem 1.05rem; }
@media (max-width: 900px) { .ex-stats-grid { grid-template-columns: 1fr; } }
.split-active .ex-stats-grid { grid-template-columns: 1fr; }
.ex-heat { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; }
.ex-heat-cell {
  aspect-ratio: 1; border-radius: 4px;
  background: color-mix(in srgb, var(--accent) calc(var(--lv) * 100%), var(--surface-2));
}
.ex-spark { width: 100%; height: 90px; display: block; }
.ex-spark-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ex-spark-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ex-spark-mid { stroke: var(--border-strong); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.ex-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.35rem; }
@media (max-width: 520px) { .ex-boxes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ex-box { background: var(--surface-2); border-radius: 8px; padding: 0.45rem 0.4rem; text-align: center; display: flex; flex-direction: column; }
.ex-box b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ex-box span { font-size: 0.66rem; font-weight: 700; color: var(--ink-muted); }
.ex-box i { font-size: 0.62rem; color: var(--ink-faint); font-style: normal; }

/* ---------- Widget trang chủ & Đa nhiệm ---------- */
.ex-home {
  display: flex; justify-content: space-between; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  padding: 0.85rem 1rem; margin-bottom: 1rem; border-left: 4px solid var(--accent);
}
.ex-home-left { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.ex-home-title { font-weight: 800; font-size: 1rem; letter-spacing: -0.01em; }
.ex-home-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; font-size: 0.75rem; color: var(--ink-muted); }
.ex-home-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.ex-mini { display: flex; flex-direction: column; gap: 0.45rem; }
.ex-mini-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }
.ex-mini-head .btn { min-height: 24px; font-size: 0.7rem; padding: 0.1rem 0.4rem; text-transform: none; letter-spacing: 0; }
.ex-mini-q { font-size: 0.82rem; font-weight: 700; line-height: 1.45; }
.ex-mini-opts { display: flex; flex-direction: column; gap: 0.28rem; }
.ex-mini-opt {
  text-align: left; font-size: 0.77rem; line-height: 1.4; padding: 0.38rem 0.5rem; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--ink);
}
.ex-mini-opt b { color: var(--ink-faint); margin-right: 0.2rem; }
.ex-mini-opt:hover:not([disabled]) { border-color: var(--ink-faint); }
.ex-mini-opt.is-correct { border-color: var(--ex-good); background: var(--ex-good-soft); }
.ex-mini-opt.is-wrong { border-color: var(--ex-bad); background: var(--ex-bad-soft); }
.ex-mini-opt.is-dim { opacity: 0.55; }
.ex-mini-opt[disabled] { cursor: default; }
.ex-mini-explain { font-size: 0.74rem; line-height: 1.5; color: var(--ink-muted); background: var(--surface); border-radius: 7px; padding: 0.4rem 0.5rem; }

.ex-toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 400;
  background: var(--ink); color: var(--surface); padding: 0.55rem 0.95rem; border-radius: 10px;
  font-size: 0.83rem; font-weight: 600; box-shadow: var(--shadow-md); max-width: calc(100vw - 32px);
  animation: exToast 0.22s ease both;
}
@keyframes exToast { from { opacity: 0; transform: translate(-50%, 8px); } }

/* Thanh điều hướng di động: 6 mục */
@media (max-width: 860px) {
  .pe-nav-item { font-size: 0.6rem; padding: 0.3rem 0; min-width: 0; }
  .pe-nav-item span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ex-timer-warn, .ex-mt-item.bad, .ex-toast { animation: none; }
  .ex-mode, .portal-card, .era-tab-card.has-photo .era-bg { transition: none; }
}

@media print {
  .ex-sbar, .ex-side, .ex-qnav, .ex-kbd-hint, .ex-toast { display: none !important; }
}


/* ==========================================================================
   LỊCH SỬ STUDIO V15 ULTRA — GIAO DIỆN HIỆN ĐẠI GỌN ĐẸP, BỘ NÃO AI TRANG/DÒNG & ÔN THI
   ========================================================================== */

/* Modern Glassmorphic Topbar & Smooth Cards */
.topbar {
  background: color-mix(in srgb, var(--surface) 88%, transparent) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.card {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Login View V15 */
.v15-hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.v15-auth-card {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
  border-radius: 18px;
}
.v15-btn-google {
  min-height: 44px;
  font-weight: 700;
  border-radius: 11px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.v15-btn-google:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Clean Post-Login Hero & AI Brain Search Bar */
.v15-clean-hero {
  padding: 1.2rem 1.3rem;
  margin-bottom: 1rem;
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(90% 120% at 0% 100%, var(--gold-soft) 0%, transparent 55%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.v15-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.95rem;
}
.v15-kpi-pills {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.v15-kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.36rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.v15-kpi-pill strong {
  color: var(--accent);
  font-weight: 800;
}
.v15-kpi-pill:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.v15-brain-bar-wrap {
  position: relative;
}
.v15-brain-search-box {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem 0.45rem 0.85rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.v15-brain-search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.v15-brain-input {
  flex: 1;
  min-width: 120px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9rem;
  color: var(--ink);
}

/* Live Citation Dropdown (File • Page • Line) */
.v15-live-dropdown {
  margin-top: 0.55rem;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: v15FadeSlide 0.18s ease-out;
}
@keyframes v15FadeSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.v15-live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.48rem 0.85rem;
  background: var(--accent-soft);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}
.v15-live-list {
  display: flex;
  flex-direction: column;
  max-height: 310px;
  overflow-y: auto;
}
.v15-live-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s ease;
}
.v15-live-item:last-child {
  border-bottom: none;
}
.v15-live-item:hover {
  background: var(--surface-2);
}
.v15-live-excerpt {
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Home Exam Strip */
.v15-home-exam-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.15rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--accent);
}
.v15-home-exam-badge {
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* Exam 3-Tab Switcher (Tự luận • Vấn đáp • Trắc nghiệm ý chính) */
.v15-exam-tabs-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
@media (max-width: 780px) {
  .v15-exam-tabs-bar {
    grid-template-columns: 1fr;
  }
}
.v15-exam-tab {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.16s ease;
}
.v15-exam-tab:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.v15-exam-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}
.v15-tab-icon {
  font-size: 1.45rem;
  flex-shrink: 0;
}
.v15-tab-title {
  font-weight: 800;
  font-size: 0.94rem;
  color: var(--ink);
}
.v15-tab-sub {
  font-size: 0.74rem;
  color: var(--ink-muted);
  margin-top: 0.1rem;
}

/* Exam Config & Question Stage */
.v15-exam-workspace {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.v15-exam-config-card {
  padding: 1.1rem 1.2rem;
  border-top: 3px solid var(--accent);
}
.v15-config-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.v15-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
@media (max-width: 720px) {
  .v15-config-grid {
    grid-template-columns: 1fr;
  }
}

.v15-question-stage {
  padding: 1.2rem 1.25rem;
}
.v15-prompt-title {
  font-size: 1.3rem;
  line-height: 1.35;
  margin: 0.35rem 0 0.85rem;
  color: var(--ink);
}

.v15-timer-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}
.v15-timer-banner.in-prep {
  background: var(--gold-soft);
  border-color: var(--gold);
}
.v15-timer-banner.in-exam {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.v15-timer-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.v15-timer-digits {
  font-size: 2.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--accent);
  background: var(--surface);
  padding: 0.25rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.v15-timer-controls {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Pre-Existing Answer Card */
.v15-answer-card {
  padding: 1.25rem;
  border-top: 4px solid var(--success);
}
.v15-answer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding-bottom: 0.85rem;
  margin-bottom: 0.95rem;
  border-bottom: 1px solid var(--border);
}
.v15-ans-block {
  margin-bottom: 1rem;
}
.v15-ans-step {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 0.45rem;
}
.v15-branch-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.v15-branch-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.v15-sec-card {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.v15-sec-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--accent);
}

/* Document Page & Line Reader */
.v15-pages-container {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-height: 620px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.v15-page-sheet {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
}
.v15-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.9rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--ink-muted);
}
.v15-page-lines {
  display: flex;
  flex-direction: column;
}
.v15-doc-line {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.4rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.87rem;
  line-height: 1.55;
  align-items: baseline;
}
.v15-doc-line:last-child {
  border-bottom: none;
}
.v15-line-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  background: var(--surface-2);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  text-align: center;
  user-select: none;
}
.v15-line-highlight {
  background: var(--gold-soft) !important;
  border-left: 4px solid var(--accent);
  animation: v15LinePulse 1.8s ease-in-out 2;
}
.v15-line-highlight .v15-line-badge {
  background: var(--accent);
  color: #fff;
}
@keyframes v15LinePulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(0.94); }
}

/* AI Dock Live Citations Strip */
.v15-ai-live-strip {
  padding: 0.45rem 0.65rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 135px;
  overflow-y: auto;
}
.v15-ai-live-chip {
  text-align: left;
  font-size: 0.73rem;
  line-height: 1.38;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v15-ai-live-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.v15-ai-live-chip strong {
  color: var(--accent);
}


/* ==========================================================================
   V15.2 ULTRA-CLEAN STREAMLINED UI, BENTO & PROGRESSIVE ACCORDION
   ========================================================================== */
.v15-stat-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--ink-muted);
}
.v15-stat-tag strong {
  color: var(--accent);
  font-weight: 800;
}

.v15-bento-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}
@media (max-width: 860px) {
  .v15-bento-3 {
    grid-template-columns: 1fr;
  }
}
.v15-bento-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.v15-bento-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.v15-bento-card.primary-bento {
  background:
    radial-gradient(120% 120% at 100% 0%, var(--accent-soft) 0%, transparent 65%),
    var(--surface);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.v15-bento-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
}
.v15-bento-icon {
  font-size: 1.65rem;
  line-height: 1;
}
.v15-bento-title {
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
  color: var(--ink);
}
.v15-bento-sub {
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-bottom: 0.9rem;
}
.v15-bento-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}
.v15-bento-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}

/* Ecosystem Sub-Switcher */
.v15-eco-switcher {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.v15-eco-btn {
  flex: 1;
  min-width: 130px;
  padding: 0.48rem 0.75rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.v15-eco-btn:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.v15-eco-btn.active {
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow-xs);
}

/* Streamlined Exam Pill Tabs & Compact Stage */
.v15-pill-tabs {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.32rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  align-self: flex-start;
  flex-wrap: wrap;
}
.v15-pill-btn {
  padding: 0.48rem 1rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.v15-pill-btn:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.v15-pill-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.v15-compact-stage {
  padding: 1.15rem 1.25rem;
  border-top: 3px solid var(--accent);
}
.v15-selector-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 720px) {
  .v15-selector-row {
    grid-template-columns: 1fr;
  }
}
.v15-question-box {
  margin-bottom: 0.85rem;
}
.v15-time-presets {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  font-size: 0.74rem;
  color: var(--ink-muted);
}
.v15-mini-chip {
  padding: 0.14rem 0.48rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
}
.v15-mini-chip.active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
.v15-reveal-bar {
  margin-top: 0.9rem;
  display: flex;
  justify-content: center;
}
.v15-reveal-btn {
  width: 100%;
  max-width: 420px;
  font-weight: 800;
  font-size: 0.92rem;
  min-height: 42px;
}

/* Accordion for Clean Progressive Disclosure */
.v15-ans-summary-box {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.v15-branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.45rem;
}
.v15-accordion {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.v15-accordion-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.68rem 0.9rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
  list-style: none;
  user-select: none;
  transition: background 0.12s ease;
}
.v15-accordion-head::-webkit-details-marker {
  display: none;
}
.v15-accordion-head:hover {
  background: var(--surface-2);
}
.v15-accordion[open] > .v15-accordion-head {
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  background: var(--accent-soft);
}
.v15-accordion-body {
  padding: 0.75rem 0.95rem;
  font-size: 0.88rem;
  line-height: 1.58;
}


/* ==========================================================================
   V16 ULTRA — BÔI VÀNG TỪ KHÓA, KỆ SÁCH THƯ VIỆN PDF & LIVE CODE STUDIO
   ========================================================================== */

/* Hiệu ứng Bôi vàng từ khóa (Yellow Keyword Highlight) */
mark.v15-kw-highlight {
  background: #FDE047;
  color: #111827;
  padding: 0.08rem 0.32rem;
  border-radius: 5px;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.45);
}
mark.v15-kw-highlight.pulse {
  animation: v16KwPulse 1.6s ease-in-out 2;
}
@keyframes v16KwPulse {
  0%, 100% { transform: scale(1); background: #FDE047; }
  50% { transform: scale(1.04); background: #FACC15; box-shadow: 0 0 12px rgba(250, 204, 21, 0.75); }
}

/* Kệ Sách Thư viện (Library Bookshelf Grid) */
.v16-bookshelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.v16-book-card {
  display: flex;
  align-items: stretch;
  gap: 0.85rem;
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  transition: all 0.16s ease;
}
.v16-book-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.v16-book-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.v16-book-spine {
  width: 44px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: #fff;
  flex-shrink: 0;
}
.v16-book-spine.pdf-spine {
  background: linear-gradient(145deg, #B91C1C, #7F1D1D);
}
.v16-book-spine.doc-spine {
  background: linear-gradient(145deg, #1D4ED8, #1E3A8A);
}
.v16-book-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.v16-book-title {
  font-size: 0.92rem;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.v16-book-path {
  font-size: 0.7rem;
  color: var(--ink-faint);
  margin-top: 0.28rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Admin Live Code Studio & Full Source Editor */
.v16-code-studio-card {
  padding: 1.15rem 1.25rem;
}
.v16-autofix-box {
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  margin-bottom: 0.9rem;
}
.v16-studio-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
}
@media (max-width: 820px) {
  .v16-studio-grid {
    grid-template-columns: 1fr;
  }
}
.v16-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--surface-2);
  padding: 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.v16-file-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.65rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.v16-file-btn:hover {
  background: var(--surface);
}
.v16-file-btn.active {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 800;
}
.v16-editor-pane {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  background: #0F172A;
}
.v16-editor-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.85rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.v16-code-textarea {
  width: 100%;
  min-height: 440px;
  padding: 0.85rem 1rem;
  border: none;
  outline: none;
  resize: vertical;
  background: #0F172A;
  color: #E2E8F0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
}


/* ==========================================================================
   V17 VIP — DẢI DẪN NGUỒN AI SIÊU GỌN, THƯ VIỆN PHÂN LOẠI, SỬA FILE & CÀI ĐẶT
   ========================================================================== */

/* Dải dẫn nguồn trực tiếp trong khung chat AI (gọn 1 dòng thay vì 3 hộp lớn như ảnh cũ) */
.v17-ai-cite-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.65rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
}
.v17-ai-cite-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}
.v17-ai-cite-pills {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.v17-ai-cite-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.14s ease;
}
.v17-ai-cite-pill:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Hộp gợi ý dẫn nguồn trang chủ gọn đẹp */
.v17-compact-live-box {
  margin-top: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.v17-compact-live-grid {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.v17-compact-hit-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.36rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease;
}
.v17-compact-hit-pill:hover {
  border-color: var(--accent);
}
.v17-hit-text {
  flex: 1;
  min-width: 0;
  font-size: 0.79rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Kho Lưu Trữ Tài Liệu & Sửa File */
.v17-vault-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}
.v17-edit-doc-box {
  padding: 0.95rem 1.05rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
}

/* Nút Admin bỏ ảnh trên thẻ bài học */
.v17-admin-img-btn {
  position: absolute;
  bottom: 0.45rem;
  right: 0.45rem;
  z-index: 3;
  padding: 0.16rem 0.48rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.78);
  color: #FCA5A5;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.v17-admin-img-btn:hover {
  background: #991B1B;
  color: #fff;
}

/* Bảng trạng thái chờ Admin duyệt VIP */
.v17-pending-board {
  padding: 1.65rem 1.75rem;
  border-top: 4px solid var(--gold);
}
.v17-pending-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.v17-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
}
.v17-step strong {
  display: block;
  color: var(--ink);
  font-size: 0.84rem;
}
.v17-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
}
.v17-step.done .v17-step-dot {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}
.v17-step.current .v17-step-dot {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

/* Modal Setting & Hồ sơ Thành viên VIP */
.v17-member-card {
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.v17-logout-btn {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  font-weight: 800;
}
.v17-logout-btn:hover {
  background: var(--accent);
  color: #fff;
}


/* ==========================================================================
   V18 WINDOWS 11 / BIG-TECH COMPACT USER POPOVER MENU
   ========================================================================== */
.v18-user-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.user-pill.active {
  border-color: var(--accent);
  background: var(--surface-2);
}
.v18-user-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 268px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.24), 0 2px 8px rgba(15, 23, 42, 0.08);
  padding: 0.55rem;
  z-index: 950;
  animation: v18PopIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes v18PopIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.v18-pop-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.45rem;
  border-radius: 10px;
}
.v18-flyout-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.92rem;
  border: 1.5px solid var(--border-strong);
}
.v18-av-cam {
  position: absolute;
  bottom: -2px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.v18-pop-name {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v18-icon-mini {
  border: none;
  background: transparent;
  padding: 0.1rem 0.2rem;
  font-size: 0.72rem;
  cursor: pointer;
  opacity: 0.7;
  border-radius: 5px;
}
.v18-icon-mini:hover {
  opacity: 1;
  background: var(--surface-2);
}
.v18-pop-sub {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-top: 0.08rem;
}
.v18-role-dot {
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--accent);
}
.v18-inline-rename {
  display: flex;
  gap: 0.35rem;
  padding: 0.3rem 0.4rem;
}
.v18-pop-divider {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0.2rem;
}
.v18-pop-section {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  padding: 0.2rem 0.35rem;
}
.v18-pop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}
.v18-pop-lbl {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-muted);
}
.v18-seg {
  display: inline-flex;
  background: var(--surface-2);
  padding: 0.14rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  gap: 0.12rem;
}
.v18-seg-btn {
  border: none;
  background: transparent;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.12s ease;
}
.v18-seg-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.v18-pop-menu {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.v18-menu-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.44rem 0.55rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}
.v18-menu-item:hover {
  background: var(--surface-2);
}
.v18-menu-arrow {
  font-size: 0.74rem;
  color: var(--ink-faint);
}
.v18-menu-logout {
  color: var(--accent);
  font-weight: 800;
}
.v18-menu-logout:hover {
  background: var(--accent-soft);
}

/* Đảm bảo nút cuộn không bao giờ đè lên Modal / Popover */
#scroll-top-btn, #scroll-jump-fab {
  z-index: 35 !important;
}


/* V19 Ultra-Compact Popover 2x2 Action Tiles */
.v18-user-popover {
  width: 238px !important;
  padding: 0.45rem !important;
}
.v19-pop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.3rem;
  padding: 0.15rem 0.2rem;
}
.v19-tile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.42rem 0.35rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}
.v19-tile-btn:hover, .v19-tile-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.v19-tile-logout {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.v19-tile-logout:hover {
  background: var(--accent) !important;
  color: #fff !important;
}


/* ==========================================================================
   V20 ULTRA-COMPACT WINDOWS 11 / GITHUB STYLE USER SETTING DROPDOWN
   ========================================================================== */
.v20-user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 206px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
  padding: 0.35rem;
  z-index: 960;
  animation: v18PopIn 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}
.v20-dd-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.4rem;
}
.v20-mini-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
}
.v20-dd-name {
  font-size: 0.79rem;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 112px;
}
.v20-dd-sub {
  font-size: 0.67rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v20-dd-sep {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0.15rem;
}
.v20-dd-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.36rem 0.5rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s ease;
}
.v20-dd-item:hover {
  background: var(--surface-2);
}
.v20-dd-val {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-muted);
  background: var(--surface-2);
  padding: 0.08rem 0.38rem;
  border-radius: 5px;
  border: 1px solid var(--border);
}
.v20-dd-logout {
  color: var(--accent);
  font-weight: 800;
}
.v20-dd-logout:hover {
  background: var(--accent-soft);
}

/* Bento 4 cards for Study Hub */
.v15-bento-4 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
@media (max-width: 760px) {
  .v15-bento-4 {
    grid-template-columns: 1fr;
  }
}

/* === V14.5 3D BENTO & BOARDCARD 3D === */
.v15-bento-card {
  position: relative;
  border-radius: 16px;
  box-shadow:
    0 4px 12px rgba(15, 23, 42, 0.05),
    0 1px 2px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.v15-bento-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.09),
    0 4px 10px rgba(180, 83, 9, 0.07);
}
.v15-bento-actions {
  position: relative;
  z-index: 5;
  pointer-events: auto;
}
.v15-bento-actions button,
.v15-bento-actions a {
  position: relative;
  z-index: 6;
  pointer-events: auto;
  cursor: pointer;
}

/* Boardcard 3D Stage */
.bc3d-wrap {
  max-width: 780px;
  margin: 0 auto;
}
.bc3d-controls-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.bc3d-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.bc3d-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #d97706);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.bc3d-stage {
  perspective: 1350px;
  min-height: 330px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 1rem;
}
.bc3d-card {
  position: relative;
  width: 100%;
  min-height: 330px;
  transform-style: preserve-3d;
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}
.bc3d-card.is-flipped {
  transform: rotateY(180deg);
}
.bc3d-face {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 330px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 20px;
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border);
  box-shadow:
    0 18px 36px rgba(15, 23, 42, 0.09),
    0 4px 12px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.bc3d-front {
  background: linear-gradient(155deg, var(--surface) 0%, var(--bg-soft, #f8fafc) 100%);
}
.bc3d-back {
  transform: rotateY(180deg);
  background: linear-gradient(155deg, #fffbeb 0%, var(--surface) 100%);
  border-color: rgba(217, 119, 6, 0.35);
}
[data-theme="dark"] .bc3d-back {
  background: linear-gradient(155deg, rgba(180, 83, 9, 0.14) 0%, var(--surface) 100%);
}
.bc3d-face-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.bc3d-face-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 0;
}
.bc3d-q-title {
  font-size: 1.24rem;
  line-height: 1.4;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}
.bc3d-ans-list {
  margin: 0.45rem 0 0 1.1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  font-size: 0.94rem;
  line-height: 1.52;
  color: var(--ink);
}
.bc3d-face-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--ink-muted);
  border-top: 1px dashed var(--border);
  padding-top: 0.65rem;
}
.bc3d-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .bc3d-stage,
  .bc3d-card,
  .bc3d-face {
    min-height: 290px;
  }
  .bc3d-face {
    padding: 1.15rem 1.2rem;
  }
  .bc3d-q-title {
    font-size: 1.06rem;
  }
}


/* === V23: 2-Tab Upload Bento, Target Picker, VIP Profile & Settings, Audio Icon === */
.v23-target-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}
@media (max-width: 720px) {
  .v23-target-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v23-grid-2 { grid-template-columns: 1fr !important; }
}
.v23-target-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}
.v23-target-btn:hover {
  border-color: var(--accent);
  background: var(--surface);
}
.v23-target-btn.active {
  border-color: var(--accent);
  background: rgba(158, 42, 43, 0.08);
  box-shadow: 0 0 0 2px rgba(158, 42, 43, 0.12);
}
.v23-target-btn strong { display: block; font-size: 0.8rem; line-height: 1.2; }
.v23-target-btn small { display: block; font-size: 0.68rem; color: var(--ink-muted); }
.v23-target-icon { font-size: 1.15rem; flex-shrink: 0; }

.v23-vip-page {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.v23-vip-hero {
  padding: 1.15rem 1.25rem;
  border-top: 3px solid var(--accent);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
}
.v23-vip-avatar {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  flex-shrink: 0;
}
.v23-vip-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}
@media (max-width: 780px) {
  .v23-vip-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.v23-stat-box {
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.v23-stat-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}
.v23-stat-lbl {
  font-size: 0.74rem;
  color: var(--ink-muted);
}
.ai-msg-speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.86rem;
  padding: 0;
}
.ai-msg-speak-btn:hover {
  border-color: var(--accent);
  transform: scale(1.06);
}

.v23-dest-box {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.v23-dest-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.v23-dest-lbl {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--ink-muted);
  min-width: 56px;
}


/* === V18: SLEEK AI PILL COMPOSER (MATCHING SCREENSHOT) === */
.v18-ai-composer-wrap {
  padding: 0.55rem 0.7rem 0.65rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: relative;
}
.v18-ai-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #18181b;
  color: #f4f4f5;
  border-radius: 999px;
  padding: 0.32rem 0.38rem 0.32rem 0.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.v18-ai-plus-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #e4e4e7;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.v18-ai-plus-btn:hover { background: rgba(255,255,255,0.1); }
.v18-ai-input {
  flex: 1;
  min-width: 70px;
  background: transparent;
  border: none;
  outline: none;
  color: #fafafa;
  font-size: 0.84rem;
  padding: 0.25rem 0.2rem;
}
.v18-ai-input::placeholder { color: #a1a1aa; }
.v18-ai-model-select {
  background: transparent;
  border: none;
  outline: none;
  color: #e4e4e7;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.25rem;
  max-width: 122px;
}
.v18-ai-model-select option {
  background: #18181b;
  color: #fafafa;
}
.v18-ai-mic-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #d4d4d8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.v18-ai-mic-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.v18-ai-mic-btn.listening { color: #ef4444; background: rgba(239,68,68,0.18); }
.v18-ai-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #4f46e5;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
  font-weight: 800;
  transition: transform 0.15s, background 0.15s;
}
.v18-ai-send-btn:hover { background: #4338ca; transform: translateY(-1px); }
.v18-ai-popover {
  margin-bottom: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* === V18: FULLSCREEN MINI TIEN ICH & 3D STUDIO === */
.v18-mini-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1250;
  background: var(--bg, #f6f4ef);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: v18FadeIn 0.18s ease-out;
}
@keyframes v18FadeIn {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}
.v18-mini-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.v18-mini-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}
.v18-3d-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  perspective: 1100px;
}
.v18-3d-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.15rem;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08), 0 4px 0 rgba(15, 23, 42, 0.06);
  transform-style: preserve-3d;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}
.v18-3d-card:hover {
  transform: translateY(-6px) rotateX(4deg) rotateY(-3deg);
  box-shadow: 0 20px 36px rgba(79, 70, 229, 0.14), 0 6px 0 var(--accent);
}
/* 3D Memory Flip Cards */
.v18-flip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  perspective: 1000px;
}
@media (max-width: 640px) {
  .v18-flip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.v18-flip-card {
  height: 110px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}
.v18-flip-card.flipped, .v18-flip-card.matched {
  transform: rotateY(180deg);
}
.v18-flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem;
  font-weight: 700;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}
.v18-flip-front {
  background: linear-gradient(135deg, #1e1b4b, #4338ca);
  color: #fff;
  font-size: 1.4rem;
}
.v18-flip-back {
  background: var(--surface);
  color: var(--ink);
  transform: rotateY(180deg);
}
.v18-flip-card.matched .v18-flip-back {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}
/* 3D Flip Clock */
.v18-clock-3d-stage {
  perspective: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}
.v18-clock-3d-board {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  transform: rotateX(8deg);
  transform-style: preserve-3d;
  padding: 1.5rem 2rem;
  border-radius: 24px;
  background: linear-gradient(145deg, #18181b, #27272a);
  box-shadow: 0 24px 50px rgba(0,0,0,0.28), 0 8px 0 #09090b;
}
.v18-flip-digit {
  min-width: 84px;
  padding: 0.9rem 0.7rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #27272a 0%, #18181b 50%, #202024 100%);
  color: #fafafa;
  font-size: 3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 6px 14px rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.08);
}
@media (max-width: 600px) {
  .v18-flip-digit { min-width: 56px; font-size: 2rem; padding: 0.6rem 0.4rem; }
  .v18-clock-3d-board { padding: 1rem; gap: 0.4rem; }
}
/* 3D Mystery Cube */
.v18-cube-scene {
  width: 150px;
  height: 150px;
  perspective: 600px;
  margin: 1rem auto 1.4rem;
}
.v18-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.v18-cube-face {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  box-shadow: inset 0 0 24px rgba(0,0,0,0.22);
}
/* 3D Sticky Notes */
.v18-note-3d {
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 10px 22px rgba(0,0,0,0.09), 0 4px 0 rgba(0,0,0,0.07);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  transform-style: preserve-3d;
}
.v18-note-3d:hover {
  transform: translateY(-5px) rotateX(3deg) rotateY(-2deg);
  box-shadow: 0 18px 30px rgba(0,0,0,0.14);
}


/* === V19: LUXURY AI STUDIO PANEL & QUICK CHIPS === */
#ai-dock .ai-panel {
  border-radius: 22px;
  border: 1px solid rgba(99, 102, 241, 0.24);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24), 0 0 0 1px rgba(255,255,255,0.08);
  overflow: hidden;
  backdrop-filter: blur(18px);
}
#ai-dock .ai-panel-header {
  background: linear-gradient(135deg, #18181b 0%, #1e1b4b 100%);
  color: #f8fafc;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 0.65rem 0.85rem;
}
#ai-dock .ai-panel-header .btn-ghost {
  color: #e2e8f0;
}
#ai-dock .ai-panel-header .btn-ghost:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.v19-ai-quick-strip {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.45rem 0.7rem 0.2rem;
  background: var(--surface);
  scrollbar-width: none;
}
.v19-ai-quick-strip::-webkit-scrollbar { display: none; }
.v19-ai-chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.v19-ai-chip:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
}
.v19-ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  display: inline-block;
}


/* === V20: ADVANCED VIETNAMESE TTS SCRUBBER & HOVER-ONLY MUTE === */
.tts-bar {
  position: relative;
  transition: all 0.2s ease;
}
.v20-tts-mute-hover {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.tts-bar:hover .v20-tts-mute-hover,
.tts-bar:focus-within .v20-tts-mute-hover,
.tts-bar.tts-active-touch .v20-tts-mute-hover,
.v20-audio-wrap:hover .v20-tts-mute-hover,
.v20-audio-wrap:focus-within .v20-tts-mute-hover {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}
.v20-tts-scrubber-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.55rem;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.v20-tts-range {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
  height: 6px;
}


/* === V21: WORD-STYLE FULLSCREEN EDITOR, ARCHITECTURAL 3D TOWER & COMPACT PILL TTS === */
.v21-tts-compact-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}
.v21-tts-title-chip {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent);
  max-width: 210px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v21-tts-text-Popover {
  margin-top: 0.35rem;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* Word-like Fullscreen Editor Overlay (Image 4 & Image 5) */
.v21-word-modal {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  animation: v21FadeIn 0.18s ease-out;
}
@keyframes v21FadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
.v21-word-ribbon {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #1e293b 100%);
  color: #fff;
  padding: 0.65rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.v21-word-canvas {
  flex: 1;
  overflow-y: auto;
  padding: 1.4rem 1rem 3rem;
  background: #e2e8f0;
  display: flex;
  justify-content: center;
}
[data-theme="dark"] .v21-word-canvas {
  background: #090d16;
}
.v21-word-sheet {
  width: min(1040px, 96vw);
  background: var(--surface);
  color: var(--ink);
  border-radius: 14px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
  padding: 1.65rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border: 1px solid var(--border);
}

/* Real 3D Architectural Tower Game */
.v21-tower-stage {
  perspective: 1100px;
  min-height: 300px;
  background: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.15), transparent 70%), var(--surface-2);
  border-radius: 18px;
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.v21-tower-spire {
  font-size: 1.9rem;
  filter: drop-shadow(0 6px 12px rgba(234, 179, 8, 0.55));
  animation: v21FloatSpire 2.4s ease-in-out infinite;
  margin-bottom: -4px;
  z-index: 3;
}
@keyframes v21FloatSpire {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.06); }
}
.v21-tower-stack {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 6px;
  width: 100%;
  transform: rotateX(8deg);
  transform-style: preserve-3d;
}
.v21-tower-tier {
  position: relative;
  height: 50px;
  border-radius: 10px 10px 4px 4px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 8px 0 rgba(15, 23, 42, 0.35), 0 14px 24px rgba(0, 0, 0, 0.22);
  border-top: 2px solid rgba(255, 255, 255, 0.45);
  animation: v21DropTier 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
@keyframes v21DropTier {
  from { opacity: 0; transform: translateY(-45px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.v21-tower-tier-thumb {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,0.7);
  flex-shrink: 0;
}
.v21-tower-pedestal {
  width: 96%;
  height: 18px;
  background: linear-gradient(90deg, #475569, #1e293b, #475569);
  border-radius: 6px;
  margin-top: 6px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.3);
}
.v21-game-hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
  cursor: pointer;
}
.v21-game-hero-card:hover {
  transform: translateY(-6px) rotateX(3deg);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
}
.v21-game-banner {
  height: 96px;
  width: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.88);
}


/* === V22: UNIFIED DARK GLASSMORPHIC AI STUDIO (MATCHING IMAGE 2, 3, 4) === */
#ai-dock .ai-panel {
  width: 400px;
  max-width: calc(100vw - 20px);
  height: 540px;
  background: linear-gradient(165deg, #0b0f19 0%, #111827 55%, #0f172a 100%) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  border-radius: 22px !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.06) !important;
}
#ai-dock .ai-panel.expanded {
  width: min(620px, calc(100vw - 20px));
  height: min(680px, calc(100vh - 90px));
}
#ai-dock .ai-panel-header {
  background: rgba(15, 23, 42, 0.85) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 0.65rem 0.85rem !important;
}
#ai-dock .ai-messages {
  background: transparent !important;
  padding: 0.85rem !important;
  gap: 0.7rem !important;
}
#ai-dock .ai-msg.bot {
  background: rgba(30, 41, 59, 0.88) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  border-radius: 16px 16px 16px 4px !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}
#ai-dock .ai-msg.user {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  color: #ffffff !important;
  border-radius: 16px 16px 4px 16px !important;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}
#ai-dock .v19-ai-quick-strip {
  background: rgba(15, 23, 42, 0.6) !important;
  padding: 0.4rem 0.7rem !important;
  border-top: 1px solid rgba(255,255,255,0.06);
}
#ai-dock .v19-ai-chip {
  background: rgba(30, 41, 59, 0.9) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
}
#ai-dock .v19-ai-chip:hover {
  background: rgba(99, 102, 241, 0.28) !important;
  border-color: #818cf8 !important;
  color: #fff !important;
}
#ai-dock .v18-ai-composer-wrap {
  background: rgba(11, 15, 25, 0.95) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 0.55rem 0.75rem 0.7rem !important;
}
.v22-ai-mode-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}
.v22-mode-pill-group {
  display: inline-flex;
  background: rgba(30, 41, 59, 0.85);
  padding: 0.18rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.v22-mode-pill-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.24rem 0.68rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.v22-mode-pill-btn.active {
  background: #334155;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* 3-Dot Constellation Thinking Animation (Exact match to Image 4) */
.v22-constellation-loader {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.2rem;
}
.v22-tri-dots {
  position: relative;
  width: 22px;
  height: 20px;
  animation: v22TriRotate 2.1s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
.v22-tri-dots span {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e2e8f0;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
  animation: v22DotPulse 1.4s ease-in-out infinite;
}
.v22-tri-dots span:nth-child(1) { top: 1px; left: 2px; animation-delay: 0s; }
.v22-tri-dots span:nth-child(2) { top: 4px; right: 1px; animation-delay: 0.25s; }
.v22-tri-dots span:nth-child(3) { bottom: 1px; left: 7px; animation-delay: 0.5s; }
@keyframes v22TriRotate {
  0% { transform: rotate(0deg) scale(0.95); }
  50% { transform: rotate(180deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(0.95); }
}
@keyframes v22DotPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Dark Glassmorphic Popovers for '+' Tools Menu (Image 3) & Model Picker (Image 2) */
.v22-dark-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  background: #18181b;
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 0.45rem;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.65);
  z-index: 60;
  animation: v15FadeSlide 0.16s ease-out;
}
.v22-plus-menu {
  left: 0.65rem;
  width: min(355px, calc(100vw - 36px));
  max-height: 375px;
  overflow-y: auto;
}
.v22-model-menu {
  right: 0.65rem;
  width: 245px;
}
.v22-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: #f4f4f5;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease;
}
.v22-menu-item:hover, .v22-menu-item.active {
  background: rgba(255, 255, 255, 0.1);
}
.v22-menu-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}
.v22-menu-sub {
  font-size: 0.69rem;
  color: #a1a1aa;
  margin-top: 0.12rem;
  line-height: 1.35;
}
.v22-depth-row {
  display: flex;
  gap: 0.22rem;
  padding: 0.35rem 0.3rem 0.2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 0.25rem;
}
.v22-depth-pill {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  color: #d4d4d8;
  border-radius: 8px;
  padding: 0.26rem 0.15rem;
  font-size: 0.66rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: all 0.14s ease;
}
.v22-depth-pill.active {
  background: #4f46e5;
  color: #fff;
  border-color: #818cf8;
}

/* Task Mode Step-by-Step Progress Card inside Chat */
.v22-task-card {
  margin-top: 0.45rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(99, 102, 241, 0.35);
  font-size: 0.76rem;
}
.v22-task-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.18rem 0;
  color: #cbd5e1;
}

/* Home Hero & Bento Card Historical Photo Backdrops */
.v22-hero-banner-card {
  position: relative;
  overflow: hidden;
}
.v22-hero-bg-strip {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 44%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  opacity: 0.16;
  pointer-events: none;
  mask-image: linear-gradient(to left, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 100%);
}
.v22-hero-bg-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.v22-bento-photo-strip {
  height: 76px;
  margin: -1.1rem -1.1rem 0.75rem -1.1rem;
  position: relative;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
  border-bottom: 1px solid var(--border);
}
.v22-bento-photo-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.82) contrast(1.06);
  transition: transform 0.35s ease;
}
.v15-bento-card:hover .v22-bento-photo-strip img {
  transform: scale(1.06);
}

/* 4D / 7D / 8D Hyper-Dimensional Clock Stage */
.v22-hyper-clock-stage {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0.5rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 900px;
  transform-style: preserve-3d;
}
.v22-hyper-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.35), inset 0 0 12px rgba(139, 92, 246, 0.25);
  pointer-events: none;
}
.v22-hyper-ring.r1 { width: 225px; height: 225px; animation: v22Orbit1 10s linear infinite; border-color: #6366f1; }
.v22-hyper-ring.r2 { width: 198px; height: 198px; animation: v22Orbit2 7s linear infinite reverse; border-color: #ec4899; }
.v22-hyper-ring.r3 { width: 172px; height: 172px; animation: v22Orbit3 13s linear infinite; border-color: #14b8a6; }
.v22-hyper-ring.r4 { width: 236px; height: 236px; border-style: dashed; animation: v22Orbit4 16s linear infinite; border-color: #f59e0b; }
@keyframes v22Orbit1 { 0% { transform: rotateX(62deg) rotateY(15deg) rotateZ(0deg); } 100% { transform: rotateX(62deg) rotateY(15deg) rotateZ(360deg); } }
@keyframes v22Orbit2 { 0% { transform: rotateX(-55deg) rotateY(45deg) rotateZ(0deg); } 100% { transform: rotateX(-55deg) rotateY(45deg) rotateZ(360deg); } }
@keyframes v22Orbit3 { 0% { transform: rotateX(30deg) rotateY(-65deg) rotateZ(0deg); } 100% { transform: rotateX(30deg) rotateY(-65deg) rotateZ(360deg); } }
@keyframes v22Orbit4 { 0% { transform: rotateZ(0deg) scale(0.98); } 50% { transform: rotateZ(180deg) scale(1.03); } 100% { transform: rotateZ(360deg) scale(0.98); } }


/* === V23: ULTRA-SLEEK COMPACT AI STUDIO DOCK === */
#ai-dock .ai-panel {
  width: 356px !important;
  height: 456px !important;
  border-radius: 20px !important;
}
#ai-dock .ai-panel.expanded {
  width: min(560px, calc(100vw - 20px)) !important;
  height: min(640px, calc(100vh - 88px)) !important;
}
#ai-dock .ai-panel-header {
  padding: 0.45rem 0.68rem !important;
  min-height: 42px;
}
#ai-dock .ai-messages {
  padding: 0.65rem 0.72rem !important;
  gap: 0.5rem !important;
}
#ai-dock .ai-msg {
  padding: 0.48rem 0.68rem !important;
  font-size: 0.8rem !important;
  line-height: 1.46 !important;
  border-radius: 14px !important;
}
#ai-dock .v18-ai-composer-wrap {
  padding: 0.38rem 0.55rem 0.48rem !important;
  background: rgba(11, 15, 25, 0.98) !important;
}
#ai-dock .v18-ai-pill {
  padding: 0.22rem 0.28rem 0.22rem 0.36rem !important;
  gap: 0.25rem !important;
}
#ai-dock .v18-ai-plus-btn {
  width: 28px !important;
  height: 28px !important;
  font-size: 1.15rem !important;
}
#ai-dock .v18-ai-input {
  font-size: 0.8rem !important;
  padding: 0.2rem 0.22rem !important;
}
#ai-dock .v18-ai-model-select {
  padding: 0.2rem 0.45rem !important;
  font-size: 0.69rem !important;
}
#ai-dock .v18-ai-mic-btn,
#ai-dock .v18-ai-send-btn {
  width: 28px !important;
  height: 28px !important;
  font-size: 0.82rem !important;
}
.v23-plus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.28rem;
}
.v23-plus-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #f4f4f5;
  padding: 0.38rem 0.5rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-align: left;
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 700;
  transition: all 0.14s ease;
}
.v23-plus-item:hover, .v23-plus-item.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: #818cf8;
  color: #fff;
}


/* === V24: EYE-PLEASING GEMINI STUDIO UI, INLINE AI IMAGES & APPROVAL SWITCH === */
.v24-gemini-sparkle {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.74rem;
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.45);
}
.v24-ai-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.14s ease;
}
.v24-ai-icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}
.v24-ai-img-card {
  margin-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.v24-ai-img-card img {
  width: 100%;
  max-height: 210px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: zoom-in;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.v24-ai-img-card img:hover {
  transform: scale(1.015);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}
.v24-approval-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.28rem 0.68rem;
  border-radius: 999px;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.16s ease;
  border: 1px solid var(--border);
}
.v24-approval-switch.on {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.4);
}
[data-theme="dark"] .v24-approval-switch.on {
  color: #4ade80;
}
.v24-approval-switch.off {
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
  border-color: rgba(234, 88, 12, 0.4);
}
[data-theme="dark"] .v24-approval-switch.off {
  color: #fb923c;
}
.v24-switch-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}


/* === V25: COMPACT AUDIO PILL (IMAGE 1) & GEMINI TASK DEEP TRACE (IMAGE 2) === */
.v25-audio-pill-dock {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  height: 44px;
  border-radius: 999px;
  background: rgba(38, 22, 18, 0.78);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
  padding: 0 6px;
  transition: all 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  max-width: 44px;
}
.v25-audio-pill-dock:hover,
.v25-audio-pill-dock.expanded {
  max-width: 240px;
  padding: 0 12px 0 8px;
}
.v25-speaker-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.v25-slider-drawer {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 0;
  opacity: 0;
  pointer-events: none;
  transition: width 0.24s ease, opacity 0.2s ease, margin-left 0.24s ease;
  margin-left: 0;
}
.v25-audio-pill-dock:hover .v25-slider-drawer,
.v25-audio-pill-dock.expanded .v25-slider-drawer {
  width: 162px;
  opacity: 1;
  pointer-events: auto;
  margin-left: 8px;
}
.v25-pill-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 126px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  outline: none;
  cursor: pointer;
}
.v25-pill-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
.v25-pill-close {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 0.68rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.v25-pill-close:hover {
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
}

/* Gemini Task Trace (Exact Image 2 Aesthetic) */
.v25-task-trace {
  margin: 0.38rem 0 0.45rem;
  padding: 0.42rem 0.6rem;
  border-radius: 10px;
  background: rgba(15, 17, 23, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #9ca3af;
  font-size: 0.72rem;
}
.v25-task-trace-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  cursor: pointer;
  color: #d1d5db;
  font-weight: 600;
  user-select: none;
}
.v25-task-trace-summary::-webkit-details-marker {
  display: none;
}
.v25-trace-chevron {
  font-size: 0.82rem;
  color: #9ca3af;
  transition: transform 0.18s ease;
}
.v25-task-trace[open] .v25-trace-chevron {
  transform: rotate(180deg);
}
.v25-task-trace-list {
  margin-top: 0.42rem;
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
  padding-left: 0.15rem;
}
.v25-task-trace-item {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  color: #9ca3af;
  line-height: 1.4;
}
.v25-wrench-ico {
  font-size: 0.68rem;
  opacity: 0.78;
  flex-shrink: 0;
  margin-top: 1px;
}
