/* =============================================================
   phongcach.css — 5 GIAO DIỆN BẢN SẮC TÂY BẮC GẦN GŨI TRẺ EM
   + THANH CHỌN STYLE + CÔNG TẮC HỌC SINH / THẦY CÔ + PHÒNG AI NHÍ
   Nạp sau chuyende.css. Không phông ngoài, không ảnh ngoài (100% offline).
   Mọi bảng màu đảm bảo tương phản WCAG AA (>= 4.5:1), không sọc chéo nền.
   ============================================================= */

/* ---------------- thanh tiện ích đầu trang (Style + Học sinh / Thầy cô) ---------------- */

.topbar-tools {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 228, 160, .28);
}

.style-bar,
.role-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.style-bar-label {
  font-size: .82rem;
  font-weight: 700;
  color: #ffe3a8;
  margin-right: 4px;
}

.style-btn {
  appearance: none;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  color: #f8f2e4;
  background: rgba(255, 255, 255, .09);
  border: 1.5px solid rgba(255, 240, 200, .28);
  border-radius: 999px;
  padding: 5px 11px;
  min-height: 36px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}

.style-btn:hover {
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 220, 130, .75);
  color: #fff;
}

.style-btn.is-active {
  background: #fffdf7;
  color: var(--tb-cham);
  border-color: var(--tb-nghe);
  box-shadow: 0 2px 0 var(--tb-nghe-dam), 0 4px 12px rgba(0, 0, 0, .22);
}

.style-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: inline-block;
  flex: none;
}

.role-switch {
  background: rgba(0, 0, 0, .24);
  border: 1.5px solid rgba(255, 232, 170, .35);
  border-radius: 999px;
  padding: 3px;
}

.role-btn {
  appearance: none;
  font: inherit;
  font-size: .84rem;
  font-weight: 800;
  color: #f8f2e4;
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 6px 13px;
  min-height: 34px;
  cursor: pointer;
}

.role-btn.is-active {
  background: var(--tb-nghe);
  color: var(--tb-cham);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

/* Ẩn khu dành riêng cho thầy cô khi đang ở chế độ Học sinh (mặc định) */
body:not(.che-do-gv) [data-gv] {
  display: none !important;
}

/* ---------------- dải Góc khác + Khu Thầy cô trên Trang chủ ---------------- */

.nha-goc-khac {
  margin-top: 18px;
}

.nha-goc-luoi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.nha-goc-nut {
  appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  min-height: 60px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--tb-cham);
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, border-color .15s ease;
}

.nha-goc-nut:hover {
  transform: translateY(-2px);
  border-color: var(--tb-cham);
}

.nha-goc-nut.la-ai {
  border-color: #7c3aed;
  background: linear-gradient(135deg, #f5f0ff, #fffdf7);
}

.nha-goc-hinh {
  font-size: 30px;
  line-height: 1;
  flex: none;
}

.nha-goc-chu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nha-goc-chu small {
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.gv-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}

.gv-quick-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--paper);
}

.gv-quick-card strong {
  color: var(--tb-cham);
  font-size: 1rem;
}

.gv-quick-card p {
  margin: 0;
  font-size: .88rem;
  color: var(--ink-soft);
}

/* =============================================================
   STYLE 2: HOA BAN MÙA XUÂN (trẻ thơ, dịu mắt, khăn piêu & hoa ban)
   ============================================================= */

