/* H2edu Design System — Studio & Gallery Lux
   Inspired by Museum Gallery Lighting, Artsonia Keepsake Previews, and Tactile Studio Materials.
   Zero AI Slop, Pure Hand-crafted CSS Tokens & Interactions. */

:root {
  /* Surface & Canvas Palette (WCAG AA/AAA verified via design_tokens.py) */
  --paper: #FAF8F5;
  --paper-2: #F2ECE4;
  --paper-card: #FFFFFF;
  --card: #FFFFFF;
  
  /* Text & Ink Typography */
  --ink: #1C1715;
  --ink-2: #5E524A;
  --ink-3: #6E6259; /* >= 5.1:1 on every paper tone */
  
  /* Primary & Accents (>= 4.9:1 on paper & >= 5.8:1 with #FFFFFF) */
  --crayon: #B53116;
  --crayon-hover: #94240D;
  --crayon-light: #FDF1EE;
  --sun: #F5A623;
  --sun-light: #FEF7E8;
  --leaf: #186E3F;
  --leaf-light: #EDF7F1;
  --sky: #165CC8;
  --sky-light: #EFF6FF;
  --gold: #875C00;
  
  /* Gallery Elements */
  --wire: #DDD5C9;
  --line: #E4DDD0;
  --line-light: #EFE9DF;
  
  /* Layered Shadows */
  --shadow-sm: 0 1px 3px rgba(28, 23, 21, 0.05);
  --shadow: 0 4px 14px rgba(28, 23, 21, 0.06), 0 1px 3px rgba(28, 23, 21, 0.04);
  --shadow-lg: 0 12px 32px rgba(28, 23, 21, 0.09), 0 2px 6px rgba(28, 23, 21, 0.04);
  --shadow-art: 0 12px 28px -6px rgba(28, 23, 21, 0.14), 0 4px 10px rgba(28, 23, 21, 0.06);
  --shadow-art-hover: 0 22px 42px -8px rgba(28, 23, 21, 0.20), 0 8px 18px rgba(28, 23, 21, 0.08);
  
  /* Geometry & Typography */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-full: 9999px;
  --display: "Baloo 2", "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
  --body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.6 var(--body);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--sky); transition: color 0.15s ease; }
a:hover { color: var(--crayon); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--crayon); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- top bar (Floating Pill on Desktop, Sticky Bar on Mobile) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 245, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
@media (min-width: 860px) {
  .topbar {
    top: 10px;
    max-width: 1180px;
    margin: 10px auto 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    background: rgba(255, 253, 249, 0.92);
    box-shadow: 0 10px 28px -10px rgba(28, 23, 21, 0.10), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  }
}
.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
  transition: transform 0.15s ease;
}
.brand:hover { transform: scale(1.02); }
.brand-mark {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--crayon);
  display: grid;
  place-items: center;
  color: #fff;
  font: 800 18px/1 var(--display);
  box-shadow: 0 3px 0 #7E1F0B, 0 4px 10px rgba(181, 49, 22, 0.28);
  transform: rotate(-3deg);
  transition: transform 0.2s ease;
}
.brand-mark svg { width: 18px; height: 18px; display: block; }
.brand:hover .brand-mark { transform: rotate(0deg) scale(1.05); }
.brand-name {
  font: 800 16.5px/1.2 var(--display);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav a {
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: all 0.18s ease;
}
.nav a:hover {
  background: var(--paper-2);
  color: var(--ink);
}
.nav a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 2px 6px rgba(28, 23, 21, 0.2);
}

/* ---------- hero ---------- */
.hero {
  padding: 40px 0 16px;
}
.hero h1 {
  font: 800 clamp(30px, 5.5vw, 48px)/1.15 var(--display);
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero h1 em {
  font-style: normal;
  color: var(--crayon);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 14' preserveAspectRatio='none'%3E%3Cpath d='M3 10.5C58 3.2 154 2.4 237 9.2' stroke='%23F5A623' stroke-width='5' stroke-linecap='round' fill='none' opacity='.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 10px;
  padding-bottom: 2px;
}
.hero p {
  margin: 0;
  color: var(--ink-2);
  max-width: 64ch;
  font-size: 16px;
  line-height: 1.65;
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 24px;
}
.stat {
  background: #FFFFFF;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 var(--line), var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--line), var(--shadow);
}
.stat b {
  font: 800 26px/1.15 var(--display);
  color: var(--ink);
  display: block;
}
.stat span {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
}

/* ---------- filters ---------- */
.filters {
  position: sticky;
  top: 62px;
  z-index: 30;
  background: rgba(250, 248, 245, 0.96);
  backdrop-filter: blur(8px);
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--line-light);
}
@media (min-width: 860px) {
  .filters { top: 74px; }
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 0 var(--line);
}
.chip:hover {
  background: #fff;
  border-color: var(--ink-3);
  transform: translateY(-1px);
}
.chip small {
  color: var(--ink-2);
  font-weight: 500;
  margin-left: 4px;
}
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 2px 0 #000;
}
.chip[aria-pressed="true"] small { color: #E8E1D5; }
.select {
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 600;
}

/* ---------- the wall (Artkive Museum Matboard Gallery Wall) ---------- */
.wall {
  --cell: 28px;
  background-color: #F5EFE6;
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.88) 0%, transparent 75%),
    radial-gradient(circle, #D8CFBE 1.1px, transparent 1.1px);
  background-size: 100% 100%, var(--cell) var(--cell);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  padding: 34px 18px 42px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 38px 22px;
  margin-bottom: 48px;
  box-shadow: inset 0 3px 12px rgba(43, 35, 32, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
}
@media (min-width: 720px) {
  .wall {
    grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
    padding: 46px 36px 54px;
    gap: 46px 32px;
  }
}
.art {
  position: relative;
  background: #FFFDF9;
  padding: 14px 14px 16px;
  border-radius: 12px;
  border: 1.5px solid #DDD4C5;
  box-shadow: var(--shadow-art), inset 0 0 0 4px #F5EFE4;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.art:hover {
  transform: rotate(0deg) translateY(-7px) scale(1.02);
  box-shadow: var(--shadow-art-hover), inset 0 0 0 4px #F5EFE4;
  z-index: 10;
}
/* Refined Gallery Brass Hanger */
.art::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 34px;
  height: 18px;
  margin-left: -17px;
  background: #C59B27;
  border-radius: 4px 4px 5px 5px;
  box-shadow: 0 3px 8px rgba(135, 92, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  z-index: 2;
}
.art::after {
  content: "";
  position: absolute;
  top: -22px;
  left: 50%;
  width: 24px;
  height: 14px;
  margin-left: -12px;
  border: 2px solid #D9B44A;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
  z-index: 1;
}
.art .ph {
  aspect-ratio: 3 / 4;
  background: var(--paper-2);
  border-radius: 6px;
  border: 1px solid #DFD6C7;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(28, 23, 21, 0.08);
}
.art .ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.art:hover .ph img {
  transform: scale(1.035);
}
.art .meta {
  margin-top: 12px;
  padding: 10px 2px 0;
  border-top: 1px dashed var(--line);
}
.art .t {
  font: 800 15.5px/1.35 var(--display);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}
.art .s {
  font-size: 13px;
  color: var(--ink-2);
  margin: 3px 0 0;
  font-weight: 500;
}
.art .likes {
  position: absolute;
  right: 20px;
  bottom: 72px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--crayon);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(220, 210, 195, 0.8);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.art:hover .likes {
  transform: scale(1.06);
}
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--ink-2);
  grid-column: 1 / -1;
}
.empty b {
  display: block;
  font: 700 18px/1.35 var(--display);
  color: var(--ink);
  margin-bottom: 6px;
}

/* ---------- buttons (Tactile 3D Studio Pill — ClassDojo / Duolingo ABC style) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 14px;
  border: 0;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn svg {
  flex: none;
  display: block;
}
.btn:active {
  transform: translateY(2px);
}
.btn-primary {
  background: var(--crayon);
  color: #fff;
  box-shadow: 0 4px 0 #7E1F0B, 0 8px 18px rgba(181, 49, 22, 0.24);
}
.btn-primary:hover {
  background: var(--crayon-hover);
  color: #fff;
  box-shadow: 0 5px 0 #681808, 0 12px 22px rgba(181, 49, 22, 0.32);
  transform: translateY(-1px);
}
.btn-primary:active {
  box-shadow: 0 2px 0 #7E1F0B;
}
.btn-sky {
  background: var(--sky);
  color: #fff;
  box-shadow: 0 4px 0 #0F4090, 0 8px 18px rgba(22, 92, 200, 0.22);
}
.btn-sky:hover {
  background: #124DA8;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #0C3578, 0 12px 22px rgba(22, 92, 200, 0.3);
}
.btn-sky:active {
  box-shadow: 0 2px 0 #0F4090;
}
.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
}
.btn-ghost:hover {
  background: var(--paper-2);
  border-color: var(--ink-3);
  color: var(--ink);
  transform: translateY(-1px);
}
.btn-ghost:active {
  box-shadow: 0 1px 0 var(--line);
}
.btn-dark {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 4px 0 #000000;
}
.btn-dark:hover {
  background: #2E2724;
  color: #fff;
  transform: translateY(-1px);
}
.btn-sm {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 10px;
}
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row .btn { flex: 1 1 160px; }

/* ---------- sheet (bottom sheet on phones, dialog on desktop) ---------- */
.sheet-bg {
  position: fixed;
  inset: 0;
  background: rgba(28, 22, 20, 0.65);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  background: var(--paper);
  width: 100%;
  max-width: 760px;
  max-height: 94vh;
  overflow: auto;
  border-radius: 24px 24px 0 0;
  padding: 22px 20px 28px;
  animation: up 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
}
@media (min-width: 760px) {
  .sheet-bg { align-items: center; }
  .sheet { border-radius: 24px; padding: 28px; }
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .sheet { animation: none; }
  .art, .art:hover { transition: none; }
}
.sheet-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.sheet-head h2 { font: 800 22px/1.25 var(--display); margin: 0; flex: 1; color: var(--ink); }
.x {
  border: 0;
  background: var(--paper-2);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  font-size: 20px;
  cursor: pointer;
  flex: none;
  transition: background 0.15s ease;
}
.x:hover { background: #E4DCCF; }
.viewer img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  background: #FFFDF9;
  padding: 12px;
  border: 1.5px solid #DED5C7;
  border-radius: 14px;
  box-shadow: var(--shadow-art), inset 0 0 0 4px #F5EFE4;
}
.viewer .who { margin: 14px 0 4px; font-weight: 700; font-size: 16px; }
.viewer .comment {
  background: #FBF7EE;
  border: 1.5px solid #E6DBC4;
  padding: 14px 16px;
  border-radius: 16px;
  margin: 12px 0 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}
