/* KidsArt: the classroom wall of Star Education, online.
   Signature: artworks hang on a wire grid with binder clips, like the real studio wall. */
:root {
  --paper: #FBF6EC;
  --paper-2: #F3EBDD;
  --ink: #2B2320;
  --ink-2: #6B5E55;
  --crayon: #D9402A;
  --crayon-2: #B8321F;
  --sky: #2F6FDE;
  --sun: #F4B62A;
  --leaf: #3C9A5F;
  --wire: #D8CFC1;
  --card: #FFFFFF;
  --line: #E6DCCB;
  --shadow: 0 1px 2px rgba(43, 35, 32, .08), 0 8px 24px rgba(43, 35, 32, .10);
  --radius: 14px;
  --display: "Baloo 2", "Be Vietnam Pro", system-ui, 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%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--body); }
img { max-width: 100%; display: block; }
a { color: var(--sky); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); 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 16px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(251, 246, 236, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--crayon); display: grid; place-items: center; color: #fff; font: 800 18px/1 var(--display); transform: rotate(-4deg); }
.brand-name { font: 700 15px/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }

/* ---------- hero ---------- */
.hero { padding: 28px 0 8px; }
.hero h1 { font: 800 clamp(28px, 6vw, 46px)/1.08 var(--display); margin: 0 0 10px; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--crayon); }
.hero p { margin: 0; color: var(--ink-2); max-width: 60ch; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; }
.stat b { font: 800 26px/1 var(--display); display: block; }
.stat span { font-size: 13px; color: var(--ink-2); }