body[data-style="hoaban"] {
  --tb-cham: #3b1046;
  --tb-cham-2: #5c1c6b;
  --tb-cham-3: #14695a;
  --tb-son: #c2185b;
  --tb-son-dam: #880e4f;
  --tb-nghe: #ffd452;
  --tb-nghe-dam: #8c6300;
  --tb-ngoc: #128a74;
  --tb-kem: #fff5f9;
  --tb-giay: #fffdfe;
  --tb-vien: #f0cce0;
  --green-950: #3b1046;
  --green-900: #5c1c6b;
  --green-800: #14695a;
  --green-700: #128a74;
  --green-100: #dcfce7;
  --green-50: #f3fdf6;
  --ink: #2c1236;
  --ink-soft: #593d63;
  --paper: #fffdfe;
  --bg: #fff5fa;
  --line: #ecc8dc;
  --ht-nen: #3b1046;
  --ht-dai: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22160%22 height=%2264%22 viewBox=%220 0 160 64%22%3E%3Crect width=%22160%22 height=%2264%22 fill=%22%233b1046%22/%3E%3Cpath d=%22M0 3h160M0 61h160%22 stroke=%22%23f783ac%22 stroke-width=%223%22/%3E%3Cpath d=%22M0 8h160M0 56h160%22 stroke=%22%23ffd452%22 stroke-width=%221.5%22 stroke-dasharray=%224 4%22/%3E%3Cg transform=%22translate(40 32)%22%3E%3Cellipse cx=%220%22 cy=%22-11%22 rx=%225.5%22 ry=%229%22 fill=%22%23fff0f6%22/%3E%3Cellipse cx=%2210.5%22 cy=%22-3.4%22 rx=%225.5%22 ry=%229%22 transform=%22rotate(72 10.5 -3.4)%22 fill=%22%23ffd6e7%22/%3E%3Cellipse cx=%226.5%22 cy=%229%22 rx=%225.5%22 ry=%229%22 transform=%22rotate(144 6.5 9)%22 fill=%22%23fff0f6%22/%3E%3Cellipse cx=%22-6.5%22 cy=%229%22 rx=%225.5%22 ry=%229%22 transform=%22rotate(216 -6.5 9)%22 fill=%22%23ffd6e7%22/%3E%3Cellipse cx=%22-10.5%22 cy=%22-3.4%22 rx=%225.5%22 ry=%229%22 transform=%22rotate(288 -10.5 -3.4)%22 fill=%22%23fff0f6%22/%3E%3Ccircle r=%224.2%22 fill=%22%23ffd452%22/%3E%3C/g%3E%3Cg transform=%22translate(120 32)%22%3E%3Cpolygon points=%220,-17 17,0 0,17 -17,0%22 fill=%22%23f783ac%22/%3E%3Cpolygon points=%220,-11 11,0 0,11 -11,0%22 fill=%22%233b1046%22/%3E%3Cpolygon points=%220,-6 6,0 0,6 -6,0%22 fill=%22%2369db7c%22/%3E%3C/g%3E%3Cpolygon points=%220,24 8,32 0,40 -8,32%22 fill=%22%23ffd452%22/%3E%3Cpolygon points=%2280,24 88,32 80,40 72,32%22 fill=%22%23ffd452%22/%3E%3Cpolygon points=%22160,24 168,32 160,40 152,32%22 fill=%22%23ffd452%22/%3E%3C/svg%3E");
  background:
    radial-gradient(ellipse 840px 660px at 96% 180px, #ffd6e8, transparent 84%),
    radial-gradient(ellipse 760px 800px at -4% 720px, #d3f9d8, transparent 85%),
    var(--bg);
}

body[data-style="hoaban"] .app-header {
  border-image: linear-gradient(90deg, #ff85b3 0 25%, #ffd452 25% 50%, #69db7c 50% 75%, #da77f2 75%) 1;
  background-color: #3b1046;
  background-image:
    radial-gradient(ellipse 680px 320px at 92% -30%, rgba(105, 219, 124, .32), transparent 72%),
    radial-gradient(ellipse 500px 300px at 6% 120%, rgba(255, 133, 179, .34), transparent 72%),
    linear-gradient(115deg, #3b1046 0%, #6a1f6d 50%, #156656 100%);
}

body[data-style="hoaban"] .view:not(#view-infographic),
body[data-style="hoaban"] #info-editor,
body[data-style="hoaban"] .panel,
body[data-style="hoaban"] .nha-cd {
  border-radius: 28px;
}

body[data-style="hoaban"] .view:not(#view-infographic),
body[data-style="hoaban"] #info-editor {
  border-color: #ecc8dc;
  background-image: repeating-linear-gradient(90deg, #e64980 0 20px, #ffd452 20px 40px, #40c057 40px 60px, #9c36b5 60px 80px);
}

/* =============================================================
   STYLE 3: THỔ CẨM MÔNG HOA (rực rỡ sắc chàm, hồng sen, vàng tươi)
   ============================================================= */

body[data-style="monghoa"] {
  --tb-cham: #162659;
  --tb-cham-2: #243b82;
  --tb-cham-3: #0b667a;
  --tb-son: #d81b60;
  --tb-son-dam: #960f42;
  --tb-nghe: #fcc419;
  --tb-nghe-dam: #8f6400;
  --tb-ngoc: #0ca678;
  --tb-kem: #f4f8ff;
  --tb-giay: #ffffff;
  --tb-vien: #c8d6f5;
  --green-950: #162659;
  --green-900: #243b82;
  --green-800: #0b667a;
  --green-700: #0ca678;
  --ink: #132047;
  --ink-soft: #3d4d73;
  --paper: #ffffff;
  --bg: #f3f7ff;
  --line: #c8d6f5;
  --ht-nen: #1c2a5e;
  --ht-dai: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2248%22 height=%2224%22 viewBox=%220 0 48 24%22%3E%3Crect width=%2248%22 height=%2224%22 fill=%22%231c2a5e%22/%3E%3Crect width=%2248%22 height=%222%22 fill=%22%23e03131%22/%3E%3Crect y=%222%22 width=%2248%22 height=%221%22 fill=%22%23fcc419%22/%3E%3Crect y=%2222%22 width=%2248%22 height=%222%22 fill=%22%23e03131%22/%3E%3Crect y=%2221%22 width=%2248%22 height=%221%22 fill=%22%23fcc419%22/%3E%3Cpath d=%22M11 12h3v-3h-6v6h9v-9h-12%22 fill=%22none%22 stroke=%22%23f783ac%22 stroke-width=%221.7%22 stroke-linecap=%22square%22/%3E%3Cpath d=%22M11 12h3v-3h-6v6h9v-9h-12%22 fill=%22none%22 stroke=%22%23fcc419%22 stroke-width=%221.7%22 stroke-linecap=%22square%22 transform=%22translate(48,24) scale(-1,-1)%22/%3E%3Cpath d=%22M21 12h6M24 9v6%22 stroke=%22%23e03131%22 stroke-width=%222%22/%3E%3Crect x=%2223.2%22 y=%2211.2%22 width=%221.6%22 height=%221.6%22 fill=%22%23ffffff%22/%3E%3Cpolygon points=%220,9.4 2.6,12 0,14.6 -2.6,12%22 fill=%22%23ffffff%22/%3E%3Cpolygon points=%2248,9.4 50.6,12 48,14.6 45.4,12%22 fill=%22%23ffffff%22/%3E%3C/svg%3E");
  background:
    radial-gradient(ellipse 840px 680px at 100% 200px, #d0e2ff, transparent 84%),
    radial-gradient(ellipse 760px 800px at 0% 760px, #ffd6e7, transparent 86%),
    var(--bg);
}

body[data-style="monghoa"] .app-header {
  border-image: linear-gradient(90deg, #e03131 0 20%, #f783ac 20% 40%, #fcc419 40% 60%, #20c997 60% 80%, #4dabf7 80%) 1;
  background-color: #162659;
  background-image:
    radial-gradient(ellipse 680px 320px at 90% -30%, rgba(247, 131, 172, .35), transparent 72%),
    radial-gradient(ellipse 500px 320px at 8% 120%, rgba(252, 196, 25, .28), transparent 70%),
    linear-gradient(112deg, #121f4a 0%, #243b82 52%, #7d154c 100%);
}

body[data-style="monghoa"] .view:not(#view-infographic),
body[data-style="monghoa"] #info-editor {
  border-color: #c8d6f5;
  background-image: repeating-linear-gradient(90deg, #e03131 0 18px, #f783ac 18px 36px, #fcc419 36px 54px, #1c2a5e 54px 72px);
}

/* =============================================================
   STYLE 4: MÙA LÚA CHÍN (ruộng bậc thang vàng mật ong & xanh rừng)
   ============================================================= */

body[data-style="luachin"] {
  --tb-cham: #153d29;
  --tb-cham-2: #1f5c3a;
  --tb-cham-3: #8c5a00;
  --tb-son: #b84a00;
  --tb-son-dam: #7d3100;
  --tb-nghe: #ffd13b;
  --tb-nghe-dam: #855e00;
  --tb-ngoc: #2b8a3e;
  --tb-kem: #fdf8e8;
  --tb-giay: #fffef8;
  --tb-vien: #e4d4a1;
  --green-950: #153d29;
  --green-900: #1f5c3a;
  --green-800: #2b6e44;
  --green-700: #2b8a3e;
  --ink: #183324;
  --ink-soft: #435c4d;
  --paper: #fffef8;
  --bg: #fdf8e7;
  --line: #e4d4a1;
  --ht-nen: #15402b;
  --ht-dai: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22180%22 height=%2264%22 viewBox=%220 0 180 64%22%3E%3Crect width=%22180%22 height=%2264%22 fill=%22%2315402b%22/%3E%3Cpath d=%22M0 3h180M0 61h180%22 stroke=%22%23ffd13b%22 stroke-width=%223%22/%3E%3Cpath d=%22M0 44 Q45 24 90 44 T180 44 L180 56 L0 56 Z%22 fill=%22%23e69f00%22/%3E%3Cpath d=%22M0 34 Q45 14 90 34 T180 34%22 fill=%22none%22 stroke=%22%23ffd13b%22 stroke-width=%223%22/%3E%3Cpath d=%22M0 24 Q45 6 90 24 T180 24%22 fill=%22none%22 stroke=%22%2374c69d%22 stroke-width=%222.5%22/%3E%3Cpolygon points=%2245,10 51,16 45,22 39,16%22 fill=%22%23ffd13b%22/%3E%3Cpolygon points=%22135,10 141,16 135,22 129,16%22 fill=%22%23ff922b%22/%3E%3Ccircle cx=%2290%22 cy=%2214%22 r=%224%22 fill=%22%23fff3bf%22/%3E%3C/svg%3E");
  background:
    radial-gradient(ellipse 840px 660px at 96% 180px, #d8f5a2, transparent 84%),
    radial-gradient(ellipse 780px 820px at -4% 740px, #ffe08a, transparent 86%),
    var(--bg);
}

body[data-style="luachin"] .app-header {
  border-image: linear-gradient(90deg, #ffd13b 0 25%, #ff922b 25% 50%, #51cf66 50% 75%, #2b8a3e 75%) 1;
  background-color: #153d29;
  background-image:
    radial-gradient(ellipse 680px 320px at 90% -30%, rgba(255, 209, 59, .34), transparent 72%),
    radial-gradient(ellipse 520px 300px at 6% 120%, rgba(116, 198, 157, .32), transparent 72%),
    linear-gradient(112deg, #113322 0%, #1f5c3a 52%, #704c06 100%);
}

body[data-style="luachin"] .view:not(#view-infographic),
body[data-style="luachin"] #info-editor {
  border-color: #e4d4a1;
  background-image: repeating-linear-gradient(90deg, #2b8a3e 0 22px, #ffd13b 22px 44px, #d97706 44px 66px, #15402b 66px 88px);
}

/* =============================================================
   STYLE 5: SẮC ĐỎ DAO ĐỎ (ấm cúng bếp lửa nhà sàn & thêu chỉ đỏ)
   ============================================================= */

body[data-style="daodo"] {
  --tb-cham: #4a0c16;
  --tb-cham-2: #751525;
  --tb-cham-3: #8c4a00;
  --tb-son: #b71c1c;
  --tb-son-dam: #7f1010;
  --tb-nghe: #ffd15c;
  --tb-nghe-dam: #875c00;
  --tb-ngoc: #0f766e;
  --tb-kem: #fff5ee;
  --tb-giay: #fffdfb;
  --tb-vien: #ecc8bd;
  --green-950: #4a0c16;
  --green-900: #751525;
  --green-800: #8c4a00;
  --green-700: #0f766e;
  --ink: #360c13;
  --ink-soft: #663b42;
  --paper: #fffdfb;
  --bg: #fff5ee;
  --line: #ecc8bd;
  --ht-nen: #161616;
  --ht-dai: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2236%22 height=%2224%22 viewBox=%220 0 36 24%22%3E%3Crect width=%2236%22 height=%2224%22 fill=%22%23161616%22/%3E%3Crect y=%221%22 width=%2236%22 height=%221%22 fill=%22%23ffffff%22/%3E%3Crect y=%2222%22 width=%2236%22 height=%221%22 fill=%22%23ffffff%22/%3E%3Cpath d=%22M11 9.5l7-5 7 5M9 14.5l9-6.5 9 6.5M7 19.5l11-8 11 8%22 fill=%22none%22 stroke=%22%23d92b2b%22 stroke-width=%221.9%22 stroke-linejoin=%22miter%22/%3E%3Cpath d=%22M18 4.5v16.5%22 stroke=%22%23ffffff%22 stroke-width=%221.3%22/%3E%3Cpolygon points=%220,9 3,12 0,15 -3,12%22 fill=%22%23ffffff%22/%3E%3Cpolygon points=%2236,9 39,12 36,15 33,12%22 fill=%22%23ffffff%22/%3E%3Cpolygon points=%220,10.7 1.3,12 0,13.3 -1.3,12%22 fill=%22%23d92b2b%22/%3E%3Cpolygon points=%2236,10.7 37.3,12 36,13.3 34.7,12%22 fill=%22%23d92b2b%22/%3E%3Cpolygon points=%220,4.2 1.3,5.5 0,6.8 -1.3,5.5%22 fill=%22%23f4b41a%22/%3E%3Cpolygon points=%2236,4.2 37.3,5.5 36,6.8 34.7,5.5%22 fill=%22%23f4b41a%22/%3E%3Cpolygon points=%220,17.2 1.3,18.5 0,19.8 -1.3,18.5%22 fill=%22%23f4b41a%22/%3E%3Cpolygon points=%2236,17.2 37.3,18.5 36,19.8 34.7,18.5%22 fill=%22%23f4b41a%22/%3E%3C/svg%3E");
  background:
    radial-gradient(ellipse 840px 660px at 96% 200px, #ffd8c2, transparent 84%),
    radial-gradient(ellipse 760px 800px at -4% 760px, #ffe6a8, transparent 86%),
    var(--bg);
}

body[data-style="daodo"] .app-header {
  border-image: linear-gradient(90deg, #d92b2b 0 30%, #ffd15c 30% 60%, #ffffff 60% 80%, #d92b2b 80%) 1;
  background-color: #4a0c16;
  background-image:
    radial-gradient(ellipse 680px 320px at 92% -30%, rgba(255, 209, 92, .32), transparent 72%),
    radial-gradient(ellipse 520px 300px at 6% 120%, rgba(217, 43, 43, .38), transparent 72%),
    linear-gradient(112deg, #3b0810 0%, #7d1526 52%, #4a1c12 100%);
}

body[data-style="daodo"] .view:not(#view-infographic),
body[data-style="daodo"] #info-editor {
  border-color: #ecc8bd;
  background-image: repeating-linear-gradient(90deg, #b71c1c 0 20px, #ffd15c 20px 40px, #1f1f1f 40px 60px, #fff5ee 60px 80px);
}

/* =============================================================
   PHÒNG THÍ NGHIỆM AI NHÍ (#view-ainhi)
   ============================================================= */

.ai-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.ai-tab {
  appearance: none;
  font: inherit;
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
  padding: 12px 10px;
  min-height: 60px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--tb-cham);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.ai-tab span { font-size: 26px; line-height: 1; }
.ai-tab:hover { border-color: var(--tb-cham); }
.ai-tab.is-active {
  background: var(--tb-cham);
  border-color: var(--tb-cham);
  color: #fffdf7;
  box-shadow: 0 4px 0 var(--tb-nghe);
}

.ai-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.ai-baskets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.ai-basket {
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fffdf7;
}

.ai-basket h4 {
  margin: 0 0 8px;
  color: var(--tb-cham);
  font-size: 1rem;
}

.ai-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-item-btn {
  appearance: none;
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  padding: 7px 11px;
  min-height: 40px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.ai-item-btn.is-picked {
  background: #dcfce7;
  border-color: #15803d;
  color: #14532d;
}

.ai-bar-row {
  margin: 8px 0;
}

.ai-bar-head {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 4px;
}

.ai-bar-track {
  height: 14px;
  border-radius: 999px;
  background: #ece7d8;
  overflow: hidden;
}

.ai-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--tb-ngoc), var(--tb-cham));
  border-radius: 999px;
  transition: width .25s ease;
}

.ai-chat-box {
  max-height: 300px;
  overflow-y: auto;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fffef9;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.ai-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: .95rem;
  line-height: 1.45;
}

.ai-msg.bot {
  align-self: flex-start;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #102a43;
}

.ai-msg.user {
  align-self: flex-end;
  background: var(--tb-cham);
  color: #fffdf7;
}

.ai-msg small {
  display: block;
  margin-top: 4px;
  font-size: .78rem;
  opacity: .85;
}

.ai-prompt-blocks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.ai-prompt-group {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--paper);
}

.ai-prompt-group label {
  display: block;
  font-weight: 800;
  font-size: .88rem;
  color: var(--tb-cham);
  margin-bottom: 6px;
}

.ai-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.ai-box-bad {
  border: 2px solid #f59e0b;
  background: #fffbeb;
  border-radius: 16px;
  padding: 14px;
}

.ai-box-good {
  border: 2px solid #15803d;
  background: #f0fdf4;
  border-radius: 16px;
  padding: 14px;
}

.ai-badge-card {
  margin-top: 14px;
  padding: 18px;
  border-radius: 20px;
  border: 3px solid var(--tb-nghe);
  background: linear-gradient(135deg, #fffdf0, #f0fdf4);
  text-align: center;
}

/* Ghi âm + nhạc nền trong Kể chuyện */
.story-extra-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--paper);
}

.story-extra-bar select {
  min-height: 40px;
  padding: 4px 10px;
  font-size: .9rem;
}

/* =============================================================
   GÓC SÁNG TẠO: VẼ TRANH & TÔ MÀU (#view-sangtao)
   ============================================================= */

.ve-tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 12px;
}

.ve-tpl-card {
  appearance: none;
  font: inherit;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--tb-cham);
  transition: transform .15s ease, border-color .15s ease;
}

.ve-tpl-card:hover {
  transform: translateY(-2px);
  border-color: var(--tb-cham);
  box-shadow: var(--shadow-sm);
}

.ve-tpl-card.la-trang {
  border-style: dashed;
  border-color: var(--tb-son);
  background: #fffdf5;
}

.ve-tpl-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ve-tpl-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ve-tpl-thumb.la-trang-icon {
  font-size: 46px;
}

.ve-tpl-card b { font-size: .92rem; line-height: 1.3; }
.ve-tpl-card small { font-size: .76rem; color: var(--ink-soft); }

.ve-work {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ve-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fffdf8;
}

.ve-tool-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ve-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.ve-swatch {
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2.5px solid #cbd5e1;
  cursor: pointer;
  transition: transform .12s ease;
}

.ve-swatch:hover { transform: scale(1.1); }
.ve-swatch.is-active {
  border-color: var(--tb-cham);
  outline: 3px solid var(--tb-nghe);
  outline-offset: 2px;
  transform: scale(1.12);
}

.ve-stage-wrap {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  border: 3px solid var(--tb-cham);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow);
  touch-action: none;
}

.ve-stage-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.ve-gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.ve-gal-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--paper);
}

.ve-gal-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  border: 1.5px solid var(--line);
}

.ve-gal-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ve-gal-info b { color: var(--tb-cham); font-size: .95rem; }
.ve-gal-info small { color: var(--ink-soft); font-size: .78rem; }

.ve-gal-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 820px) {
  .ai-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-grid-2, .ai-baskets, .ai-prompt-blocks, .ai-compare { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar-tools { gap: 8px; }
  .style-btn { padding: 4px 9px; font-size: .76rem; min-height: 34px; }
  .role-btn { padding: 5px 10px; font-size: .78rem; }
}

@media print {
  .topbar-tools { display: none !important; }
}