.viewer .comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.viewer .comment-head b {
  font: 800 14px/1.35 var(--display);
  color: var(--gold);
}
.badge {
  display: inline-block;
  background: var(--sun-light);
  color: var(--gold);
  border: 1px solid rgba(245, 166, 35, 0.35);
  border-radius: var(--radius-full);
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 700;
}
.muted { color: var(--ink-2); font-size: 14px; }
/* ---------- certificate modal & tab switch ---------- */
.cert-tab-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--paper-2);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.cert-tab-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.cert-tab-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}
.cert-tab-btn.active, .cert-tab-btn[aria-selected="true"] {
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(28, 23, 21, 0.08);
}
.cert-preview-wrap {
  position: relative;
  text-align: center;
  background: radial-gradient(circle at center, #FDFCFB 0%, #F5EFEB 100%);
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.cert-preview {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 40px -10px rgba(21, 34, 56, 0.2), 0 4px 12px rgba(21, 34, 56, 0.08);
  background: #fff;
  transition: transform 0.25s ease;
}
.cert-preview:hover {
  transform: scale(1.008);
}
/* Teacher-only editor above the preview; parents never get this block. */
.cert-edit {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.cert-edit summary, .form details summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.cert-edit .form { margin-top: 12px; }
.form details { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; }
.cert-loading {
  padding: 40px 20px;
  text-align: center;
  background: var(--paper-2);
  border-radius: 14px;
  margin-bottom: 16px;
}
.hint {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin: 12px 0;
}

/* ---------- keepsake merchandise ---------- */
.products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.product {
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}
.product:hover {
  border-color: var(--ink-3);
  transform: translateY(-2px);
}
.product[aria-pressed="true"] {
  border-color: var(--crayon);
  box-shadow: 0 0 0 3px rgba(217, 69, 40, 0.15), var(--shadow);
}
.product canvas {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--paper-2);
}
.product b {
  display: block;
  font-size: 14.5px;
  margin-top: 8px;
  line-height: 1.3;
  color: var(--ink);
}
.product .price {
  color: var(--crayon);
  font-weight: 800;
  font-size: 15px;
}
.q { font-size: 12px; font-weight: 700; margin-top: 4px; }
.q.ok { color: var(--leaf); }
.q.warn { color: #9A6200; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--ink);
}
.field input, .field select, .field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 11px 14px;
  min-height: 48px;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--crayon);
  box-shadow: 0 0 0 3px rgba(217, 69, 40, 0.12);
  outline: none;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input[type="checkbox"], .field input[type="radio"] { width: auto; min-height: 0; padding: 0; }
.field small { color: var(--ink-2); font-size: 13px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }
.error { color: var(--crayon-hover); font-weight: 600; font-size: 14px; }
.success {
  background: #EDF7F1;
  border: 1px solid #A8D8BA;
  color: #1B5E36;
  border-radius: 14px;
  padding: 16px;
}
.code { font: 800 24px/1.2 var(--display); letter-spacing: 0.03em; color: var(--ink); }
/* Parent consent on sign-up forms (Luật BVDLCN 91/2025): never ticked by default. */
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 12px; font-size: 14px; line-height: 1.55; color: var(--ink-2); cursor: pointer; }
.consent input { width: 22px; height: 22px; min-height: 0; margin: 1px 0 0; flex: none; accent-color: var(--crayon); }
.site-facts { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; color: var(--ink-2); }
/* Opening sites (admin): score bar, sign-up meter. */
.site-card h3 { margin: 0 0 4px; font: 800 19px/1.3 var(--display); }
.site-card .meter { margin: 6px 0 2px; }
.site-card .tag { align-self: flex-start; }
.score-q { margin: 0 0 10px; }
.score-q legend { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.score-q label { display: inline-flex; gap: 6px; align-items: center; margin: 0 14px 4px 0; font-size: 14px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 14px;
  z-index: 90;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  max-width: calc(100% - 36px);
  text-align: center;
}

/* ---------- album header ---------- */
.kid {
  display: flex;
  gap: 20px;
  align-items: center;
  background: #FFFFFF;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 20px -2px rgba(28, 23, 21, 0.06), 0 2px 6px rgba(28, 23, 21, 0.03);
  margin-top: 24px;
  border: 1px solid rgba(220, 210, 195, 0.6);
  position: relative;
  overflow: hidden;
}
.kid::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  bottom: 0;
  background: linear-gradient(180deg, var(--sun) 0%, var(--crayon) 100%);
  border-radius: 4px 0 0 4px;
}
.kid .avatar {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--sun) 0%, #DE8A1D 100%);
  display: grid;
  place-items: center;
  font: 800 30px var(--display);
  color: #fff;
  flex: none;
  transform: rotate(-2deg);
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(245, 166, 35, 0.35);
  border: 2px solid #FFFFFF;
}
.kid .avatar img { width: 100%; height: 100%; object-fit: cover; }
.kid h1 { font: 800 28px/1.15 var(--display); margin: 0 0 4px; color: var(--ink); }
.stars { font-weight: 800; color: #9A6200; font-size: 15.5px; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding: 28px 0 44px;
  color: var(--ink-2);
  font-size: 13.5px;
}
.foot a { color: var(--ink-2); text-decoration: none; display: inline-block; padding: 4px 0; }
.foot a:hover { color: var(--crayon); text-decoration: underline; }