/* ---------- filters ---------- */
.filters { position: sticky; top: 58px; z-index: 10; background: var(--paper); padding: 12px 0 10px; }
.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: 999px; padding: 7px 14px; font-weight: 600; font-size: 14px; cursor: pointer; }
.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; }
.chip[aria-pressed="true"] small { color: #D9CFC4; }
.select { border: 1.5px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 10px; }

/* ---------- the wall ---------- */
.wall {
  --cell: 26px;
  background-color: #F1E9DB;
  background-image:
    linear-gradient(var(--wire) 1.5px, transparent 1.5px),
    linear-gradient(90deg, var(--wire) 1.5px, transparent 1.5px);
  background-size: var(--cell) var(--cell);
  border-radius: 18px;
  padding: 26px 14px 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 30px 16px;
  margin-bottom: 40px;
}
@media (min-width: 720px) { .wall { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); padding: 34px 26px 40px; gap: 38px 26px; } }
.art { position: relative; background: var(--card); padding: 8px 8px 10px; box-shadow: var(--shadow); transform: rotate(var(--tilt, 0deg)); transition: transform .2s ease; cursor: pointer; border: 0; text-align: left; width: 100%; }
.art:hover { transform: rotate(0deg) translateY(-3px); }
.art::before { /* binder clip */
  content: ""; position: absolute; top: -12px; left: 50%; width: 30px; height: 18px; margin-left: -15px;
  background: linear-gradient(#3A3330, #1F1A18); border-radius: 3px 3px 5px 5px; box-shadow: 0 2px 3px rgba(0, 0, 0, .25);
}
.art::after { content: ""; position: absolute; top: -20px; left: 50%; width: 20px; height: 12px; margin-left: -10px; border: 2px solid #8C8580; border-bottom: 0; border-radius: 8px 8px 0 0; }
.art .ph { aspect-ratio: 3 / 4; background: var(--paper-2); overflow: hidden; }
.art .ph img { width: 100%; height: 100%; object-fit: cover; }
.art .meta { padding: 8px 2px 0; }
.art .t { font: 700 15px/1.25 var(--display); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art .s { font-size: 13px; color: var(--ink-2); margin: 2px 0 0; }
.art .likes { position: absolute; right: 12px; bottom: 58px; background: rgba(255, 255, 255, .92); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; color: var(--crayon); }
.empty { text-align: center; padding: 48px 16px; color: var(--ink-2); grid-column: 1 / -1; }
.empty b { display: block; font: 700 18px var(--display); color: var(--ink); margin-bottom: 4px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 12px; border: 0; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--crayon); color: #fff; }
.btn-primary:hover { background: var(--crayon-2); }
.btn-sky { background: var(--sky); color: #fff; }
.btn-ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row .btn { flex: 1 1 140px; }

/* ---------- sheet (bottom sheet on phones, dialog on desktop) ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(28, 22, 20, .55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-width: 720px; max-height: 94vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 18px 16px 24px; animation: up .22s ease; }
@media (min-width: 760px) { .sheet-bg { align-items: center; } .sheet { border-radius: 20px; padding: 24px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } .art, .art:hover { transition: none; } }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.sheet-head h2 { font: 800 21px/1.2 var(--display); margin: 0; flex: 1; }
.x { border: 0; background: var(--paper-2); width: 38px; height: 38px; border-radius: 999px; font-size: 20px; cursor: pointer; flex: none; }
.viewer img { width: 100%; max-height: 62vh; object-fit: contain; background: #fff; border-radius: 10px; }
.viewer .who { margin: 12px 0 4px; font-weight: 700; }
.viewer .comment { background: var(--card); border-left: 4px solid var(--sun); padding: 10px 12px; border-radius: 0 10px 10px 0; margin: 10px 0 14px; font-size: 14.5px; }
.badge { display: inline-block; background: #FFF1CC; color: #7A5300; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; }
.muted { color: var(--ink-2); font-size: 13.5px; }
.cert-preview { width: 100%; border-radius: 8px; box-shadow: var(--shadow); background: #fff; }
.hint { background: #EAF1FF; color: #1C3F85; padding: 10px 12px; border-radius: 10px; font-size: 14px; margin: 10px 0; }

/* keepsake */
.products { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.product { border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px; text-align: left; cursor: pointer; }
.product[aria-pressed="true"] { border-color: var(--crayon); box-shadow: 0 0 0 3px rgba(217, 64, 42, .15); }
.product canvas { width: 100%; height: auto; border-radius: 8px; background: var(--paper-2); }
.product b { display: block; font-size: 14px; margin-top: 6px; line-height: 1.3; }
.product .price { color: var(--crayon); font-weight: 800; }
.q { font-size: 12px; font-weight: 700; margin-top: 4px; }
.q.ok { color: var(--leaf); }
.q.warn { color: #9A6200; }

/* forms */
.form { display: grid; gap: 12px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
.field textarea { min-height: 80px; resize: vertical; }
.field small { color: var(--ink-2); }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }
.error { color: var(--crayon-2); font-weight: 600; font-size: 14px; }
.success { background: #E7F5EC; border: 1.5px solid #B8E0C6; border-radius: 12px; padding: 14px; }
.code { font: 800 22px/1.2 var(--display); letter-spacing: .03em; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 80; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

/* album header */
.kid { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-top: 18px; }
.kid .avatar { width: 64px; height: 64px; border-radius: 16px; background: var(--sun); display: grid; place-items: center; font: 800 28px var(--display); color: var(--ink); flex: none; transform: rotate(-3deg); overflow: hidden; }
.kid .avatar img { width: 100%; height: 100%; object-fit: cover; }
.kid h1 { font: 800 24px/1.15 var(--display); margin: 0; }
.stars { font-weight: 800; color: #9A6200; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 22px 0 36px; color: var(--ink-2); font-size: 13px; }
.foot a { color: var(--ink-2); }

/* ---------- english corner ---------- */
.phrases { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin: 16px 0 28px; }
.phrase { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); position: relative; }
.phrase.done { outline: 2.5px solid var(--leaf); }
.phrase .en { font: 700 21px/1.25 var(--display); margin: 0 0 2px; }
.phrase .vi { color: var(--ink-2); margin: 0 0 12px; font-size: 14px; }
.phrase .lvl { position: absolute; top: 12px; right: 12px; font-size: 12px; font-weight: 700; color: #9A6200; }
.heard { margin-top: 10px; font-size: 14px; }
.score { font: 800 30px/1 var(--display); }
.score.pass { color: var(--leaf); }
.score.fail { color: var(--crayon); }
.board { background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.board ol { margin: 0; padding-left: 22px; }
.board li { padding: 4px 0; }
.two { display: grid; gap: 16px; }
@media (min-width: 820px) { .two { grid-template-columns: 1fr 1fr; } }

/* ---------- admin ---------- */
.admin-shell { padding-bottom: 60px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; position: sticky; top: 58px; background: var(--paper); z-index: 10; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; background: var(--card); border-radius: 999px; padding: 9px 14px; font-weight: 700; cursor: pointer; box-shadow: 0 0 0 1.5px var(--line) inset; }
.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: 999px; background: var(--crayon); color: #fff; font-size: 12px; margin-left: 4px; }
.panel { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.panel h2 { font: 800 19px/1.2 var(--display); margin: 0 0 12px; }
.panel h3 { font: 700 16px/1.2 var(--display); margin: 16px 0 8px; }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
@media (min-width: 820px) { .kpis { grid-template-columns: repeat(6, 1fr); } }
.kpi { background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.kpi b { font: 800 26px/1.1 var(--display); display: block; }
.kpi span { font-size: 12.5px; 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: 10.5px; 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: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--leaf); border-radius: 999px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: 12.5px; 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: 10px; }
.row { display: flex; gap: 12px; align-items: flex-start; background: var(--paper); border-radius: 12px; padding: 10px; }
.row .thumb { width: 64px; height: 80px; object-fit: cover; border-radius: 8px; flex: none; background: var(--paper-2); }
.row .body { flex: 1; min-width: 0; }
.row .body b { display: block; }
.row .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); margin-right: 4px; }
.tag.ok { background: #E7F5EC; color: #226B3E; }
.tag.warn { background: #FFF1CC; color: #7A5300; }
.tag.off { background: #F4E1DD; color: #8A2A1B; }
.art-admin { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.art-admin .card { background: var(--paper); border-radius: 12px; overflow: hidden; }
.art-admin img { aspect-ratio: 3/4; object-fit: cover; width: 100%; }
.art-admin .card .body { padding: 8px 10px 10px; font-size: 13.5px; }
.art-admin .card.hidden img { opacity: .4; }
.uploads { display: grid; gap: 10px; }
.up { display: flex; gap: 10px; align-items: center; background: var(--paper); border-radius: 10px; padding: 8px; }
.up img { width: 56px; height: 70px; object-fit: cover; border-radius: 6px; }
.up input { flex: 1; }
.up .st { font-size: 12.5px; font-weight: 700; min-width: 60px; text-align: right; }
.login { max-width: 380px; margin: 60px auto; }

/* ---------- art-supply shop ---------- */
.shop { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 12px 0 24px; }
.supply { display: flex; gap: 12px; background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); border: 2px solid transparent; }
.supply.picked { border-color: var(--crayon); }
.supply .pic { width: 96px; height: 96px; flex: none; border-radius: 10px; 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 16px/1.3 var(--display); margin: 0 0 2px; }
.supply .muted { margin: 0 0 6px; }
.supply .buy { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.supply .price { color: var(--crayon); font-weight: 800; }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.stepper button { width: 40px; height: 38px; border: 0; background: var(--paper); font-size: 20px; font-weight: 700; cursor: pointer; }
.stepper output { min-width: 30px; text-align: center; font-weight: 800; }
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(43, 35, 32, .08); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); }
.cartbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cartbar b { font: 800 20px var(--display); }
@media (max-width: 440px) { .brand-name { display: none; } .nav a { padding: 8px 10px; } }
@media (max-width: 819px) { .kpi.wide { grid-column: span 2; } }
@media (min-width: 820px) { .kpis { grid-template-columns: repeat(7, 1fr); } }
.supply.soldout { opacity: .6; }

/* ---------- site pages: home (parents) and /truong-hoc (schools) ---------- */
.home-hero h1 { max-width: 16ch; }
.home-hero p { max-width: 62ch; }
.section-h { font: 800 22px/1.2 var(--display); margin: 26px 0 14px; }
.mini-wall { margin-bottom: 8px; }
.mini-wall .art { text-decoration: none; color: inherit; display: block; }
.features { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border-top: 4px solid var(--sun); }
.feature:nth-child(2) { border-top-color: var(--crayon); }
.feature:nth-child(3) { border-top-color: var(--sky); }
.feature h3 { font: 700 17px/1.3 var(--display); margin: 0 0 6px; }
.feature p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.lead { margin: 28px 0 40px; border: 2px solid var(--crayon); }
.doc .tbl th[scope="row"] { width: 38%; color: var(--ink); font-size: 14px; }
.doc ul { margin: 0; padding-left: 20px; }
.doc li { padding: 3px 0; }
@media print {
  .topbar, .foot, .no-print { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
