:root {
  --ink: #3d2c5e;
  --ink-soft: #6f6290;
  --paper: #fff8ec;
  --card: #ffffff;
  --line: #3d2c5e;
  --primary: #ff6b6b;
  --primary-dark: #e84f4f;
  --secondary: #2ec4b6;
  --yellow: #ffd166;
  --purple: #9b5de5;
  --green: #06d6a0;
  --red: #ef476f;
  --radius: 20px;
  --shadow: 4px 4px 0 var(--line);
  --font: "Nunito", "Quicksand", "Segoe UI Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, #f2e3c9 1.5px, transparent 0);
  background-size: 26px 26px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--purple); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
.muted { color: var(--ink-soft); }
.inline { display: inline; margin: 0; }

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--card);
  border-bottom: 3px solid var(--line);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-size: 1.25rem; font-weight: 800; }
.logo-mark { font-size: 1.8rem; }
.logo-text b { color: var(--primary); }
.main-nav { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.main-nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  border: 2px solid transparent;
}
.main-nav a:hover { background: #fff1d6; }
.main-nav a.active { background: var(--yellow); border-color: var(--line); }
.user-area { display: flex; align-items: center; gap: 8px; }
.user-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: #f3edff;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}
.user-chip .avatar { font-size: 1.4rem; background: #fff; border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; flex: 1; }
.site-footer { text-align: center; padding: 20px 16px; color: var(--ink-soft); border-top: 2px dashed #e6d6bb; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 1.5rem; margin: 0; }
.link-more { font-weight: 700; white-space: nowrap; }
.card { background: var(--card); border: 3px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; align-items: start; }
.empty {
  background: var(--card);
  border: 3px dashed #d9c6a5;
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  font-size: 1.1rem;
  color: var(--ink-soft);
}
.empty .btn { margin: 14px 4px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit;
  font-weight: 800;
  padding: 11px 22px;
  border-radius: 999px;
  border: 3px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: #fff; }
.btn-small { padding: 6px 14px; font-size: .9rem; border-width: 2px; box-shadow: 2px 2px 0 var(--line); }
.btn-tiny { padding: 4px 10px; font-size: .82rem; border-width: 2px; box-shadow: 2px 2px 0 var(--line); }
.btn-block { width: 100%; }

/* ---------- Flash ---------- */
.flash {
  padding: 12px 18px;
  border-radius: 14px;
  border: 2px solid var(--line);
  margin-bottom: 16px;
  font-weight: 700;
  transition: opacity .6s, max-height .6s, margin .6s, padding .6s;
  max-height: 200px;
  overflow: hidden;
}
.flash-success { background: #d8f8ec; }
.flash-error { background: #ffe0e6; }
.flash-info { background: #fff1c9; }
.flash.fade { opacity: 0; max-height: 0; margin: 0; padding: 0 18px; border-width: 0; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; padding: 12px 0 8px; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 900; }
.hero p { font-size: 1.15rem; color: var(--ink-soft); max-width: 34em; }
.rainbow {
  background: linear-gradient(90deg, #ef476f, #ff9f1c, #06d6a0, #118ab2, #9b5de5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mode-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 24px 20px;
  border-radius: 28px;
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: transform .12s;
}
.mode-card:hover { transform: translateY(-4px) rotate(-1deg); }
.mode-card strong { font-size: 1.5rem; }
.mode-card span:last-child { color: var(--ink); opacity: .8; }
.mode-emoji { font-size: 3.4rem; line-height: 1; }
.mode-color { background: #ffe1e1; }
.mode-draw { background: #d9f7f3; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  padding: 6px 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}
.chip.active { background: var(--purple); color: #fff; }

/* ---------- Template & art grids ---------- */
.template-grid, .art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.template-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: transform .12s;
}
.template-card:hover { transform: translateY(-4px); }
.template-thumb { aspect-ratio: 4 / 3; background: #fff; display: grid; place-items: center; border-bottom: 2px dashed #e6d6bb; padding: 8px; }
.template-thumb img { max-height: 100%; object-fit: contain; }
.template-info { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 10px 14px; }
.stars { font-size: .8rem; white-space: nowrap; }

.art-card {
  margin: 0;
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.art-thumb { display: block; aspect-ratio: 4 / 3; background: #fff; border-bottom: 2px dashed #e6d6bb; }
.art-thumb img { width: 100%; height: 100%; object-fit: contain; }
.art-card figcaption { padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.art-card figcaption strong { overflow-wrap: anywhere; }
.art-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; margin-top: auto; }
.rename { position: relative; }
.rename summary { list-style: none; }
.rename summary::-webkit-details-marker { display: none; }
.rename-form { display: flex; gap: 6px; margin-top: 6px; }
.rename-form input { flex: 1; min-width: 0; padding: 4px 8px; border-radius: 8px; border: 2px solid var(--line); font: inherit; }
.badges { margin-top: 4px; }
.badge { display: inline-block; font-size: .75rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: #eee6ff; }
.badge-green { background: #c9f5e3; }
.badge-red { background: #ffd1db; }

.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 28px; font-weight: 700; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.form input:not([type=radio]):not([type=checkbox]):not([type=color]), .form select, .form textarea {
  font: inherit;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
}
.form input:focus, .form select:focus { outline: 3px solid var(--yellow); outline-offset: 1px; }
.form .check { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; }
.form .check input { width: 20px; height: 20px; }
.form-error { color: var(--red); font-weight: 700; margin: 0; }
.auth-box {
  max-width: 440px;
  margin: 20px auto;
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 28px;
  box-shadow: 6px 6px 0 var(--line);
  padding: 28px;
}
.auth-switch { text-align: center; margin: 18px 0 0; }
.avatar-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-pick legend { font-weight: 700; margin-bottom: 6px; }
.avatar-pick label { cursor: pointer; }
.avatar-pick input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-pick span {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  font-size: 1.7rem;
  border-radius: 50%;
  border: 2px solid #e2d7f5;
  background: #fff;
}
.avatar-pick input:checked + span { border: 3px solid var(--purple); background: #f3edff; transform: scale(1.08); }
.avatar-pick input:focus-visible + span { outline: 3px solid var(--yellow); }

.error-box { max-width: 520px; margin: 40px auto; }
.error-emoji { font-size: 4rem; }

/* ---------- Studio ---------- */
.studio-page .container { max-width: 1400px; padding-top: 14px; }
.studio { display: flex; flex-direction: column; gap: 12px; }
.studio-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.studio-title { font-size: 1.4rem; margin: 0; flex: 1; min-width: 160px; }
.studio-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.icon-btn {
  display: flex; flex-direction: column; align-items: center;
  font: inherit; font-size: 1.3rem; line-height: 1.1;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--ink);
}
.icon-btn span { font-size: .7rem; font-weight: 700; }
.icon-btn:disabled { opacity: .4; cursor: default; }
.studio-body { display: grid; grid-template-columns: 172px 1fr; gap: 14px; align-items: start; }
.toolbox {
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
}
.tools { display: grid; grid-template-columns: 1fr; gap: 8px; }
.tool {
  display: flex; align-items: center; gap: 8px;
  font: inherit; font-size: 1.5rem;
  padding: 8px 10px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: #f7f2ff;
  cursor: pointer;
  color: var(--ink);
}
.tool span { font-size: .9rem; font-weight: 800; }
.tool.active { background: var(--yellow); border-color: var(--line); }
.size-box { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.size-box input { width: 100%; accent-color: var(--purple); }
.size-preview { border-radius: 50%; border: 2px solid var(--line); min-width: 6px; min-height: 6px; }
.stamps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.stamps[hidden] { display: none; }
.stamp { font-size: 1.15rem; border: 2px solid transparent; background: #fff; border-radius: 10px; cursor: pointer; padding: 2px 0; min-width: 0; }
.stamp.active { border-color: var(--line); background: #fff1c9; }
.canvas-area { min-width: 0; }
.canvas-wrap {
  position: relative;
  width: 100%;
  max-width: calc((100vh - 270px) * 4 / 3);
  min-width: 280px;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  border: 4px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 6px 6px 0 var(--line);
  touch-action: none;
  cursor: crosshair;
}
.canvas-wrap[data-tool="fill"] { cursor: cell; }
.canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#lines { pointer-events: none; }
.canvas-loading { position: absolute; inset: 0; display: grid; place-items: center; background: #fff; font-weight: 800; font-size: 1.2rem; }
.canvas-loading[hidden] { display: none; }
.palette {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
}
.swatch {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 3px solid #fff;
  outline: 2px solid #cfc3e6;
  background: var(--c);
  cursor: pointer;
  transition: transform .1s;
  padding: 0;
}
.swatch:hover { transform: scale(1.1); }
.swatch.active { outline: 3px solid var(--line); transform: scale(1.18); }
.swatch-custom { position: relative; display: grid; place-items: center; font-size: 1.3rem; background: conic-gradient(#ef476f, #ffd166, #06d6a0, #118ab2, #9b5de5, #ef476f); }
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.dialog {
  border: 3px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  width: min(420px, calc(100vw - 32px));
  box-shadow: 6px 6px 0 var(--line);
  color: var(--ink);
}
.dialog::backdrop { background: rgba(61, 44, 94, .45); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.toast {
  pointer-events: none; /* không chặn bé bấm vào bảng màu bên dưới */
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  z-index: 50;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast[hidden] { display: none; }

/* ---------- Chung cho tính năng mới ---------- */
.small { font-size: .85rem; }
.hero-cta { margin-top: 18px; }
.hero-cards { grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mode-card { padding: 20px 16px; }
.mode-card strong { font-size: 1.3rem; }
.mode-3d { background: #e8e0ff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.badge-yellow { background: #fff1c2; }
.badge-purple { background: #eadcff; }
.section-title { font-size: 1.35rem; margin: 32px 0 14px; }
.tag-3d { display: inline-block; font-size: .7rem; font-weight: 900; padding: 1px 7px; border-radius: 6px; background: var(--purple); color: #fff; vertical-align: middle; }
.tag-3d.corner { position: absolute; top: 8px; left: 8px; }
.art-thumb { position: relative; }
.award-ribbon { position: absolute; top: 6px; right: 8px; font-size: 2rem; filter: drop-shadow(1px 2px 0 rgba(0,0,0,.25)); }
.field-label { font-weight: 700; margin: 0 0 6px; }
.lead { font-size: 1.15rem; }

/* Thẻ mẫu tô: link + nút in */
.template-card { position: relative; }
.template-link { display: flex; flex-direction: column; color: inherit; text-decoration: none; flex: 1; }
.template-print {
  position: absolute; top: 8px; right: 8px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; border: 2px solid var(--line);
  text-decoration: none; font-size: 1rem;
  opacity: .85;
}
.template-print:hover { opacity: 1; transform: scale(1.08); }
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.model-thumb { position: relative; background: radial-gradient(circle at 50% 40%, #fff 0, #f3edff 70%); }
.model-emoji { font-size: 4.6rem; filter: drop-shadow(3px 5px 0 rgba(61,44,94,.18)); }
.model-thumb .tag-3d { position: absolute; top: 10px; left: 10px; }

/* Thẻ chọn tab cho bé */
.tabs-kid { display: inline-flex; gap: 6px; background: #fff; border: 3px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.tabs-kid a { padding: 8px 18px; border-radius: 999px; font-weight: 800; text-decoration: none; color: var(--ink); }
.tabs-kid a.active { background: var(--yellow); }

/* ---------- Thả biểu tượng ---------- */
.react-bar { display: flex; gap: 3px; padding: 0 10px 10px; flex-wrap: wrap; }
.react-btn {
  display: inline-flex; align-items: center; gap: 3px;
  font: inherit; font-size: .85rem;
  padding: 2px 6px;
  border-radius: 999px;
  border: 2px solid #eee4d3;
  background: #fff;
  cursor: pointer;
  color: var(--ink);
  transition: transform .15s;
}
.react-btn b { font-size: .78rem; min-width: .5em; }
.react-btn.mine { background: #ffe3ea; border-color: var(--red); }
.react-btn.bump { transform: scale(1.3); }

/* ---------- Triển lãm kiểu bảo tàng ---------- */
.museum-page { background-color: #f7efe2; background-image: linear-gradient(90deg, rgba(150,110,70,.06) 1px, transparent 1px); background-size: 46px 46px; }
.museum .art-card.framed {
  border: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
  align-items: center;
}
.museum .framed .art-thumb {
  width: 100%;
  border: 14px solid #a8743f;
  border-image: linear-gradient(135deg, #c99459, #8a5a2b 40%, #d6a76a 60%, #7c4f22) 1;
  box-shadow: inset 0 0 0 6px #f7ecd7, 0 10px 18px rgba(80, 50, 20, .25);
  background: #fff;
}
.museum .framed .art-thumb img { padding: 6px; }
.museum .framed figcaption {
  margin-top: 10px;
  background: linear-gradient(#f9eccb, #e9d4a3);
  border: 1px solid #b89155;
  border-radius: 4px;
  padding: 6px 12px;
  text-align: center;
  box-shadow: 0 2px 3px rgba(80,50,20,.2);
  min-width: 70%;
}
.museum .framed .react-bar { justify-content: center; padding: 8px 0 4px; flex-wrap: nowrap; }

/* ---------- Xem tranh lớn ---------- */
.lightbox {
  border: 0; padding: 0; background: transparent;
  width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh;
  display: none; align-items: center; justify-content: center; gap: 10px;
}
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: rgba(30, 22, 48, .88); }
.lb-figure { margin: 0; max-width: min(1000px, 86vw); display: flex; flex-direction: column; gap: 10px; }
.lb-img { max-height: 72vh; width: auto; max-width: 100%; margin: 0 auto; background: #fff; border-radius: 12px; border: 6px solid #fff; touch-action: pan-y; }
.lb-figure figcaption { background: #fff; border-radius: 16px; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink); }
.lb-figure .react-bar { padding: 0; }
.lb-links { display: flex; gap: 6px; }
.lb-nav, .lb-close {
  font: inherit; font-size: 2rem; line-height: 1;
  width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid #fff; background: rgba(255,255,255,.15); color: #fff; cursor: pointer; flex: none;
}
.lb-close { position: fixed; top: 16px; right: 16px; font-size: 1.4rem; }
.lb-nav[hidden] { visibility: hidden; display: block; }

/* ---------- Thử thách ---------- */
.challenge-banner {
  display: flex; align-items: center; gap: 18px;
  margin-top: 28px; padding: 18px 22px;
  border-radius: 24px; border: 3px solid var(--line);
  background: linear-gradient(110deg, #fff1c9, #ffe1ec 60%, #e3f6ff);
  box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink);
}
.challenge-banner > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.challenge-banner strong { font-size: 1.3rem; }
.challenge-desc { color: var(--ink-soft); }
.challenge-emoji { font-size: 2.6rem; line-height: 1; }
.challenge-emoji.big { font-size: 4rem; }
.challenge-hero { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 8px; }
.challenge-hero h1, .challenge-hero h2 { margin: 4px 0 8px; }
.challenge-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.challenge-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.challenge-item { display: flex; gap: 12px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.challenge-check span { font-weight: 700; }

/* ---------- Bé đăng nhập bằng hình ---------- */
.kid-login { max-width: 620px; margin: 10px auto; text-align: center; background: var(--card); border: 3px solid var(--line); border-radius: 28px; box-shadow: 6px 6px 0 var(--line); padding: 28px 20px; }
.kid-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; margin: 20px 0; }
.kid-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border-radius: 22px; border: 3px solid var(--line); background: #fff8e6; text-decoration: none; color: var(--ink); font-size: 1.1rem; transition: transform .12s; }
.kid-tile:hover { transform: translateY(-4px) rotate(-2deg); }
.kid-avatar { font-size: 3rem; line-height: 1; display: inline-grid; place-items: center; }
.kid-avatar.big { font-size: 5rem; }
.kid-find { max-width: 360px; margin: 16px auto; text-align: left; }
.kid-entry { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; border: 3px solid var(--line); background: #d9f7f3; text-decoration: none; color: var(--ink); }
.kid-entry-emoji { font-size: 2.4rem; }
.kid-entry > span:nth-child(2) { flex: 1; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); margin: 20px 0 14px; font-size: .9rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 2px dashed #e6d6bb; }

.pin-pad { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pin-slots { display: flex; gap: 10px; }
.pin-slot { width: 58px; height: 58px; border-radius: 16px; border: 3px dashed #cbb9e8; display: grid; place-items: center; font-size: 2rem; background: #fff; }
.pin-slot.filled { border-style: solid; border-color: var(--purple); background: #f3edff; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.pin-key { font-size: 2.3rem; height: 76px; border-radius: 20px; border: 3px solid var(--line); background: #fff; cursor: pointer; box-shadow: 3px 3px 0 var(--line); transition: transform .1s; }
.pin-key.pressed { transform: scale(.9); background: var(--yellow); }
.pin-pad-small .pin-keys { grid-template-columns: repeat(3, 54px); gap: 6px; }
.pin-pad-small .pin-key { height: 54px; font-size: 1.6rem; border-radius: 14px; }
.pin-pad-small .pin-slot { width: 44px; height: 44px; font-size: 1.5rem; }

/* ---------- Gia đình ---------- */
.family-device { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.family-device > div { flex: 1; min-width: 240px; }
.family-device h2 { margin-bottom: 4px; }
.family-device p { margin: 0; }
.family-device > p.small { flex-basis: 100%; }
.kid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-bottom: 20px; }
.kid-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.kid-head { display: flex; align-items: center; gap: 12px; }
.kid-head > div { flex: 1; display: flex; flex-direction: column; }
.kid-card details summary { list-style: none; display: inline-flex; }
.kid-card details summary::-webkit-details-marker { display: none; }
.kid-card details[open] { background: #fbf7ff; border-radius: 14px; padding: 10px; }
.kid-card details .form { margin-top: 10px; }
.add-kid { max-width: 640px; }

/* ---------- Huy hiệu ---------- */
.badge-board { margin-bottom: 24px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 8px; border-radius: 18px; border: 2px dashed #ddd2c0; background: #faf6ee; opacity: .7; }
.badge-item.earned { opacity: 1; border: 2px solid var(--line); background: linear-gradient(#fff8dc, #ffeec2); box-shadow: 2px 2px 0 var(--line); }
.badge-emoji { font-size: 2.2rem; }
.stats-line { margin: 14px 0 0; }
.badge-pop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(61,44,94,.5); padding: 16px; }
.badge-pop-card { background: #fff; border: 4px solid var(--line); border-radius: 28px; box-shadow: 6px 6px 0 var(--line); padding: 26px 30px; text-align: center; max-width: 340px; animation: pop-in .4s cubic-bezier(.2,1.6,.4,1); }
.badge-pop-emoji { font-size: 5rem; line-height: 1.1; }
.badge-pop-title { margin: 6px 0 0; color: var(--ink-soft); font-weight: 700; }
.badge-pop-card strong { font-size: 1.5rem; display: block; }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; }

/* ---------- Hướng dẫn (bác Cú) ---------- */
.tour { position: fixed; left: 0; right: 0; bottom: 16px; z-index: 60; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.tour-card { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; max-width: 560px; width: 100%; background: #fff; border: 3px solid var(--line); border-radius: 24px; box-shadow: 6px 6px 0 var(--line); padding: 14px 16px; animation: pop-in .35s ease-out; }
.tour.tour-top { bottom: auto; top: 16px; }
.tour-mascot { font-size: 3rem; line-height: 1; animation: bob 1.6s ease-in-out infinite; }
.tour-body { flex: 1; }
.tour-text { margin: 0 0 10px; font-size: 1.05rem; font-weight: 600; }
.tour-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tour-count { flex: 1; color: var(--ink-soft); font-size: .85rem; text-align: right; }
.tour-voice { font: inherit; font-size: .85rem; font-weight: 700; border: 2px solid #d9cdf2; background: #f3edff; border-radius: 999px; padding: 4px 10px; cursor: pointer; color: var(--ink); }
.tour-focus { outline: 4px solid var(--yellow) !important; outline-offset: 4px; position: relative; z-index: 55; animation: pulse 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes pulse { 50% { outline-color: var(--primary); } }

/* ---------- Xưởng vẽ: thêm ---------- */
.studio-body { grid-template-columns: 180px 1fr; }
.tools { grid-template-columns: 1fr 1fr; gap: 6px; }
.tool { flex-direction: column; gap: 0; padding: 6px 4px; font-size: 1.45rem; }
.tool span { font-size: .72rem; }
.mini-label { grid-column: 1 / -1; font-weight: 800; font-size: .85rem; text-align: center; }
.patterns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.patterns[hidden], .size-box[hidden] { display: none; }
.pattern { height: 40px; border-radius: 10px; border: 2px solid #e2d7f5; background: #fff; cursor: pointer; font-size: 1.1rem; display: grid; place-items: center; padding: 0; }
.pattern.active { border-color: var(--line); background: #fff1c9; }
.pat { display: block; width: 26px; height: 26px; border-radius: 6px; border: 1px solid #ccc; }
.pat-solid { background: var(--primary); }
.pat-dots { background: radial-gradient(circle, #ffc2c2 3px, var(--primary) 3.5px) 0 0 / 9px 9px; }
.pat-stripes { background: repeating-linear-gradient(45deg, var(--primary) 0 4px, #ffc2c2 4px 7px); }
.pat-checks { background: conic-gradient(var(--primary) 25%, #ffc2c2 0 50%, var(--primary) 0 75%, #ffc2c2 0) 0 0 / 12px 12px; }
.stage { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#numbers { pointer-events: none; }
.canvas-wrap .stage + .canvas-loading { z-index: 2; }
.canvas-wrap[data-tool="pan"], .canvas-wrap.zoomed[data-tool="pan"] { cursor: grab; }
.zoom-box { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.zoom-box .icon-btn { font-size: 1.1rem; padding: 4px 10px; flex-direction: row; gap: 4px; }
.zoom-box .icon-btn span { font-size: .78rem; }
.icon-btn.active { background: var(--yellow); }
.zoom-label { font: inherit; font-weight: 800; min-width: 64px; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px 8px; cursor: pointer; color: var(--ink); }
.pbn-status { position: absolute; top: 10px; left: 10px; z-index: 3; background: var(--ink); color: #fff; border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: .9rem; }
.pbn-status[hidden] { display: none; }
.pbn-on .swatch[data-num] { position: relative; }
.pbn-on .swatch[data-num]::after {
  content: attr(data-num);
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-weight: 900; font-size: 1.05rem; color: var(--ink);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}
.pbn-on .swatch:not([data-num]) { opacity: .35; order: 20; }
/* Khi tô theo số: xếp các màu có số theo thứ tự 1 → 8 */
.pbn-on .swatch[data-num="1"] { order: 1; }
.pbn-on .swatch[data-num="2"] { order: 2; }
.pbn-on .swatch[data-num="3"] { order: 3; }
.pbn-on .swatch[data-num="4"] { order: 4; }
.pbn-on .swatch[data-num="5"] { order: 5; }
.pbn-on .swatch[data-num="6"] { order: 6; }
.pbn-on .swatch[data-num="7"] { order: 7; }
.pbn-on .swatch[data-num="8"] { order: 8; }
.autosave-note { font-size: .8rem; color: var(--green); font-weight: 800; opacity: 0; transition: opacity .3s; }
.autosave-note.show { opacity: 1; }
a.icon-btn { text-decoration: none; }

/* Toàn màn hình */
.studio-full .site-header, .studio-full .site-footer { display: none; }
.studio-full .container { max-width: none; padding: 8px 12px; }
.studio-full .canvas-wrap { max-width: calc((100vh - 190px) * 4 / 3); }
.studio-full .studio { gap: 8px; }

/* Tượng 3D */
.statue .canvas-area { display: flex; flex-direction: column; }
.viewport-3d {
  position: relative;
  width: 100%;
  max-width: calc((100vh - 260px) * 4 / 3);
  min-width: 280px;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  border: 4px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff8ec;
  box-shadow: 6px 6px 0 var(--line);
  touch-action: none;
  cursor: grab;
}
.viewport-3d canvas { display: block; width: 100% !important; height: 100% !important; }
.part-label { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: var(--ink); color: #fff; font-weight: 800; padding: 4px 14px; border-radius: 999px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.part-label.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .studio-actions .icon-btn span { display: none; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .studio-body { grid-template-columns: minmax(0, 1fr); }
  .toolbox { min-width: 0; }
  .toolbox { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px; gap: 8px; }
  .tools { display: flex; overflow-x: auto; width: 100%; gap: 6px; padding-bottom: 2px; }
  .tool { flex: 0 0 auto; min-width: 64px; padding: 4px 6px; font-size: 1.3rem; }
  .tool span { font-size: .66rem; }
  .size-box { flex-direction: row; flex: 1; min-width: 160px; }
  .patterns { display: flex; width: 100%; align-items: center; }
  .patterns .mini-label { flex: none; }
  .pattern { width: 44px; }
  .stamps { grid-template-columns: repeat(8, 1fr); width: 100%; }
  .canvas-wrap, .viewport-3d { max-width: none; }
  .studio-full .canvas-wrap { max-width: calc((100vh - 300px) * 4 / 3); }
  .challenge-banner { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .site-header { padding: 10px 16px; gap: 8px; position: static; }
  .logo-text { display: none; }
  .hide-sm { display: none; }
  .main-nav { order: 3; flex: 1 1 100%; justify-content: space-between; }
  .main-nav a { padding: 6px 4px; font-size: .78rem; flex-direction: column; gap: 0; }
  .user-area { margin-left: auto; gap: 6px; }
  .user-name { display: none; }
  .hero-cards { grid-template-columns: 1fr; }
  .mode-card { flex-direction: row; align-items: center; gap: 12px; padding: 14px; }
  .mode-card .mode-emoji { font-size: 2.6rem; }
  .mode-card span:last-child { display: none; }
  .template-grid, .art-grid, .model-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .swatch { width: 34px; height: 34px; }
  .studio-top { gap: 8px; }
  .studio-title { font-size: 1.1rem; min-width: 0; flex-basis: calc(100% - 90px); }
  .back-btn span { display: none; }
  .icon-btn { padding: 4px 8px; }
  .pin-keys { grid-template-columns: repeat(3, 68px); }
  .pin-key { height: 68px; }
  .lb-nav { display: none; }
  .lb-figure { max-width: 94vw; }
  .museum .framed .art-thumb { border-width: 9px; }
  .challenge-hero { flex-direction: column; gap: 6px; }
  .tour-mascot { font-size: 2.2rem; }
}

/* ---------- Bảng màu vui: tên màu, đố màu, pha màu ---------- */
.palette-extras { display: flex; gap: 6px; align-items: center; padding-left: 8px; margin-left: 4px; border-left: 2px dashed #e6d6bb; }
.pal-btn { display: flex; flex-direction: column; align-items: center; font: inherit; font-size: 1.15rem; line-height: 1.1; background: #f7f2ff; border: 2px solid transparent; border-radius: 12px; padding: 4px 8px; cursor: pointer; color: var(--ink); }
.pal-btn span { font-size: .66rem; font-weight: 800; }
.pal-btn.active { background: var(--yellow); border-color: var(--line); }
.swatch-mixed { position: relative; }
.swatch-mixed::after { content: "🧪"; position: absolute; right: -6px; bottom: -6px; font-size: .7rem; }
.mixer { width: min(460px, calc(100vw - 32px)); }
.mixer-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0; }
.mixer-drops { display: flex; gap: 8px; }
.mixer-drop { width: 34px; height: 44px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; border: 2px dashed #cfc3e6; background: var(--c); }
.mixer-drop.filled { border: 2px solid var(--line); }
.mixer-bowl { width: 110px; height: 70px; border-radius: 0 0 60px 60px; border: 4px solid var(--line); border-top-width: 6px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.mixer-result { width: 100%; height: 100%; transition: background .3s; }
.mixer-name { text-align: center; font-weight: 800; min-height: 1.5em; margin: 0 0 8px; }
.mixer-base { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 14px; }
.mixer-base .swatch { width: 34px; height: 34px; }

/* ---------- Vẽ đối xứng ---------- */
.tool-toggle { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 6px; background: #fff1f6; }
.tool-toggle.active { background: #e8dcff; border-color: var(--line); }
#guides { pointer-events: none; }

/* ---------- Tranh chuyển động ---------- */
.motion-dialog { width: min(760px, calc(100vw - 24px)); }
.motion-modes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.motion-modes .chip { font: inherit; font-weight: 700; cursor: pointer; }
.motion-canvas { width: 100%; height: auto; aspect-ratio: 4 / 3; border: 3px solid var(--line); border-radius: 14px; background: #fff; display: block; }
.motion-note { min-height: 1.4em; margin: 6px 0 10px; }

/* ---------- Mẫu tô từ ảnh ---------- */
.make-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 18px; border-radius: 22px; border: 3px solid var(--line); background: linear-gradient(110deg, #e3f6ff, #fff1c9); box-shadow: var(--shadow); }
.make-banner > span:nth-child(2) { flex: 1; min-width: 200px; }
.make-banner-emoji { font-size: 2.4rem; }
.make-tpl { display: grid; gap: 18px; margin-bottom: 10px; }
.make-step h2 { font-size: 1.2rem; }
.make-step[hidden] { display: none; }
.make-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.make-pick label { cursor: pointer; }
.make-preview { position: relative; border: 3px solid var(--line); border-radius: 16px; overflow: hidden; max-width: 760px; }
.make-preview canvas { display: block; width: 100%; height: auto; }
.make-controls { margin-top: 14px; max-width: 520px; }
.make-controls input[type=range] { accent-color: var(--purple); }
.tabs-kid button { font: inherit; padding: 8px 16px; border-radius: 999px; font-weight: 800; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.tabs-kid button.active { background: var(--yellow); }
.template-del { position: absolute; top: 8px; right: 8px; margin: 0; }
.template-del button { width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 2px solid var(--line); cursor: pointer; font-size: 1rem; }

/* ---------- Lời khen ghi âm ---------- */
.voice-play { margin: 0 12px 10px; align-self: flex-start; font: inherit; font-weight: 800; font-size: .85rem; padding: 4px 12px; border-radius: 999px; border: 2px solid var(--line); background: #fff1f6; cursor: pointer; color: var(--ink); }
.voice-play.active, .voice-box .active { background: var(--yellow); }
.voice-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 12px 12px; }
.voice-box:empty { display: none; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: pulse-dot 1s ease-in-out infinite; }
.rec-time { font-weight: 800; font-variant-numeric: tabular-nums; }
@keyframes pulse-dot { 50% { opacity: .3; } }

/* ---------- Gia đình: thêm ---------- */
.family-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.waiting-box { margin-bottom: 20px; }
.waiting-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.waiting-item { margin: 0; border: 2px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.waiting-item img { aspect-ratio: 4 / 3; object-fit: contain; width: 100%; border-bottom: 2px dashed #e6d6bb; }
.waiting-item figcaption { padding: 8px 12px; display: flex; flex-direction: column; }
.waiting-item .art-actions { padding: 0 10px 10px; }
.form-row-inline { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row-inline label { flex: 1; min-width: 120px; }
.art-card.reported { opacity: .4; }
.center-actions { justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* Bản tin tuần */
.report-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.report-pager { margin: 0; flex-wrap: wrap; }
.report-card { margin-bottom: 22px; display: flex; flex-direction: column; gap: 14px; }
.report-card h3 { font-size: 1rem; margin: 6px 0 8px; }
.report-name { font-size: 1.3rem; }
.report-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.report-stats > div { background: #fbf7ff; border-radius: 16px; padding: 10px 14px; display: flex; flex-direction: column; }
.report-stats strong { font-size: 1.8rem; line-height: 1.1; }
.report-stats span { font-size: .85rem; color: var(--ink-soft); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.week-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; }
.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; min-width: 0; }
.week-bar { width: 100%; max-width: 34px; min-height: 3px; background: var(--secondary); border-radius: 8px 8px 2px 2px; }
.week-val { font-size: .75rem; font-weight: 800; }
.week-label { font-size: .75rem; color: var(--ink-soft); white-space: nowrap; }
.report-colors { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.report-color { width: 38px; height: 38px; border-radius: 50%; background: var(--c); border: 3px solid #fff; outline: 2px solid #cfc3e6; }
.report-badges { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.report-badges li { background: linear-gradient(#fff8dc, #ffeec2); border: 2px solid var(--line); border-radius: 999px; padding: 2px 12px; font-weight: 700; }
.report-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.report-thumbs img { aspect-ratio: 4 / 3; object-fit: contain; width: 100%; background: #fff; border: 2px solid #e6d6bb; border-radius: 10px; }

/* Sách tranh */
.book-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 18px; padding: 16px; position: sticky; top: 76px; z-index: 5; }
.book-title { display: flex; flex-direction: column; gap: 4px; font-weight: 700; flex: 1; min-width: 220px; }
.book-title input { font: inherit; padding: 9px 12px; border: 2px solid var(--line); border-radius: 12px; }
.book-years { margin: 0; }
.book-years .chip { font: inherit; font-weight: 700; cursor: pointer; }
.book-count { font-weight: 800; }
.book-count.over { color: var(--red); }
.book-pick { position: relative; display: flex; flex-direction: column; background: #fff; border: 3px solid #e6d6bb; border-radius: 16px; overflow: hidden; cursor: pointer; }
.book-pick:has(input:checked) { border-color: var(--purple); box-shadow: 3px 3px 0 var(--purple); }
.book-pick input { position: absolute; top: 10px; left: 10px; width: 22px; height: 22px; accent-color: var(--purple); }
.book-pick img { aspect-ratio: 4 / 3; object-fit: contain; width: 100%; }
.book-pick > span { padding: 8px 12px; display: flex; flex-direction: column; }

@media (max-width: 860px) {
  .palette-extras { border-left: 0; margin-left: 0; padding-left: 0; width: 100%; justify-content: center; }
  .tool-toggle { flex: 0 0 auto; min-width: 90px; }
  .book-bar { position: static; }
}

/* ---------- Trang tranh tô màu (SEO) ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; color: var(--ink-soft); margin-bottom: 14px; }
.breadcrumb a { color: var(--ink-soft); font-weight: 700; }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 800; }
.breadcrumb .sep { opacity: .6; }
.cp { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.cp-media { padding: 14px; }
.cp-media img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; }
.cp-info h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin-top: 0; }
.cp-facts { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 8px; }
.cp-facts li { display: flex; gap: 12px; align-items: baseline; padding: 8px 14px; background: #fbf7ff; border-radius: 14px; }
.cp-facts span { min-width: 96px; color: var(--ink-soft); font-size: .9rem; }
.cp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cp-tips ol, .seo-about ul { padding-left: 1.3em; line-height: 1.7; }
.cp-tips h2, .seo-about h2 { margin-top: 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 10px; font-size: .9rem; }
.footer-links a { color: var(--ink-soft); font-weight: 700; }
@media (max-width: 760px) {
  .cp { grid-template-columns: 1fr; gap: 18px; }
}

/* ---------- Bài viết cho bố mẹ, thầy cô ---------- */
.article { max-width: 780px; margin: 0 auto; }
.article-head h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.25; margin-bottom: 6px; }
.article-meta { margin-top: 0; font-size: .95rem; }
.article-hero { display: block; width: 100%; height: auto; border-radius: var(--radius); margin: 16px 0; }
.article-toc { margin: 20px 0; padding: 16px 22px; }
.article-toc ol { margin: 8px 0 0; padding-left: 1.3em; line-height: 1.8; }
.article-body { font-size: 1.08rem; line-height: 1.8; }
.article-body h2 { font-size: 1.45rem; margin: 36px 0 12px; scroll-margin-top: 90px; }
.article-body h3 { font-size: 1.2rem; margin: 26px 0 10px; }
.article-body h4 { font-size: 1.05rem; }
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body li { margin: 4px 0; }
.article-body blockquote { margin: 18px 0; padding: 10px 18px; border-left: 5px solid var(--purple); background: #fbf7ff; border-radius: 0 14px 14px 0; }
.article-body hr { border: 0; border-top: 2px dashed #e6dcf5; margin: 28px 0; }
.table-wrap { overflow-x: auto; margin: 18px 0; }
.article-body table { border-collapse: collapse; min-width: 100%; font-size: .97rem; line-height: 1.5; }
.article-body th, .article-body td { border: 2px solid #e6dcf5; padding: 8px 12px; text-align: left; vertical-align: top; }
.article-body th { background: #fbf7ff; }
.article-faq { margin-top: 36px; }
.article-faq details { border: 2px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 10px 0; background: var(--card); }
.article-faq summary { font-weight: 800; cursor: pointer; }
.article-faq details p { margin: 10px 0 0; line-height: 1.7; }
.article-cta { max-width: 780px; margin-left: auto; margin-right: auto; }
.article-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.article-item { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.article-item > a { font-weight: 800; font-size: 1.05rem; }
.article-item p { margin: 6px 0; font-size: .95rem; color: var(--ink-soft); line-height: 1.5; }
.article-item.is-pillar { border-color: var(--purple); }