/* ---------- english corner (AI Buddy Speaking Studio) ---------- */
.phrases {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  margin: 20px 0 32px;
}
.phrase {
  background: #FFFFFF;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 4px 16px -2px rgba(28, 23, 21, 0.05), 0 2px 4px rgba(28, 23, 21, 0.02);
  border: 1.5px solid rgba(220, 210, 195, 0.7);
  position: relative;
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.phrase:hover {
  border-color: var(--sky);
  box-shadow: 0 12px 28px -4px rgba(37, 99, 235, 0.12), 0 4px 10px rgba(28, 23, 21, 0.04);
  transform: translateY(-3px);
}
.phrase.done {
  border-color: var(--leaf);
  background: linear-gradient(180deg, #FFFFFF 0%, #F4FAF6 100%);
  box-shadow: 0 0 0 2px rgba(42, 138, 85, 0.2), 0 8px 24px -4px rgba(42, 138, 85, 0.12);
}
.phrase .en {
  font: 700 22px/1.25 var(--display);
  margin: 0 0 4px;
  color: var(--ink);
}
.phrase .vi {
  color: var(--ink-2);
  margin: 0 0 14px;
  font-size: 14.5px;
}
.phrase .lvl {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 12px;
  font-weight: 700;
  color: #9A6200;
  background: var(--sun-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.heard {
  margin-top: 12px;
  font-size: 14.5px;
  padding: 8px 12px;
  background: var(--paper-2);
  border-radius: 8px;
}
.score { font: 800 32px/1 var(--display); }
.score.pass { color: var(--leaf); }
.score.fail { color: var(--crayon); }
.board {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1.5px solid var(--line);
}
.board ol { margin: 0; padding-left: 24px; }
.board li { padding: 6px 0; font-weight: 600; }
.two { display: grid; gap: 18px; }
@media (min-width: 820px) { .two { grid-template-columns: 1fr 1fr; } }

/* ---------- admin shell ---------- */
.admin-shell { padding-bottom: 60px; }
.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 22px;
  padding: 14px 0;
  background: var(--paper);
  z-index: 20;
}
.tabgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tabgroup:last-child { margin-left: auto; }
.tabgroup-label {
  width: 100%;
  margin-bottom: 2px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-2);
}
/* Phones: one native picker instead of four rows of tabs. */
.tabselect { display: none; }
@media (max-width: 600px) {
  .tabs { display: none; }
  .tabselect { display: flex; align-items: center; gap: 10px; padding: 12px 0 14px; font-weight: 700; color: var(--ink-2); }
  .tabselect select {
    flex: 1;
    min-height: 44px;
    padding: 10px 12px;
    font: 700 16px/1.2 inherit;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
  }
}
.tab {
  flex: none;
  border: 0;
  background: var(--card);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--line) inset;
  transition: all 0.15s ease;
}
.tab:hover { background: var(--paper-2); }
.tab[aria-selected="true"] {
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}
.tab .dot {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--crayon);
  color: #fff;
  font-size: 12px;
  margin-left: 6px;
}
.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 1px solid var(--line);
}
.panel h2 { font: 800 20px/1.2 var(--display); margin: 0 0 14px; color: var(--ink); }
.panel h3 { font: 700 17px/1.2 var(--display); margin: 18px 0 10px; color: var(--ink); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 20px; }
@media (min-width: 820px) { .kpis { grid-template-columns: repeat(6, 1fr); } }
.kpi {
  background: var(--card);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.kpi b { font: 800 26px/1.1 var(--display); display: block; color: var(--ink); }
.kpi span { font-size: 13px; color: var(--ink-2); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 110px; margin-top: 8px; }
.bars div { flex: 1; background: var(--sky); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars-x { display: flex; gap: 4px; font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.bars-x span { flex: 1; text-align: center; }
.target { display: grid; gap: 10px; }
.meter { height: 10px; background: var(--paper-2); border-radius: var(--radius-full); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--leaf); border-radius: var(--radius-full); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }
.list { display: grid; gap: 12px; }
.row { display: flex; gap: 14px; align-items: flex-start; background: var(--paper); border-radius: 14px; padding: 12px; border: 1px solid var(--line-light); }
.row .thumb { width: 68px; height: 84px; object-fit: cover; border-radius: 8px; flex: none; background: var(--paper-2); }
.row .body { flex: 1; min-width: 0; }
.row .body b { display: block; font-size: 15px; }
.row .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--paper-2);
  color: var(--ink-2);
  margin-right: 4px;
}
.tag.ok { background: #EDF7F1; color: #1B5E36; }
.tag.warn { background: #FEF7E8; color: #925800; }
.tag.off { background: #FDF1EE; color: #9A2410; }
.art-admin { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.art-admin .card { background: var(--paper); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.art-admin img { aspect-ratio: 3/4; object-fit: cover; width: 100%; }
.art-admin .card .body { padding: 10px; font-size: 13.5px; }
.art-admin .card.hidden img { opacity: .4; }
.uploads { display: grid; gap: 12px; }
.up { display: flex; gap: 12px; align-items: center; background: var(--paper); border-radius: 12px; padding: 10px; border: 1px solid var(--line); }
.up img { width: 56px; height: 70px; object-fit: cover; border-radius: 8px; }
.up input { flex: 1; }
.up .st { font-size: 13px; font-weight: 700; min-width: 60px; text-align: right; }
.login { max-width: 400px; margin: 60px auto; }

/* ---------- art-supply shop ---------- */
.shop {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  margin: 16px 0 28px;
}
.supply {
  display: flex;
  gap: 16px;
  background: #FFFFFF;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 4px 16px -2px rgba(28, 23, 21, 0.05), 0 2px 4px rgba(28, 23, 21, 0.02);
  border: 1.5px solid rgba(220, 210, 195, 0.7);
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.supply:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -4px rgba(28, 23, 21, 0.12), 0 4px 10px rgba(28, 23, 21, 0.04);
}
.supply.picked {
  border-color: var(--crayon);
  box-shadow: 0 0 0 2px rgba(181, 49, 22, 0.2), 0 8px 24px -4px rgba(181, 49, 22, 0.15);
}
.supply .pic {
  width: 96px;
  height: 96px;
  flex: none;
  border-radius: 12px;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  font-size: 38px;
  overflow: hidden;
}
.supply .pic img { width: 100%; height: 100%; object-fit: cover; }
.supply .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.supply h2 { font: 700 16.5px/1.35 var(--display); margin: 0 0 4px; color: var(--ink); }
.supply .muted { margin: 0 0 8px; font-size: 13.5px; }
.supply .buy { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.supply .price { color: var(--crayon-hover); font-weight: 800; font-size: 16px; }
.stepper { flex: none; display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--radius-full); overflow: hidden; background: #fff; }
.stepper button { width: 38px; height: 36px; border: 0; background: var(--paper-2); font-size: 18px; font-weight: 700; cursor: pointer; transition: background 0.15s ease; }
.stepper button:hover { background: #E4DCCF; }
.stepper output { min-width: 32px; text-align: center; font-weight: 800; font-size: 15px; }
.cartbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(28, 23, 21, 0.08);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
}
.cartbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cartbar b { font: 800 22px/1.3 var(--display); color: var(--ink); }
@media (max-width: 440px) { .brand-name { display: none; } .nav a { padding: 8px 10px; font-size: 13px; } }
@media (max-width: 819px) { .kpi.wide { grid-column: span 2; } }
@media (min-width: 820px) { .kpis { grid-template-columns: repeat(7, 1fr); } }
.supply.soldout { opacity: .55; filter: grayscale(0.5); }

/* ---------- site pages: home (parents) and /truong-hoc (schools) ---------- */
.home-hero h1 { max-width: 17ch; }
.home-hero p { max-width: 64ch; }
.section-h { font: 800 24px/1.3 var(--display); margin: 36px 0 16px; color: var(--ink); }
.mini-wall { margin-bottom: 12px; }
.mini-wall .art { text-decoration: none; color: inherit; display: block; }
.features {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.feature {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 26px 24px;
  border: 1.5px solid var(--line);
  box-shadow: 0 4px 0 var(--line), var(--shadow);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, border-color 0.22s ease;
  position: relative;
}
.feature:hover {
  transform: translateY(-4px);
  border-color: var(--crayon);
  box-shadow: 0 5px 0 rgba(181, 49, 22, 0.2), var(--shadow-lg);
}
.feature h3 { font: 800 19px/1.3 var(--display); margin: 0 0 10px; color: var(--ink); }
.feature p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.lead {
  margin: 40px 0 52px;
  border: 2px solid var(--crayon);
  background: radial-gradient(circle at 100% 0%, rgba(181, 49, 22, 0.04) 0%, transparent 60%), #FFFDFC;
  border-radius: 24px;
  box-shadow: 0 12px 36px -6px rgba(181, 49, 22, 0.12), 0 4px 12px rgba(28, 23, 21, 0.04);
}
.doc .tbl th[scope="row"] { width: 38%; color: var(--ink); font-size: 14px; font-weight: 700; }
.doc ul { margin: 0; padding-left: 22px; }
.doc li { padding: 4px 0; }
@media print {
  .topbar, .foot, .no-print { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

/* ---------- học vẽ từng bước (/hoc-ve) ---------- */
.ka-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
/* Wrap rather than scroll: a hidden scrollbar left the current page's tab cut off at the edge. */
@media (max-width: 560px) { .topbar .wrap { padding-block: 8px; } .nav { flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font: 800 13px/1.35 var(--display);
  color: var(--crayon-hover); background: var(--crayon-light); padding: 7px 14px; border-radius: var(--radius-full);
}
.learn-hero { display: grid; gap: 32px; align-items: center; padding: 36px 0 20px; }
@media (min-width: 900px) { .learn-hero { grid-template-columns: 1.2fr .8fr; } }
.learn-hero h1 { font: 800 clamp(32px, 5.6vw, 52px)/1.12 var(--display); margin: 0 0 14px; letter-spacing: -0.02em; }
.learn-hero h1 em {
  font-style: normal;
  color: var(--crayon);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 14' preserveAspectRatio='none'%3E%3Cpath d='M3 10.5C58 3.2 154 2.4 237 9.2' stroke='%23F5A623' stroke-width='5' stroke-linecap='round' fill='none' opacity='.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 10px;
  padding-bottom: 2px;
}
.lead-in { color: var(--ink-2); font-size: 16.5px; line-height: 1.65; max-width: 60ch; margin: 0; }
.how { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 600px) { .how { grid-template-columns: repeat(3, 1fr); } }
.how li { position: relative; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 14px 14px 54px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.how b { display: block; font: 800 15.5px/1.35 var(--display); color: var(--ink); margin-bottom: 2px; }
.how .n { position: absolute; left: 14px; top: 14px; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font: 800 15px/1.35 var(--display); color: #fff; background: var(--ink); transform: rotate(-4deg); }
.how li:nth-child(2) .n { background: var(--crayon); }
.how li:nth-child(3) .n { background: var(--leaf); }

.paper {
  position: relative; aspect-ratio: 1; border-radius: 22px; overflow: hidden;
  background: #FFFDF8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .3 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow: var(--shadow-art), inset 0 0 0 1px rgba(28, 23, 21, .05);
}
.paper svg { display: block; width: 100%; height: 100%; }
.paper .fresh { stroke: var(--crayon); }
.paper .pen { transition: opacity .2s ease; }
.hero-demo { width: 100%; max-width: 400px; justify-self: center; transform: rotate(1.5deg); }

.who-card { display: flex; align-items: center; gap: 16px; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 18px; margin: 8px 0 18px; }
.who-card .avatar { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 26px; background: var(--sun-light); flex: none; }
.who-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.who-main b { font: 800 19px/1.35 var(--display); }
.who-main .meter { max-width: 360px; }

.lesson-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin: 18px 0 44px; }
.lesson-card {
  position: relative; display: flex; flex-direction: column; background: #fff; border: 1.5px solid var(--line);
  border-radius: 22px; overflow: hidden; text-decoration: none; color: inherit;
  transition: transform .22s cubic-bezier(.22, 1, .36, 1), box-shadow .22s ease;
}
.lesson-card:hover { transform: translateY(-4px); box-shadow: 0 6px 0 var(--line), var(--shadow-art-hover); color: inherit; }
.lesson-card[hidden] { display: none; }
.lesson-card .thumb { aspect-ratio: 1; padding: 18px; background: #FFFDF8; border-bottom: 1px solid var(--line-light); }
.lesson-card .thumb svg { width: 100%; height: 100%; display: block; }
.lesson-card .body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lesson-card h2 { font: 800 20px/1.25 var(--display); margin: 0; }
.lesson-card p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.lesson-card .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.lesson-card .skills { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.lesson-card .skills .tag { margin: 0; }
.lvl-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.lvl-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.lvl-dots i.on { background: var(--sun); }
.state { position: absolute; z-index: 2; top: 12px; left: 12px; font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: var(--radius-full); background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.state.reviewed, .state.ai { background: var(--leaf-light); color: #1B5E36; }
.state.waiting { background: var(--sun-light); color: #925800; }
.state.rejected { background: var(--crayon-light); color: #9A2410; }
.state.next { background: var(--crayon-hover); color: #fff; }

.results { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-bottom: 40px; }
.result-card { display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: start; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 12px; }
.result-card img { width: 104px; height: 130px; object-fit: cover; border-radius: 12px; background: var(--paper-2); }
.result-card b { display: block; font: 800 16px/1.35 var(--display); }
.result-card .when { font-size: 12.5px; }
.result-card .by { display: block; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--leaf); }
.result-card .fb { margin: 4px 0 6px; font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.result-card .fb.warn { color: #9A2410; }
.drawn { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.drawn ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; padding: 0; }
.drawn li { padding: 3px 10px; border-radius: var(--radius-full); background: var(--leaf-light); color: var(--leaf); font-weight: 600; }
.drawn li::before { content: "✓ "; }
.result-card .say-fb { margin: 0 8px 6px 0; }
.crit { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.crit .bar { height: 6px; margin-top: 3px; background: var(--paper-2); border-radius: var(--radius-full); overflow: hidden; }
.crit .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), var(--leaf)); border-radius: inherit; }
.dots::after { content: "…"; display: inline-block; animation: ka-blink 1.2s steps(3) infinite; width: 1.2em; text-align: left; }
@keyframes ka-blink { 0% { opacity: .2; } 50% { opacity: 1; } 100% { opacity: .2; } }

/* player (Simply Draw Studio Stage) */
.learn { padding-bottom: 56px; }
.crumb { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px 0 14px; font-size: 14px; font-weight: 600; }
.crumb a { color: var(--ink-2); text-decoration: none; }
.crumb a:hover { color: var(--crayon); }
.player { display: grid; gap: 22px; align-items: start; }
@media (min-width: 920px) { .player { grid-template-columns: minmax(0, 1.08fr) minmax(330px, .92fr); } }
.stage { position: relative; }
.step-badge { position: absolute; top: 14px; left: 14px; background: var(--ink); color: #fff; font: 800 14px/1.3 var(--display); padding: 8px 14px; border-radius: var(--radius-full); box-shadow: 0 3px 0 #000; }
.steps-bar { display: flex; gap: 6px; margin-top: 14px; }
.steps-bar button { flex: 1; height: 10px; padding: 0; border: 0; border-radius: var(--radius-full); background: var(--line); cursor: pointer; transition: background .2s ease, transform .2s ease; }
.steps-bar button:hover { transform: scaleY(1.4); }
.steps-bar button.done { background: var(--ink-3); }
.steps-bar button.cur { background: var(--crayon); }
.coach { background: #fff; border: 1.5px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: 0 4px 0 var(--line), var(--shadow); }
@media (min-width: 920px) { .coach { position: sticky; top: 84px; } }
.coach h1 { font: 800 clamp(26px, 3.4vw, 34px)/1.15 var(--display); margin: 2px 0 0; letter-spacing: -0.01em; }
.coach-meta { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.say-box { margin: 18px 0 12px; padding: 18px 18px 20px; background: var(--sun-light); border: 1.5px solid #F3D9A4; border-radius: 18px; }
.say-box .part { font: 800 13px/1.35 var(--display); color: var(--gold); }
.say-box p { margin: 8px 0 0; font: 700 clamp(19px, 2.3vw, 23px)/1.42 var(--display); color: var(--ink); min-height: 3em; }
.tip-line { display: flex; gap: 8px; margin: 0 0 4px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.tip-line[hidden] { display: none; }
.controls { display: grid; grid-template-columns: 52px 1fr 52px; gap: 10px; margin-top: 16px; }
.icon-btn { height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font: 700 24px/1 var(--display); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--line); transition: all .15s ease; }
.icon-btn:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-1px); }
.icon-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.icon-btn:disabled { opacity: .35; cursor: default; box-shadow: none; }
.controls .btn { min-height: 52px; font-size: 16px; }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: #fff; border-radius: var(--radius-full); padding: 8px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--ink-2); box-shadow: 0 2px 0 var(--line); transition: all .15s ease; }
.toggle svg { width: 15px; height: 15px; flex: none; }
.toggle:hover { border-color: var(--ink-3); color: var(--ink); }
.toggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 2px 0 #000; }
.toggle[hidden] { display: none; }
.prep { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; color: var(--ink-2); }
.prep summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.prep h3 { font: 800 15px/1.3 var(--display); margin: 12px 0 4px; color: var(--ink); }
.prep ul { margin: 0; padding-left: 20px; }
.model-mini { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.model-mini .paper { width: 92px; border-radius: 12px; flex: none; }
/* Tờ phác (/hoc-ve/<bài>/to-phac): one A4 page, dotted outline to trace, small coloured model. */
.dsheet-bar { max-width: 794px; margin: 18px auto 0; }
.dsheet { page: dsheet; max-width: 794px; margin: 14px auto 40px; background: #fff; color: #111; padding: 26px 32px; border: 1px solid var(--line); border-radius: 8px; }
.dsheet header { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; border-bottom: 2px solid #111; padding-bottom: 12px; }
.dsheet h1 { font: 800 28px/1.15 var(--display); margin: 0 0 4px; }
.dsheet .name-line { margin: 12px 0 0; font-size: 15px; }
.dsheet .model { margin: 0; width: 120px; text-align: center; font-size: 12.5px; color: #555; }
.dsheet .model .paper { border-radius: 10px; box-shadow: none; border: 1px solid #ddd; margin-bottom: 4px; }
.dsheet .dsheet-how { margin: 12px 0 0; font-size: 15px; max-width: none; }
.dsheet .trace { display: block; width: min(100%, 600px); aspect-ratio: 1; margin: 4px auto; }
.dsheet .create { margin: 0; }
@page dsheet { size: A4; margin: 10mm; }
@media print {
  .dsheet { border: 0; padding: 0; margin: 0 auto; max-width: none; }
  .dsheet .trace { width: 165mm; }
}

.finish { margin-top: 30px; padding: 26px; border-radius: 24px; border: 1.5px solid #F1D8C4; background: radial-gradient(circle at 100% 0%, rgba(245,166,35,.14), transparent 55%), linear-gradient(135deg, #FFF8EC, #FDF1EE); }
.finish[hidden] { display: none; }
.finish h2 { font: 800 clamp(24px, 3.4vw, 30px)/1.25 var(--display); margin: 0 0 12px; }
.finish-grid { display: grid; gap: 18px; }
@media (min-width: 760px) { .finish-grid { grid-template-columns: 1fr auto; align-items: start; } }
.finish-side { display: flex; flex-direction: column; gap: 10px; }
/* Nói tiếng Anh với tranh: cuối mỗi bài vẽ */
.say-en { margin: 0 0 14px; padding: 16px; background: #fff; border: 1.5px solid #CFE0F5; border-radius: 14px; }
.say-en h3 { font: 800 18px/1.3 var(--display); margin: 0 0 8px; }
.say-en p { margin: 0 0 8px; }
.say-en-word { display: flex; align-items: center; gap: 10px; }
.say-en-word b { font: 800 34px/1.1 var(--display); color: #1D4F91; }
.say-en-words { display: flex; flex-wrap: wrap; gap: 8px; }
.say-en-line { font: 800 22px/1.3 var(--display); }
.say-en-result:empty { display: none; }
.say-en-result .hit { color: #1F7A45; font-weight: 700; }
.say-en-result .miss { color: #B3261E; font-weight: 700; text-decoration: underline; }
.create { background: #fff; border: 1.5px dashed #E8B9A6; border-radius: 14px; padding: 14px 16px; margin: 0 0 14px; line-height: 1.55; }
.shoot { cursor: pointer; margin: 8px 0 14px; }
.shot { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 14px; }
.shot img { width: 132px; height: 164px; object-fit: cover; border-radius: 14px; border: 1.5px solid var(--line); }
.shot > div { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i { position: absolute; top: 55%; width: 10px; height: 14px; border-radius: 3px; animation: ka-pop var(--d) cubic-bezier(.22, 1, .36, 1) forwards; }
@keyframes ka-pop { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--x), -60vh) rotate(var(--r)); opacity: 0; } }

/* classroom projector mode */
body.present { background: #FFFDF8; }
body.present .topbar, body.present .foot, body.present .crumb, body.present #history, body.present .finish, body.present .prep { display: none; }
body.present .learn { max-width: none; padding: 18px 26px; }
body.present .player { grid-template-columns: minmax(0, 1fr) minmax(360px, 36vw); gap: 28px; align-items: center; min-height: calc(100vh - 36px); }
body.present .stage .paper { width: min(100%, calc(100vh - 80px)); margin: 0 auto; }
body.present .steps-bar { width: min(100%, calc(100vh - 80px)); margin: 14px auto 0; }
body.present .coach { position: static; box-shadow: none; border: 0; background: transparent; padding: 0; }
body.present .coach h1 { font-size: clamp(30px, 3vw, 46px); }
body.present .say-box p { font-size: clamp(26px, 2.6vw, 42px); }
body.present .step-badge { font-size: 20px; padding: 12px 18px; }

/* admin: lesson submissions */
.sub-row { display: grid; gap: 16px; background: var(--paper); border: 1px solid var(--line-light); border-radius: 16px; padding: 14px; }
@media (min-width: 720px) { .sub-row { grid-template-columns: 180px 1fr; } }
.sub-row .shot-lg { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 12px; background: var(--paper-2); }
.ai-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; margin: 8px 0; }
.kid-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin-top: 12px; }
.kid-shot { display: grid; justify-items: center; gap: 4px; padding: 12px 8px; min-height: 120px; text-align: center; cursor: pointer;
  background: #fff; border: 1.5px dashed var(--wire); border-radius: 16px; }
.kid-shot:hover, .kid-shot:focus-within { border-color: var(--crayon); }
.kid-shot:focus-within { outline: 3px solid var(--crayon); outline-offset: 2px; }
.kid-shot .cam { font-size: 28px; line-height: 1.3; }
.kid-shot img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.kid-shot b { font-size: 14px; line-height: 1.35; }
.kid-shot .muted { font-size: 12px; }
.kid-shot.done { border-style: solid; border-color: var(--leaf); background: var(--leaf-light); }
.kid-shot.busy { opacity: .55; pointer-events: none; }
.ai-box .crit { grid-template-columns: repeat(4, 1fr); }
.sub-row textarea { width: 100%; min-height: 84px; }

/* ---------- child link: nav entry, home section, wall scope note ---------- */
.nav a.nav-kid { color: var(--crayon); box-shadow: inset 0 0 0 1.5px var(--crayon); }
.nav a.nav-kid:hover { background: var(--crayon-light); color: var(--crayon-hover); }
.kid-corner { margin-top: 28px; }
.kid-corner h2 { margin-top: 0; }
.kid-corner p { color: var(--ink-2); max-width: 680px; }
.kid-corner .btn[hidden] { display: none; }
.scope-note {
  background: var(--sun-light);
  border: 1px solid #F3D9A4;
  color: var(--ink-2);
  border-radius: 14px;
  padding: 12px 16px;
  margin: 0 0 14px;
  font-size: 14px;
}
.scope-note a { font-weight: 600; margin-left: 4px; }

/* ---------- curriculum locked for visitors ---------- */
.locked-panel { text-align: center; max-width: 560px; margin: 24px auto; }
.locked-panel .lock { font-size: 40px; line-height: 1.3; margin-bottom: 8px; }
.locked-panel .btn-row { max-width: 460px; margin: 14px auto 0; }
.thumb.locked-thumb { display: grid; place-items: center; font-size: 44px; background: var(--paper-2); color: var(--ink-3); }
.lock-tag { display: inline-block; align-self: flex-start; width: fit-content; font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--paper-2); border-radius: 999px; padding: 2px 10px; margin-top: 8px; }
#acts[hidden], #stage[hidden], .toggles[hidden] { display: none; }

/* ---------- WP2: Square 1 Art Personalized Keepsake Strip (Album & Portfolio) ---------- */
.keepsake-showcase {
  background: linear-gradient(135deg, #FFFDF9 0%, #F7F0E4 100%);
  border: 1.5px solid #DED5C7;
  border-radius: 22px;
  padding: 20px 22px;
  margin: 18px 0 24px;
  box-shadow: 0 4px 0 #DED5C7, var(--shadow);
}
.keepsake-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.keepsake-head h2 {
  font: 800 20px/1.3 var(--display);
  margin: 0;
  color: var(--ink);
}
.keepsake-head p {
  margin: 2px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}
.keepsake-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.keepsake-item {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.18s ease, box-shadow 0.18s ease;
}
.keepsake-item:hover {
  transform: translateY(-3px);
  border-color: var(--crayon);
  box-shadow: 0 5px 0 rgba(181, 49, 22, 0.2), var(--shadow);
}
.keepsake-item canvas {
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: var(--paper-2);
  margin-bottom: 10px;
}
.keepsake-item b {
  font: 800 15px/1.35 var(--display);
  color: var(--ink);
}
.keepsake-item .k-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 13.5px;
}
.keepsake-item .k-price {
  font-weight: 800;
  color: var(--crayon);
}
.keepsake-item .k-cta {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--sky);
}

/* ---------- WP3: Mỹ Thuật Bụi × Young Rembrandts 3-Tier Curriculum Filter ---------- */
.curr-section {
  margin: 28px 0 36px;
}
.curr-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.curr-head h2 {
  font: 800 clamp(22px, 3.6vw, 28px)/1.25 var(--display);
  margin: 0 0 4px;
  color: var(--ink);
}
.curr-head p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14.5px;
  max-width: 62ch;
}
.curr-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--paper-2);
  padding: 5px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
}
.curr-tab {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: 700 14px/1.35 var(--display);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.18s ease;
}
.curr-tab:hover {
  color: var(--ink);
}
.curr-tab[aria-selected="true"] {
  background: var(--ink);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(28, 23, 21, 0.18);
}
.curr-pane:not(.is-active), .curr-pane[hidden] {
  display: none;
}
.curr-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.curr-card {
  background: #FFFFFF;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.curr-badge, .curr-card .c-step {
  display: inline-flex;
  align-self: flex-start;
  font: 800 12.5px/1.35 var(--display);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--sun-light);
  color: var(--gold);
}
.curr-card h3 {
  font: 800 18px/1.3 var(--display);
  margin: 0;
  color: var(--ink);
}
.curr-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}
.curr-meta, .curr-card .c-out {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--leaf);
}

/* ---------- WP3: Brightwheel School ROI Calculator & Storypark 4-Tab Showcase ---------- */
.roi-shell {
  background: linear-gradient(135deg, #FFFDF9 0%, #F4EFE6 100%);
  border: 1.5px solid #DED5C7;
  border-radius: 24px;
  padding: 26px 24px;
  margin: 28px 0 36px;
}
.roi-shell > p {
  max-width: 64ch;
}
.roi-grid {
  display: grid;
  gap: 24px;
  align-items: center;
  margin-top: 16px;
}
@media (min-width: 820px) {
  .roi-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}
.roi-slider-box {
  padding: 4px 0 12px;
  border-bottom: 1px dashed var(--line);
}
.roi-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.roi-slider-head label {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
.roi-slider-head output, .roi-slider-head b {
  font: 800 22px/1.2 var(--display);
  color: var(--crayon);
}
.roi-range {
  width: 100%;
  accent-color: var(--crayon);
  height: 8px;
  cursor: pointer;
}
.roi-models {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
@media (max-width: 520px) {
  .roi-models { grid-template-columns: 1fr; }
}
.roi-model-btn {
  border: 1.5px solid var(--line);
  background: var(--paper);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.roi-model-btn b {
  display: block;
  font: 800 14px/1.35 var(--display);
  color: var(--ink);
  margin-bottom: 4px;
}
.roi-model-btn small, .roi-model-btn span {
  display: block;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
}
.roi-model-btn[aria-pressed="true"] {
  background: #FFFFFF;
  border-color: var(--crayon);
  box-shadow: 0 0 0 2px rgba(181, 49, 22, 0.16);
}
.roi-results {
  display: grid;
  gap: 12px;
}
.roi-kpi {
  background: #FFFFFF;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}
.roi-kpi span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.roi-kpi b {
  display: block;
  font: 800 28px/1.2 var(--display);
  color: var(--crayon);
  margin: 4px 0;
}
.roi-kpi b.leaf {
  color: var(--leaf);
}
.roi-kpi small {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
}

.showcase-box {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.showcase-pane {
  display: grid;
  gap: 18px;
  align-items: center;
}
@media (min-width: 780px) {
  .showcase-pane {
    grid-template-columns: 1.1fr 0.9fr;
  }
}
.showcase-pane:not(.is-active), .showcase-pane[hidden] {
  display: none;
}
.showcase-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--ink-2);
  display: grid;
  gap: 8px;
}
.showcase-card {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

/* ---------- WP4: Brightwheel Teacher Mobile Quick-Action Dock (/admin) ---------- */
.quick-dock {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 14px 0 8px;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--line), var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.quick-action:hover {
  transform: translateY(-2px);
  border-color: var(--crayon);
}
.quick-action .qa-ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--crayon-light);
  color: var(--crayon);
  display: grid;
  place-items: center;
  flex: none;
}
.quick-action:nth-child(2) .qa-ic {
  background: var(--leaf-light);
  color: var(--leaf);
}
.quick-action:nth-child(3) .qa-ic {
  background: var(--sky-light);
  color: var(--sky);
}
.quick-action .qa-ic svg {
  width: 20px;
  height: 20px;
  display: block;
}
.quick-action b {
  display: block;
  font: 800 14.5px/1.3 var(--display);
  color: var(--ink);
}
.quick-action small {
  display: block;
  font-size: 12px;
  color: var(--ink-2);
}


/* ------------------------------------------------------------ English class page (15/10/2026)
   Layout learnt from Uup (class header, four tabs, unit column, expandable homework cards); colours stay H2edu's. */
.cls-cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .cls-cards { grid-template-columns: 1fr 1fr; } }
.cls-card {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px; min-height: 96px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cls-card:hover { border-color: var(--leaf); box-shadow: var(--shadow); }
.cls-badge {
  width: 56px; height: 56px; flex: none; border-radius: 14px; display: grid; place-items: center;
  background: var(--leaf-light); color: var(--leaf); font: 800 20px/1 var(--display);
}
.cls-info { flex: 1; min-width: 0; display: grid; gap: 4px; }
.cls-info b { font: 800 18px/1.2 var(--display); }
.cls-info .muted { font-size: 13.5px; }
.cls-last { display: grid; gap: 4px; }
.cls-last small, .cls-info small { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cls-go { font-size: 26px; color: var(--ink-3); }

.cls-head { display: flex; gap: 14px; align-items: flex-start; margin: 4px 0 10px; }
.cls-back {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 20px;
}
.cls-back:hover { border-color: var(--ink-3); }
.cls-title h2 { font: 800 26px/1.15 var(--display); margin: 2px 0; }
.cls-title .muted { margin: 0; }
.crumbs { font-size: 13px; color: var(--ink-2); }
.crumbs a { color: var(--ink-2); }
.cls-tabs {
  display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 16px;
  scrollbar-width: none;
}
.cls-tabs::-webkit-scrollbar { display: none; }
.cls-tabs a {
  flex: none; padding: 12px 18px; min-height: 44px; color: var(--ink-2); text-decoration: none; font-weight: 700;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.cls-tabs a:hover { color: var(--ink); }
.cls-tabs a[aria-current="page"] { color: var(--leaf); border-bottom-color: var(--leaf); }

.cls-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .cls-grid { grid-template-columns: 280px 1fr; } }
.cls-path { background: var(--paper-2); border-radius: var(--radius); padding: 14px; }
.cls-path h3 { font: 800 16px/1.2 var(--display); margin: 0 0 10px; }
.path-select select { width: 100%; min-height: 46px; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--card); font-size: 15px; color: var(--ink); }
.path-list { display: none; list-style: none; margin: 0; padding: 0; gap: 4px; }
@media (min-width: 900px) {
  .path-select { display: none; }
  .path-list { display: grid; max-height: 70vh; overflow-y: auto; }
}
.path-item {
  width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; padding: 9px 10px; min-height: 44px;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: 600 14.5px/1.3 var(--body); cursor: pointer;
}
.path-item:hover { background: var(--card); }
.path-item[aria-pressed="true"] { background: var(--card); box-shadow: var(--shadow-sm); color: var(--leaf); }
.path-item .pic { font-size: 18px; width: 24px; text-align: center; flex: none; }
.path-item .nm { flex: 1; min-width: 0; }
.path-item .nm small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.path-item .n { flex: none; min-width: 26px; padding: 1px 8px; border-radius: var(--radius-full); background: var(--paper); font-size: 12px; font-weight: 700; color: var(--ink-2); text-align: center; }

.cls-main { min-width: 0; }
.cls-actions { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.note-btn {
  display: inline-flex; gap: 8px; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 12px;
  border: 1px solid #F1DFB8; background: var(--sun-light); color: var(--ink); font: 700 14.5px var(--body); cursor: pointer;
}
.note-btn .badge { min-width: 20px; height: 20px; border-radius: 10px; background: var(--crayon); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }
.note-preview { background: var(--sun-light); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; font-size: 14px; }
.as-grp { display: flex; gap: 8px; align-items: center; font: 800 17px/1.2 var(--display); margin: 18px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.as-grp small { font: 600 14px var(--body); color: var(--ink-2); }
.as-list { display: grid; gap: 10px; }
.as-empty { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; }
.as-empty p { margin: 6px 0 0; }
.as-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.as-card.is-off { opacity: .7; }
.as-row { display: flex; align-items: stretch; }
.as-head {
  flex: 1; min-width: 0; display: flex; gap: 12px; align-items: center; padding: 12px 14px; min-height: 76px;
  border: 0; background: transparent; text-align: left; color: var(--ink); font: inherit; cursor: pointer; border-radius: 14px 0 0 14px;
}
.as-head:hover, .as-head[aria-expanded="true"] { background: var(--paper); }
.as-pic { width: 52px; height: 52px; flex: none; border-radius: 12px; background: var(--sky-light); display: grid; place-items: center; font-size: 26px; }
.as-body { flex: 1; min-width: 0; }
.as-body b { display: block; font-size: 15.5px; }
.as-body small { display: block; color: var(--ink-2); font-size: 13px; }
.as-stat { flex: none; text-align: center; min-width: 76px; padding-left: 10px; border-left: 1px solid var(--line-light); }
.as-stat b { display: block; font: 800 19px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.as-stat small { font-size: 12px; color: var(--ink-2); }
.as-stat.is-all b { color: var(--leaf); }
.as-more { position: relative; display: flex; }
.as-menu-btn { width: 44px; border: 0; background: transparent; font-size: 22px; color: var(--ink-2); cursor: pointer; border-radius: 0 14px 14px 0; }
.as-menu-btn:hover { background: var(--paper); color: var(--ink); }
.as-menu {
  position: absolute; right: 6px; top: calc(100% - 6px); z-index: 20; min-width: 200px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.as-menu button { display: block; width: 100%; text-align: left; min-height: 42px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; font: 600 14.5px var(--body); color: var(--ink); cursor: pointer; }
.as-menu button:hover, .as-menu button:focus-visible { background: var(--paper-2); }
.as-menu .danger, .btn.danger { color: var(--crayon-hover); }
.as-detail { border-top: 1px solid var(--line-light); padding: 14px; }
.as-cols { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .as-cols { grid-template-columns: 1fr 1fr; } .as-col + .as-col { border-left: 1px solid var(--line-light); padding-left: 16px; } }
.as-col h4 { display: flex; gap: 6px; align-items: baseline; margin: 0 0 8px; font-size: 14.5px; }
.as-col h4 .ok { color: var(--leaf); }
.as-col h4 .bad { color: var(--crayon-hover); }
.as-col .when-h { margin-left: auto; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.as-col ul { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.as-col li { display: flex; gap: 10px; align-items: center; min-height: 40px; }
.as-col li .nm { flex: 1; min-width: 0; font-weight: 600; }
.as-col li .when { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.as-col li .btn { min-height: 36px; padding: 4px 10px; }
.ava {
  width: 32px; height: 32px; flex: none; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--leaf-light); color: var(--leaf); font: 800 14px/1 var(--display); vertical-align: middle;
}
.ava.more { background: var(--paper-2); color: var(--ink-2); font-size: 12px; }
.avs { display: inline-flex; }
.avs .ava { border: 2px solid var(--card); margin-left: -8px; }
.avs .ava:first-child { margin-left: 0; }

.sheet.sheet-wide { max-width: 1100px; }
.give-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .give-grid { grid-template-columns: 1.4fr 1fr; } .give-side { border-left: 1px solid var(--line); padding-left: 18px; } }
.give-filter { display: flex; gap: 8px; margin-bottom: 10px; }
.give-filter input, .give-filter select { min-height: 46px; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 15px; background: var(--card); color: var(--ink); }
.give-filter input { flex: 1; min-width: 0; }
.give-units { display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.give-unit { display: flex; gap: 12px; align-items: center; padding: 10px 12px; min-height: 56px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; }
.give-unit:has(input:checked) { border-color: var(--leaf); background: var(--leaf-light); }
.give-unit[hidden] { display: none; }
.give-unit .pic { font-size: 24px; width: 32px; text-align: center; flex: none; }
.give-unit .txt b { display: block; font-size: 14.5px; }
.give-unit .txt small { color: var(--ink-2); font-size: 12.5px; }
.give-side { display: grid; gap: 14px; align-content: start; }
.give-acts { border: 0; padding: 0; margin: 0; }
.give-acts[hidden] { display: none; }
.give-acts legend { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.give-acts .chip { display: inline-flex; gap: 6px; align-items: center; }
.give-count { margin: 0; }

.ss-add { display: grid; gap: 8px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ss-add .field label { font-size: 13px; margin-bottom: 4px; }
.ss-add .field input, .ss-add .field select { min-height: 44px; padding: 8px 12px; }
.ss-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.ss-head h3 { font: 800 19px/1.2 var(--display); margin: 0; }
.ss-head p { margin: 2px 0 0; }
.btn-row-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row-inline input[type="search"] { min-height: 40px; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: 14.5px; }
.ss-tbl td { vertical-align: middle; }
.ss-tbl textarea { width: 100%; min-width: 220px; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; font: 14.5px/1.4 var(--body); resize: vertical; background: var(--card); color: var(--ink); }
.att { border: 0; margin: 0; padding: 0; display: grid; gap: 2px; min-width: 110px; }
.att label { display: flex; gap: 6px; align-items: center; min-height: 30px; font-size: 14px; cursor: pointer; }
#ss-form .btn-primary { margin-top: 12px; }

.rp-top { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.rp-top h3 { margin: 0; }
.rp-kpis { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .rp-kpis { grid-template-columns: repeat(4, 1fr); } }
.rp-kpi { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--card); display: grid; gap: 4px; }
.rp-kpi .rp-ic { font-size: 18px; }
.rp-kpi .rp-l { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.rp-kpi b { font: 800 26px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.delta { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.delta.is-up { color: var(--leaf); }
.delta.is-down { color: var(--crayon-hover); }
.rp-charts { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 14px 0; }
@media (min-width: 900px) { .rp-charts { grid-template-columns: 1fr 1fr; } }
.rp-charts .panel { margin: 0; }
.rp-chart { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto; }
.rp-chart text { font: 600 12px var(--body); fill: var(--ink-2); }
.rp-chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.rp-chart .line { fill: none; stroke: var(--sky); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.rp-chart .dot { fill: var(--card); stroke: var(--sky); stroke-width: 3; }
.rp-chart .val { fill: var(--ink); font-weight: 800; }
.rp-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rp-bars li { display: grid; grid-template-columns: 72px 1fr 52px; gap: 10px; align-items: center; font-size: 13.5px; }
.rp-bars b { text-align: right; font-variant-numeric: tabular-nums; }
.rp-bt { height: 14px; background: var(--paper-2); border-radius: var(--radius-full); overflow: hidden; }
.rp-bt i { display: block; height: 100%; border-radius: var(--radius-full); min-width: 2px; }
.rp-bt .b5 { background: var(--leaf); }
.rp-bt .b4 { background: #4F9A6B; }
.rp-bt .b3 { background: var(--sun); }
.rp-bt .b2 { background: #E07B4F; }
.rp-bt .b1 { background: var(--crayon); }
.rp-tbl { min-width: 640px; }
.rp-tbl td { vertical-align: middle; }
.ring-s {
  --p: 0; width: 46px; height: 46px; border-radius: 50%; display: inline-grid; place-items: center;
  background: conic-gradient(var(--leaf) calc(var(--p) * 1%), var(--paper-2) 0);
}
.ring-s.low { background: conic-gradient(var(--crayon) calc(var(--p) * 1%), var(--paper-2) 0); }
.ring-s span { width: 36px; height: 36px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.cell-ok { background: var(--leaf-light); }
.cell-part { background: var(--sun-light); }
.rp-test { padding: 10px 0; border-bottom: 1px solid var(--line-light); }
.rp-test .chips { margin-top: 6px; }

/* Tables that turn into one card per child on a phone (class register, class kids). */
@media (max-width: 719px) {
  .tbl-cards thead { display: none; }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-cards tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .tbl-cards td { border: 0; padding: 4px 0; text-align: left; }
  .tbl-cards td.n:first-child { display: none; }
  .tbl-cards td[data-l] { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
  .tbl-cards td[data-l]::before { content: attr(data-l); color: var(--ink-2); font-weight: 600; }
  .tbl-cards .tc-name { font-size: 16px; }
  .tbl-cards td.n:last-child { text-align: left; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
  .tbl-cards .att { display: flex; flex-wrap: wrap; gap: 4px 16px; }
  .tbl-cards textarea { min-width: 0; }
}

/* ------------------------------------------------------------ admin app shell (15/10/2026)
   Full-width frame learnt from Uup: slim top bar, a left rail of icon groups with "+ Tạo", the page beside it.
   Phones: the rail becomes a bottom bar. Colours and type stay H2edu's. */
body.shell { background: var(--paper); }
body.shell .topbar { top: 0; max-width: none; margin: 0; border-radius: 0; border-width: 0 0 1px; box-shadow: none; background: rgba(255, 253, 249, .97); }
body.shell .topbar .wrap { max-width: none; min-height: 58px; padding: 0 20px; }
body.shell .topbar .nav a { padding: 7px 12px; }
body.shell #app { max-width: none; margin: 0; padding: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: start; }
.rail {
  position: sticky; top: 58px; height: calc(100vh - 58px); overflow: visible; z-index: 30;  /* visible: the + Tạo menu flies out of it */
  display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; background: var(--card); border-right: 1px solid var(--line);
}
.rail-item {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 4px; min-height: 64px; border-radius: 14px;
  color: var(--ink-2); text-decoration: none; text-align: center; font: 700 12px/1.25 var(--body); border: 0; background: transparent; cursor: pointer; width: 100%;
}
.rail-item:hover { background: var(--paper-2); color: var(--ink); }
.rail-item[aria-current="page"] { background: var(--leaf-light); color: var(--leaf); }
.rail-dot { position: absolute; top: 8px; right: 18px; width: 9px; height: 9px; border-radius: 50%; background: var(--crayon); box-shadow: 0 0 0 2px var(--card); }
.rail-create { position: relative; margin-bottom: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.rail-plus { background: var(--card); box-shadow: 0 0 0 1px var(--line) inset, var(--shadow-sm); color: var(--ink); }
.create-menu {
  position: absolute; left: calc(100% + 8px); top: 0; z-index: 50; width: 280px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.create-menu a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.create-menu a:hover, .create-menu a:focus-visible { background: var(--paper-2); }
.create-menu b { display: block; font-size: 14.5px; }
.create-menu span { font-size: 12.5px; color: var(--ink-2); }
.shell-main { min-width: 0; padding: 14px 28px 60px; max-width: 1480px; }
.shell-hello { margin: 0 0 6px; font-size: 13px; }
body.shell .subnav { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 14px; }
body.shell .subnav[hidden] { display: none; }
body.shell .subnav .tab[hidden] { display: none; }
@media (max-width: 899px) {
  body.shell .topbar .wrap { padding: 0 14px; }
  body.shell #app { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line);
    box-shadow: 0 -6px 24px rgba(28, 23, 21, .08); overflow: visible;
  }
  .rail-item { min-height: 56px; padding: 6px 2px; font-size: 11.5px; }
  .rail-create { margin: 0; padding: 0; border: 0; flex: 1; display: flex; }
  .rail > .rail-item { flex: 1; }
  .rail-dot { right: 22%; }
  .create-menu { left: 0; top: auto; bottom: calc(100% + 10px); width: min(300px, calc(100vw - 24px)); }
  .shell-main { padding: 10px 16px calc(88px + env(safe-area-inset-bottom)); }
  body.shell .subnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  body.shell .subnav::-webkit-scrollbar { display: none; }
}

/* Class header as one band with the tabs under it; breadcrumb on the right (Uup's class page). */
body.shell .cls-head { align-items: center; margin: 0; padding: 14px 18px; background: var(--paper-2); border-radius: var(--radius) var(--radius) 0 0; }
body.shell .cls-head .crumbs { margin-left: auto; align-self: flex-start; padding-top: 4px; }
body.shell .cls-tabs { background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 0 8px; }
body.shell #usernav a[href="#settings"] { display: none; }  /* the rail has Cài đặt */
@media (max-width: 599px) {
  body.shell .topbar .brand-name { display: none; }
  body.shell .topbar .nav { gap: 2px; }
  body.shell .topbar .nav a { padding: 6px 8px; font-size: 13px; }
  body.shell .cls-head .crumbs { display: none; }
  .as-head { flex-wrap: wrap; }
  .as-body { flex: 1 1 calc(100% - 66px); }
  .as-stat { display: flex; gap: 6px; align-items: baseline; min-width: 0; padding-left: 0; border-left: 0; margin-left: 0; text-align: left; }
  .as-stat + .as-stat { margin-left: 14px; }
  .as-stat b { font-size: 17px; }
}

/* English hub: the week in one line above the classes; the AI box after them. */
.en-week { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); }
.en-week b { color: var(--ink); }
.en-week span { white-space: nowrap; }
.en-week .hot { color: var(--crayon-hover); font-weight: 700; }
.en-ai { margin-top: 18px; }

/* "+ Tạo" as groups with sub-menus (Uup's create menu). Wide screens: the sub-menu flies out to the right and opens on
   hover too; phones: it opens below its group. */
.create-menu { width: 270px; overflow: visible; }
.cm-group { position: relative; }
.cm-group + .cm-group { border-top: 1px solid var(--line-light); }
.cm-head {
  width: 100%; display: flex; gap: 10px; align-items: center; min-height: 46px; padding: 8px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink); font: 700 14.5px var(--body); text-align: left; cursor: pointer;
}
.cm-head:hover, .cm-head[aria-expanded="true"] { background: var(--paper-2); }
.cm-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--paper-2); display: grid; place-items: center; font-size: 16px; flex: none; }
.cm-l { flex: 1; }
.cm-chev { color: var(--ink-3); font-size: 18px; }
.cm-sub { padding: 2px 0 6px 38px; }
.cm-sub a { display: block; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.cm-sub a:hover, .cm-sub a:focus-visible { background: var(--leaf-light); }
.cm-sub b { display: block; font-size: 14px; }
.cm-sub span { font-size: 12.5px; color: var(--ink-2); }
@media (min-width: 900px) {
  .cm-sub {
    position: absolute; left: calc(100% + 10px); top: -6px; width: 290px; padding: 6px; z-index: 2;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  }
  .cm-sub::before { content: ""; position: absolute; left: -14px; top: 0; bottom: 0; width: 14px; }  /* keeps hover alive across the gap */
}
@media (min-width: 900px) and (hover: hover) {
  .cm-group:hover > .cm-sub { display: block !important; }
  .cm-group:hover > .cm-head { background: var(--paper-2); }
}
@media (max-width: 899px) {
  .create-menu { max-height: 70vh; overflow-y: auto; }
  .cm-chev { transition: transform .15s ease; }
  .cm-head[aria-expanded="true"] .cm-chev { transform: rotate(90deg); }
}

/* Import from Excel and the quiz editor (15/10/2026). */
.imp-steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; font-size: 14.5px; }
.qz-thumb { display: grid; place-items: center; font-size: 30px; }
.qz { display: grid; gap: 14px; }
.qz-problems { background: var(--sun-light); border: 1px solid #F1DFB8; border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.qz-problems ul { margin: 6px 0 0; padding-left: 18px; }
.qz-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--card); display: grid; gap: 12px; }
.qz-sec-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qz-sec-head b { font: 800 16px var(--display); }
.qz-sec-head input { flex: 1 1 200px; min-height: 42px; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 14.5px; }
.qz-sec-head select, .qz-q-head select { min-height: 42px; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 14px; background: var(--card); color: var(--ink); }
.qz-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.qz-audio { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qz-audio audio { max-width: 100%; height: 40px; }
.qz-up { cursor: pointer; }
.qz-qs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.qz-q { border: 1px solid var(--line-light); border-radius: 12px; padding: 10px 12px; background: var(--paper); display: grid; gap: 8px; }
.qz-q-head { display: flex; gap: 8px; align-items: center; }
.qz-n { font: 800 14.5px var(--display); margin-right: auto; }
.qz-prompt, .qz-accept, .qz-opt input[data-o] {
  width: 100%; min-height: 42px; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 14.5px; background: var(--card); color: var(--ink);
}
.qz-opts { display: grid; gap: 6px; }
.qz-opts > .btn { justify-self: start; }
.qz-opt { display: flex; gap: 8px; align-items: center; }
.qz-opt input[type="radio"] { width: 20px; height: 20px; flex: none; accent-color: var(--leaf); }
.qz-l { width: 22px; font: 800 14px var(--display); color: var(--ink-2); flex: none; }
.qz-x { width: 36px; height: 36px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 20px; cursor: pointer; }
.qz-x:hover { background: var(--paper-2); }
.qz-tf { display: flex; gap: 18px; flex-wrap: wrap; }
.qz-tf label { display: flex; gap: 6px; align-items: center; min-height: 36px; font-size: 14.5px; cursor: pointer; }
.qz-tf input { accent-color: var(--leaf); width: 18px; height: 18px; }
.qz-foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; position: sticky; bottom: -28px; background: var(--paper); padding: 10px 0; border-top: 1px solid var(--line); }
.qi-sample { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.qi-sample summary { cursor: pointer; font-weight: 700; }
.qi-rules { padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
.qi-pre { white-space: pre-wrap; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; max-height: 260px; overflow: auto; }

/* Kết quả and Báo cáo, centre-wide (15/10/2026). */
.res-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.res-filters input[type="search"], .res-filters select {
  min-height: 42px; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: 14.5px; background: var(--card); color: var(--ink);
}
.res-filters input[type="search"] { flex: 1 1 220px; min-width: 0; }
.res-filters select { flex: 0 1 220px; max-width: 100%; }
.res-filters .chips { margin: 0; }
.res-tbl { min-width: 760px; }  /* scrolls sideways on a phone instead of one word per line */
.res-tbl td { vertical-align: middle; }
.res-tbl .ava, .rp-tbl .ava { width: 28px; height: 28px; font-size: 12.5px; margin-right: 4px; }
.res-tbl .sk { display: inline-block; margin: 0 10px 2px 0; font-size: 13.5px; white-space: nowrap; }
.res-tbl .meter { width: 110px; height: 8px; margin-bottom: 2px; }
b.low, dd.low { color: var(--crayon-hover); }
.late { color: var(--crayon-hover); font-weight: 700; }
small.trend-up { color: var(--leaf); font-weight: 700; white-space: nowrap; }
small.trend-down { color: var(--crayon-hover); font-weight: 700; white-space: nowrap; }
.chips-words { display: flex; flex-wrap: wrap; gap: 4px; }
.chips-words span { padding: 1px 8px; border-radius: var(--radius-full); background: var(--sun-light); font-size: 13px; }
.trend { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.spark { width: 90px; height: 30px; }
.spark polyline { fill: none; stroke: var(--sky); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark circle { fill: var(--sky); }
.tfk { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.tfk span { display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.tfk i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tfk .g { background: var(--leaf); }
.tfk .f { background: var(--sun); }
.tfk .w { background: var(--crayon); }
.ops-grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 14px; }
@media (min-width: 900px) { .ops-grid { grid-template-columns: repeat(2, 1fr); } }
.ops-grid .panel { margin: 0; }
.ops-dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; margin: 0; font-size: 14.5px; }
.ops-dl dt { color: var(--ink-2); }
.ops-dl dd { margin: 0; font: 800 17px var(--display); text-align: right; font-variant-numeric: tabular-nums; }
.ops-ai p { margin: 8px 0 4px; font-size: 14.5px; }
.ops-big { font: 800 30px var(--display); margin: 4px 0; }
.ops-bar { display: flex; gap: 8px; align-items: center; min-width: 160px; }
.ops-bar i { display: block; height: 10px; border-radius: var(--radius-full); background: var(--sky); min-width: 3px; }
.ops-bar span { font-weight: 800; font-variant-numeric: tabular-nums; }
.rank-tbl .rank { font: 800 18px var(--display); }
.rank-tbl tr.top td { background: var(--sun-light); }
@media (max-width: 899px) {
  .rail { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .rail > .rail-item, .rail-create { flex: 1 0 64px; }
}

/* "Lộ trình học" folded by Unit (17/10/2026). */
.path-group details > summary {
  display: flex; gap: 10px; align-items: center; padding: 9px 10px; min-height: 44px; border-radius: 10px; cursor: pointer;
  list-style: none; font: 700 14.5px/1.3 var(--body); color: var(--ink);
}
.path-group details > summary::-webkit-details-marker { display: none; }
.path-group details > summary:hover { background: var(--card); }
.path-group summary .pic { font-size: 18px; width: 24px; text-align: center; flex: none; }
.path-group summary .nm { flex: 1; min-width: 0; }
.path-group summary .nm small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.path-group summary .n { flex: none; min-width: 26px; padding: 1px 8px; border-radius: var(--radius-full); background: var(--paper); font-size: 12px; font-weight: 700; color: var(--ink-2); text-align: center; }
.path-group summary .chev { color: var(--ink-3); transition: transform .15s ease; }
.path-group details[open] > summary .chev { transform: rotate(90deg); }
.path-group ul { list-style: none; margin: 2px 0 6px 14px; padding: 0 0 0 10px; border-left: 2px solid var(--line); display: grid; gap: 2px; }
@media (prefers-reduced-motion: reduce) { .path-group summary .chev { transition: none; } }

/* ---------- tranh của con trong tháng (album): trình chiếu + ảnh động ---------- */
.recap { margin: 0 0 22px; padding: 18px 20px; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; }
.recap[hidden] { display: none; }
.recap-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.recap-head h2 { font: 800 20px/1.3 var(--display); margin: 0 0 4px; }
.recap-head p { margin: 0; }
.recap-pick { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.recap-pick select { min-height: 40px; border-radius: 10px; border: 1.5px solid var(--line); padding: 0 10px; font: inherit; background: #fff; }
.recap-show { position: fixed; inset: 0; z-index: 90; background: #1C1715; color: #fff; display: grid; grid-template-rows: 1fr auto auto; place-items: center; padding: 16px; gap: 10px; }
.recap-show img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 10px; background: #FAF8F5; }
.recap-cap { margin: 0; font: 700 18px/1.35 var(--display); text-align: center; }
.recap-ctl { display: flex; gap: 10px; }
.recap-ctl .btn { background: #fff; min-width: 56px; }

/* ---------- Cài đặt (19/10/2026): five pages; on a wide screen each section is its title beside its own form ---------- */
.set-page { padding: 4px 28px; max-width: 1120px; }
.set-sec { display: grid; gap: 14px 40px; padding: 26px 0; border-top: 1px solid var(--line-light); }
.set-page > .set-sec:first-child, .set-page > :first-child > .set-sec:first-child { border-top: 0; }
.set-sec > header h2 { font: 800 18px/1.25 var(--display); margin: 0 0 6px; }
.set-sec > header p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; max-width: 46ch; }
@media (min-width: 960px) { .set-sec { grid-template-columns: minmax(220px, 290px) minmax(0, 1fr); } }
.set-body { min-width: 0; }
.set-form { max-width: 680px; gap: 16px; }
.set-form .field small { display: block; margin-top: 6px; line-height: 1.45; }
.set-form .field input:disabled { background: var(--paper-2); color: var(--ink-2); cursor: not-allowed; }
.set-foot { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: flex-end; }
.set-foot .set-check { margin-right: auto; }
.set-check { display: inline-flex; gap: 8px; align-items: center; font-size: 14.5px; cursor: pointer; }
.set-check input { width: 18px; height: 18px; accent-color: var(--leaf); flex: none; }
.set-note { margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--paper-2); color: var(--ink-2); font-size: 14px; }
.set-preview { margin: -4px 0 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--leaf-light); color: var(--ink); font-size: 14px; }
.set-preview .error { font-size: 13.5px; }
.set-ok { margin: 0; color: var(--leaf); font-weight: 700; font-size: 14.5px; }
.set-alerts { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.set-alerts li { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--sun-light); border: 1px solid rgba(245, 166, 35, .35); font-size: 14.5px; }
.set-bad { color: var(--crayon); }
.set-log .nowrap { white-space: nowrap; }
.set-log .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
/* H2edu operator inside the centre (platform ticket): always visible, never mistaken for the centre's own staff. */
.platform-band { background: var(--sky); color: #fff; font-size: 14px; }
.platform-band .wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding-block: 8px; }
.platform-band span { min-width: 0; overflow-wrap: anywhere; }
.platform-band .btn { background: #fff; color: var(--sky); border-color: #fff; }

/* Rows: branches, products, people. */
.set-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.set-row { display: flex; gap: 12px 14px; align-items: center; padding: 12px 16px; }
.set-row + .set-row { border-top: 1px solid var(--line-light); }
.set-row-main { flex: 1 1 auto; min-width: 0; }
.set-row-main > b { font-size: 15px; }
.set-row-main > .muted { display: block; font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.set-row-main .tag { margin: 0 0 0 4px; vertical-align: 1px; }
.set-row .select { min-height: 38px; font-size: 13.5px; padding: 6px 10px; max-width: 100%; }
@media (max-width: 599px) {
  .set-page { padding: 2px 16px; }
  .set-sec { padding: 20px 0; }
}

/* Products fold open in place. */
.set-fold { display: block; padding: 0; }
.set-fold > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 6px 14px; align-items: center; padding: 12px 16px; cursor: pointer; list-style: none; }
.set-fold > summary::-webkit-details-marker { display: none; }
.set-fold > summary:hover, .set-fold[open] > summary { background: var(--paper); }
.set-fold[open] > summary { border-bottom: 1px solid var(--line-light); }
.set-fold > form { padding: 16px; max-width: none; }
.set-fold .tag { margin: 0; }
.set-price { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.set-chev { color: var(--ink-3); font-size: 20px; line-height: 1; transition: transform .15s ease; }
.set-fold[open] .set-chev { transform: rotate(90deg); }
@media (max-width: 599px) { .set-fold > summary { grid-template-columns: auto auto minmax(0, 1fr) auto; } .set-fold .set-row-main { grid-column: 1 / -1; } .set-fold .set-chev { justify-self: end; } }
@media (prefers-reduced-motion: reduce) { .set-chev { transition: none; } }

/* "+ Thêm …" opens its form under the button. */
.set-add { margin-top: 14px; }
.set-add > summary { list-style: none; display: inline-flex; }
.set-add > summary::-webkit-details-marker { display: none; }
.set-add[open] > summary { margin-bottom: 12px; }
.set-add > form { padding: 16px; border: 1px dashed var(--wire); border-radius: 14px; background: var(--paper); }
.set-more { margin-top: 14px; }
.set-toggle { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); cursor: pointer; }
.set-toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--leaf); flex: none; }
.set-toggle b { display: block; font-size: 15px; }
.set-toggle small { display: block; margin-top: 2px; color: var(--ink-2); font-size: 13.5px; }

/* ---------- Nhân sự (19/10/2026): a read-only table for hundreds of people; changes happen in the drawer ---------- */
.staff-page { padding: 22px 24px; }
.staff-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.staff-head h2 { margin: 0 0 2px; }
.staff-head p { margin: 0; }
.staff-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
.staff-tools input[type="search"] { flex: 1 1 240px; min-height: 42px; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 14px; font-size: 15px; background: var(--card); }
.staff-tools input[type="search"]:focus { border-color: var(--crayon); outline: none; box-shadow: 0 0 0 3px rgba(217, 69, 40, .12); }
.staff-tools .select { min-height: 42px; }
.staff-tools .chip { min-height: 42px; }
.staff-bulk { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; margin-bottom: 10px;
  border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.staff-bulk[hidden] { display: none; }
.staff-bulk b { margin-right: 6px; font-size: 14px; }
.staff-bulk .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); box-shadow: none; }
.staff-bulk .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.staff-bulk .select { min-height: 36px; padding: 4px 10px; font-size: 13.5px; color: var(--ink); }
.staff-tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.staff-tbl th { position: sticky; top: 0; text-align: left; font-size: 12.5px; font-weight: 700; color: var(--ink-2); padding: 10px; background: var(--paper);
  border-bottom: 1px solid var(--line); white-space: nowrap; }
.staff-tbl th:first-child { border-radius: 10px 0 0 0; }
.staff-tbl th:last-child { border-radius: 0 10px 0 0; }
.staff-tbl td { padding: 10px; border-bottom: 1px solid var(--line-light); vertical-align: middle; }
.staff-tbl tbody tr { cursor: pointer; }
.staff-tbl tbody tr:hover { background: var(--paper); }
.staff-tbl tr.off td { color: var(--ink-3); }
.staff-tbl .ck { width: 36px; }
.staff-tbl .ck input { width: 18px; height: 18px; accent-color: var(--ink); }
.staff-tbl .go { width: 24px; color: var(--ink-3); font-size: 20px; text-align: right; }
.staff-tbl .who { display: flex; gap: 10px; align-items: center; min-width: 220px; }
.staff-tbl .who > span:last-child { min-width: 0; }
.staff-tbl .who .muted, .staff-tbl .role .muted { display: block; font-size: 12.5px; }
.staff-tbl .who .tag { margin: 4px 4px 0 0; }
.staff-open { border: 0; background: none; padding: 0; font: 700 15px/1.3 var(--body); color: var(--ink); cursor: pointer; text-align: left; }
.staff-open:hover { text-decoration: underline; }
.staff-open:focus-visible { outline: 2px solid var(--crayon); outline-offset: 2px; border-radius: 4px; }
.staff-pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding-top: 12px; }
.staff-pager .muted { margin-right: auto; }
.staff-empty { padding: 28px 0; text-align: center; color: var(--ink-2); }
@media (max-width: 719px) {
  .staff-page { padding: 16px 14px; }
  .staff-tools input[type="search"] { flex-basis: 100%; }
  .staff-tools .select { flex: 1 1 calc(50% - 4px); }
  .staff-page .set-toggle small { display: none; }  /* the full rule sits on the desktop view; a phone keeps the switch */
  .staff-bulk { top: 56px; }
  .staff-tbl thead { display: none; }
  .staff-tbl, .staff-tbl tbody { display: block; }
  /* A card of three lines: the person, then branch and role, then classes and pay. */
  .staff-tbl tr { display: grid; grid-template-columns: 30px 32px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 4px; border-bottom: 1px solid var(--line-light); }
  .staff-tbl td { display: block; padding: 0; border: 0; min-width: 0; }
  .staff-tbl .ck { grid-column: 1; grid-row: 1; padding-top: 6px; }
  .staff-tbl .who { grid-column: 2 / 5; grid-row: 1; min-width: 0; }
  .staff-tbl .go { grid-column: 5; grid-row: 1; align-self: center; }
  .staff-tbl td[data-label] { font-size: 13.5px; }
  .staff-tbl td[data-label]:nth-child(odd) { grid-column: 3; }
  .staff-tbl td[data-label]:nth-child(even) { grid-column: 4 / -1; }
  .staff-tbl td[data-label="Lớp"]::before, .staff-tbl td[data-label="Lương"]::before { content: attr(data-label) ": "; color: var(--ink-2); }
  .staff-tbl .role .muted { display: inline; }
  .staff-tbl .role .muted::before { content: " · "; }
}

/* The person drawer: from the right on a wide screen, a bottom sheet on a phone. */
@media (min-width: 760px) {
  .sheet-bg.drawer { justify-content: flex-end; align-items: stretch; }
  .sheet-bg.drawer .sheet { max-width: 520px; max-height: none; height: 100%; border-radius: 0; animation-name: drawer-in; }
}
@keyframes drawer-in { from { transform: translateX(48px); opacity: 0; } }
.dr-who { display: flex; gap: 10px; align-items: flex-start; margin: -4px 0 6px; color: var(--ink-2); font-size: 14px; }
.dr-who .tag { margin: 4px 4px 0 0; }
.dr-sec { padding: 18px 0; border-top: 1px solid var(--line); }
.dr-sec h3 { font: 800 16px/1.3 var(--display); margin: 0 0 12px; }
.dr-sec .set-form { max-width: none; }
.dr-danger { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 16px; padding: 12px 14px;
  border-radius: 12px; background: var(--crayon-light); font-size: 14px; color: var(--ink-2); }
.cls-q { width: 100%; min-height: 42px; margin-bottom: 10px; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 14px; font-size: 15px; }
.cls-pick { display: grid; gap: 12px; max-height: 46vh; overflow: auto; }
.cls-pick fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.cls-pick legend { padding: 0 0 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.cls-pick label { padding: 8px 10px; border: 1px solid var(--line-light); border-radius: 10px; background: var(--card); }
.cls-pick label[hidden] { display: none; }
.cls-pick label:has(input:checked) { border-color: var(--leaf); background: var(--leaf-light); }

/* HimiLearn: a pack's own picture sits where an emoji would, at the same size */
.pic-img { width: 1em; height: 1em; object-fit: contain; vertical-align: middle; }
