/* ฉันจะเก่ง — ธีมผึ้ง 🐝 */
:root {
  --bg: #fff8e6;
  --card: #ffffff;
  --ink: #3a2315;
  --ink-2: #5e4433;
  --muted: #8a7566;
  --line: #f1e3bf;
  --honey: #ffc61f;
  --honey-2: #f0a500;
  --honey-soft: #fff1c2;
  --blue: #2f6fde;
  --good: #16a37f;
  --mid: #d98a0b;
  --low: #c2413a;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(58,35,21,.05), 0 6px 18px rgba(58,35,21,.07);
  --tabs-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); min-height: 100vh; display: flex; flex-direction: column;
  font: 400 16px/1.6 "Sarabun", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64v33' fill='none' stroke='%23f6e3b0' stroke-width='1.2'/%3E%3C/svg%3E");
}
h1, h2, h3, .brand, .btn, .app-name, .eyebrow, .big-num, .stats b, .score, .sum-3 b, .timer, .section-title {
  font-family: "Kanit", "Sarabun", system-ui, sans-serif;
}
h1 { font-size: 1.85rem; line-height: 1.25; margin: 0; font-weight: 700; }
h2 { font-size: 1.12rem; margin: 0 0 .7rem; font-weight: 500; }
a { color: var(--blue); }
code { background: var(--honey-soft); padding: 1px 6px; border-radius: 6px; font-size: .88em; word-break: break-all; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 640px; }
main.wrap { padding-top: 24px; padding-bottom: 40px; flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.good-text { color: var(--good); } .low-text { color: var(--low); } .danger-text { color: var(--low) !important; }
.plus { color: var(--good); } .minus { color: var(--low); }

/* ---------- top bar + tabs ---------- */
.topbar { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar-in { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 1.2rem; font-weight: 700; margin-right: auto; }
.brand svg { width: 36px; height: 36px; }
.tabs { display: flex; gap: 2px; }
.tabs a { color: #ecdcc8; text-decoration: none; padding: 7px 11px; border-radius: 11px; font-size: .95rem; display: flex; gap: 6px; align-items: center; }
.tabs a:hover { background: rgba(255,255,255,.08); color: #fff; }
.tabs a.on { background: var(--honey); color: var(--ink); }
.tabs .ti { font-size: 1rem; }
.who { display: flex; align-items: center; gap: 8px; color: #ecdcc8; text-decoration: none; padding: 4px 6px; border-radius: 12px; }
.who.on, .who:hover { background: rgba(255,255,255,.1); color: #fff; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--honey); color: var(--ink); display: grid; place-items: center; font-family: "Kanit"; font-weight: 500; }
form.inline { display: inline; margin: 0; }

/* ---------- cards / forms ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.card-head a { text-decoration: none; }
.card.highlight { border: 2px solid var(--honey); }
label { display: block; font-size: .9rem; color: var(--ink-2); margin-bottom: 14px; }
input, select {
  display: block; width: 100%; margin-top: 6px; padding: 11px 13px; font: inherit; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 12px; background: #fffdf6;
}
input[type=file] { padding: 9px; background: #fff; }
input:focus, select:focus { outline: none; border-color: var(--honey-2); box-shadow: 0 0 0 3px rgba(255,198,31,.3); }
label.check { display: flex; gap: 10px; align-items: center; }
label.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--honey-2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.row-form { display: flex; gap: 10px; }
.row-form input { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
  color: var(--ink); text-decoration: none; font-size: .95rem; cursor: pointer; white-space: nowrap; font-weight: 500;
}
.btn:hover { border-color: #e2c98a; }
.btn.primary { background: var(--honey); border-color: var(--honey); color: var(--ink); }
.btn.primary:hover { background: #ffb800; }
.btn.danger { color: var(--low); border-color: #efc9c5; }
.btn.small { padding: 5px 12px; font-size: .86rem; border-radius: 10px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--blue); }
.btn.block { width: 100%; padding: 13px; font-size: 1.05rem; }
.btn.big { padding: 16px 10px; font-size: 1.1rem; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.alert { padding: 11px 15px; border-radius: 12px; margin-bottom: 14px; font-size: .95rem; }
.alert.ok { background: #e3f6ef; color: #0d6b52; }
.alert.err { background: #fdeceb; color: #9a2c25; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; background: #f3ece0; color: var(--ink-2); }
.badge.role-admin { background: var(--ink); color: #fff; }
.badge.role-parent { background: #e6efff; color: #1f4fa8; }
.badge.role-student { background: var(--honey-soft); color: #7a4b00; }
.honey-pill { display: inline-flex; gap: 4px; align-items: center; padding: 4px 12px; border-radius: 999px; background: var(--honey); font-family: "Kanit"; font-weight: 500; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: var(--honey-soft); font-size: .85rem; margin-left: 6px; }

/* segmented radio */
.seg { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.seg label { margin: 0; flex: 1; min-width: 64px; position: relative; }
.seg input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 9px 8px; border-radius: 12px; border: 1.5px solid var(--line); background: #fffdf6; font-size: .9rem; color: var(--ink); cursor: pointer; }
.seg input:checked + span { background: var(--honey); border-color: var(--honey); font-weight: 600; }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(255,198,31,.4); }

/* ---------- login hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; padding-top: 56px !important; }
.eyebrow { color: #9a6400; margin: 0 0 4px; font-size: .95rem; font-weight: 500; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1.1; font-weight: 800; }
.hero h1::after { content: ""; display: block; width: 72px; height: 7px; border-radius: 6px; background: var(--honey); margin-top: 14px; }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 30em; }
.chips { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .92rem; box-shadow: inset 3px 0 0 var(--c); }
.login-card { padding: 26px; }
.login-card h2 { font-size: 1.4rem; }

/* ---------- home ---------- */
.welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-title { font-size: 1.05rem; font-weight: 500; margin: 6px 0 10px; color: var(--ink-2); }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 22px; }
.app {
  position: relative; display: flex; flex-direction: column; gap: 3px; padding: 16px 16px 18px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.app::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.app:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(58,35,21,.12); }
.app-icon {
  width: 48px; height: 48px; display: grid; place-items: center; font-size: 1.45rem; margin-bottom: 8px;
  background: color-mix(in srgb, var(--c) 16%, #fff);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.app-name { font-size: 1.05rem; font-weight: 500; }
.app-desc { font-size: .86rem; color: var(--muted); line-height: 1.45; }
.app .go { position: absolute; right: 16px; top: 22px; color: var(--c); font-size: 1.2rem; }
.app.soon { opacity: .55; pointer-events: none; }
.app .tag { position: absolute; right: 12px; top: 18px; font-size: .75rem; background: #f3ece0; color: var(--muted); padding: 2px 8px; border-radius: 999px; }
.kid-strip { margin-bottom: 16px; }
.strip { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: var(--radius); background: var(--ink); color: #fff; text-decoration: none; font-size: 1.02rem; }
.strip span { flex: 1; } .strip b { color: var(--honey); }
.strip.must { background: var(--honey); color: var(--ink); } .strip.must b { color: var(--ink); }
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kid-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--ink); color: #f6e9d8; border-radius: var(--radius); text-decoration: none; }
.kid-card strong { font-family: "Kanit"; font-size: 1.2rem; font-weight: 500; color: #fff; }
.kid-card .low-text { color: #ffb4ab; } .kid-card b { color: var(--honey); }

.grid2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.rows li > div { display: flex; flex-direction: column; min-width: 0; }
.score { font-size: .95rem; padding: 3px 10px; border-radius: 9px; white-space: nowrap; }
.score.good { background: #e3f6ef; color: #0d6b52; }
.score.mid { background: #fff1d6; color: #8a5300; }
.score.low { background: #fdeceb; color: #9a2c25; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats div { background: var(--bg); border-radius: 14px; padding: 12px 6px; text-align: center; }
.stats b { display: block; font-size: 1.6rem; font-weight: 500; line-height: 1.2; }
.stats span { font-size: .8rem; color: var(--muted); }
.meter { height: 10px; border-radius: 999px; background: #f3ead6; margin: 14px 0 6px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--honey-2); border-radius: 999px; }
.meter span.bad { background: var(--low); }
.meter.dark { background: rgba(255,255,255,.15); }
.meter.dark span { background: var(--honey); }

/* ---------- pages ---------- */
.page-title { margin-bottom: 16px; font-size: 1.6rem; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.title-row .page-title { margin: 0; }
.picker select { margin: 0; min-width: 200px; }
dl.info { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 0; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; min-width: 0; }
.empty { text-align: center; padding: 36px 20px; }
.empty .big { font-size: 2.6rem; margin: 0; }
.kid-tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }
.kid-tabs a { padding: 7px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); white-space: nowrap; }
.kid-tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* check-in */
.checkin { background: var(--honey); border: 0; }
.checkin .muted { color: #6e4c00; }
.checkin-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.checkin-btns form { margin: 0; }
.checkin .btn { min-width: 120px; }
.checkin .btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }

/* items (สมุดงาน) */
.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item-ic { font-size: 1.3rem; line-height: 1.5; }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-main strong { font-weight: 600; overflow-wrap: anywhere; }
.item-detail { color: var(--ink-2); margin-top: 2px; }
.item-act { display: flex; gap: 4px; align-items: center; }
.item-act form { margin: 0; }
.due { white-space: nowrap; }
.due.soon { color: var(--mid); font-weight: 600; }
.due.late { color: var(--low); font-weight: 600; }
.more { position: relative; }
.more summary { list-style: none; cursor: pointer; padding: 4px 10px; border-radius: 9px; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.more summary::-webkit-details-marker { display: none; }
.more[open] summary { background: var(--bg); }
.more-menu { position: absolute; right: 0; top: 110%; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 150px; padding: 6px; }
.more-menu a, .more-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: none; border-radius: 8px; cursor: pointer; }
.more-menu a:hover, .more-menu button:hover { background: var(--bg); }

/* missions */
.missions { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mission { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.mission.must { border: 2px solid var(--honey); background: #fffaf0; }
.mission.done { opacity: .7; }
.mission.test { border-left: 5px solid var(--mid); }
.m-ic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 1.3rem; background: var(--honey-soft); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.m-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m-ok { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--good); color: #fff; font-weight: 700; flex: none; }
.mbar { height: 7px; background: #f3ead6; border-radius: 99px; margin-top: 6px; overflow: hidden; }
.mbar span { display: block; height: 100%; background: var(--honey-2); border-radius: 99px; }

/* honey */
.honey-hero { display: flex; gap: 18px; align-items: center; background: var(--ink); color: #f6e9d8; border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.honey-hero .eyebrow { color: var(--honey); }
.honey-hero .muted { color: #cdb8a3; margin: 0; }
.jar { font-size: 3.4rem; width: 88px; height: 88px; display: grid; place-items: center; background: var(--honey); flex: none; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.big-num { font-size: 2.6rem; font-weight: 700; color: #fff; margin: 0; line-height: 1.1; }
.big-num span { font-size: 1rem; font-weight: 500; color: var(--honey); }
.medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 10px; }
.medal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 8px; border-radius: 14px; background: var(--bg); filter: grayscale(1); opacity: .5; }
.medal.got { filter: none; opacity: 1; background: var(--honey-soft); }
.medal .mi { font-size: 1.8rem; }
.medal .small { line-height: 1.3; }

/* time */
.timer-card { text-align: center; background: var(--ink); color: #fff; border: 0; }
.timer-card .eyebrow { color: var(--honey); }
.timer-card .muted { color: #cdb8a3; }
.timer { font-size: 3.4rem; font-weight: 700; margin: 0; letter-spacing: .02em; }
.redeem { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.redeem form { margin: 0; }
.must-card { background: var(--honey-soft); border-color: var(--honey); text-align: center; }

/* parent */
[hidden] { display: none !important; }
.rows li > div.item-act { flex-direction: row; flex: none; }

.mid-text { color: var(--mid); }
.review-item { border-top: 1px solid var(--line); padding: 14px 0 4px; }
.ri-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.bonus-row { border-top: 1.5px dashed var(--line); margin-top: 14px; padding-top: 12px; }
.pin-input.small-pin { font-size: 1.2rem; margin: 0; letter-spacing: .3em; }
.quick-titles { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; }
.chip { border: 1px solid var(--line); background: #fffdf6; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .85rem; color: var(--ink-2); cursor: pointer; }
.chip:hover { background: var(--honey-soft); }
.seg.days label { min-width: 40px; }
.rows li.off { opacity: .55; }
.mission.quest { border-left: 5px solid var(--honey-2); }

.seg.amounts label { min-width: 54px; }
.seg span.neg { color: var(--low); }
.seg input:checked + span.neg { background: #fdeceb; border-color: var(--low); color: var(--low); }

.sum-hero { background: var(--ink); color: #f6e9d8; border-radius: var(--radius); padding: 20px 20px 16px; margin-bottom: 16px; }
.sum-hero .eyebrow { color: var(--honey); }
.sum-hero h1 { color: #fff; margin-bottom: 14px; }
.sum-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sum-3 div { background: rgba(255,255,255,.07); border-radius: 14px; padding: 12px 6px; text-align: center; }
.sum-3 b { display: block; font-size: 1.7rem; font-weight: 500; color: #fff; line-height: 1.2; }
.sum-3 b small { font-size: .9rem; color: #cdb8a3; }
.sum-3 span { font-size: .78rem; color: #cdb8a3; }
.alert-card { display: flex; align-items: center; gap: 8px; background: var(--honey); border: 0; color: var(--ink); text-decoration: none; font-size: 1.02rem; }
.alert-card span { margin-left: auto; font-weight: 600; }
.alert-card.calm { background: #fff; border: 1px solid var(--line); }
.cols { display: flex; gap: 4px; align-items: flex-end; height: 170px; padding-top: 8px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.col-bars { flex: 1; width: 100%; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.col-bars span { width: 42%; max-width: 12px; border-radius: 4px 4px 0 0; min-height: 2px; }
.c-earn { background: var(--honey-2); } .c-used { background: var(--ink); }
.col-l { font-size: .68rem; color: var(--muted); text-align: center; line-height: 1.2; margin-top: 4px; }
.legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0 0; }
.lg-earn, .lg-used { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.lg-earn { background: var(--honey-2); } .lg-used { background: var(--ink); margin-left: 8px; }
details.subj { padding: 0; }
details.subj summary { list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 16px 20px; cursor: pointer; }
details.subj summary::-webkit-details-marker { display: none; }
details.subj[open] summary { border-bottom: 1px solid var(--line); }
details.subj .meter, details.subj .rows { margin-left: 20px; margin-right: 20px; }
details.subj .rows { margin-bottom: 8px; }
.subj-head { display: flex; flex-direction: column; min-width: 0; }
.subj-head strong { font-family: "Kanit"; font-weight: 500; font-size: 1.1rem; }
.subj-score { text-align: right; display: flex; flex-direction: column; }
.subj-score b { font-family: "Kanit"; font-size: 1.4rem; font-weight: 500; line-height: 1.2; }
.proof { display: block; width: 100%; max-height: 420px; object-fit: contain; background: var(--bg); border-radius: 12px; margin-bottom: 12px; }
.approve-form input[name=note] { margin-top: 10px; }
.two-btn { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
fieldset.rules { border: 0; padding: 0; margin: 0 0 14px; }
fieldset.rules legend { font-family: "Kanit"; font-weight: 500; padding: 0; margin-bottom: 6px; color: #9a6400; }
label.rule { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
label.rule input { width: 92px; margin: 0; text-align: center; }
.pin-card { text-align: center; padding: 30px 24px; }
.pin-icon { font-size: 2.4rem; }
.pin-card h1 { font-size: 1.5rem; margin: 6px 0; }
.pin-input { text-align: center; font-size: 1.6rem; letter-spacing: .4em; margin-bottom: 12px; font-family: "Kanit"; }
.rm-prev { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.rm-prev figure { margin: 0; }
.rm-prev img { width: 100%; border-radius: 10px; display: block; }
.rm-prev figcaption { font-size: .82rem; color: var(--muted); text-align: center; margin-top: 4px; }

/* history (ASMO) */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: .82rem; padding: 8px 6px; border-bottom: 1.5px solid var(--line); }
.table td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table .r { text-align: right; }
.table tr.off td { opacity: .5; }
details summary { cursor: pointer; }
.table details summary { color: var(--low); }
ul.wrong { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 180px 1fr 80px; gap: 14px; align-items: center; }
.bar-label { display: flex; flex-direction: column; line-height: 1.3; }
.bar { position: relative; height: 12px; border-radius: 999px; background: #f3ead6; }
.bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--honey-2); }
.bar .mark { position: absolute; top: -4px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.bar-num { text-align: right; font-family: "Kanit"; }
.bar-num b { font-weight: 500; }
.delta { font-size: .78rem; margin-left: 4px; }
.delta.up { color: var(--good); } .delta.down { color: var(--low); }
.lg-fill { display: inline-block; width: 18px; height: 8px; border-radius: 4px; background: var(--honey-2); }
.lg-mark { display: inline-block; width: 4px; height: 14px; border-radius: 2px; background: var(--ink); margin-left: 8px; }
.tip { background: var(--ink); color: #f6e9d8; border: 0; }
.tip a { color: var(--honey); }

.grid-admin { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }

/* LIFF */
.liff { padding-top: 60px !important; }
.spinner { width: 42px; height: 42px; margin: 6px auto 12px; border-radius: 50%; border: 4px solid var(--honey-soft); border-top-color: var(--honey-2); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { color: var(--muted); font-size: .85rem; padding: 18px 0 26px; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .hero, .grid2, .grid-admin { grid-template-columns: 1fr; }
  .hero { gap: 24px; padding-top: 28px !important; }
  .who-name { display: none; }
  /* แถบเมนูล่างแบบแอป */
  body.has-tabs { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff;
    border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(58,35,21,.08);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 0; justify-content: space-around;
  }
  .tabs a { flex: 1; flex-direction: column; gap: 0; padding: 4px 2px; color: var(--muted); font-size: .72rem; border-radius: 12px; }
  .tabs .ti { font-size: 1.3rem; line-height: 1.3; }
  .tabs a.on { background: var(--honey-soft); color: var(--ink); font-weight: 600; }
  .tabs a:hover { background: var(--bg); color: var(--ink); }
}
@media (max-width: 560px) {
  h1 { font-size: 1.55rem; }
  .page-title { font-size: 1.4rem; }
  .two { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .apps { grid-template-columns: 1fr 1fr; gap: 10px; }
  .app { padding: 14px 14px 16px; }
  .app-desc { display: none; }
  .app .go { display: none; }
  .bar-row { grid-template-columns: 1fr 64px; }
  .bar-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .row-form { flex-direction: column; }
  .stats b, .sum-3 b { font-size: 1.35rem; }
  .honey-hero { padding: 18px; gap: 14px; }
  .jar { width: 70px; height: 70px; font-size: 2.6rem; }
  .big-num { font-size: 2.1rem; }
  .rm-prev { grid-template-columns: 1fr; }
  .brand span { font-size: 1.1rem; }
}

/* ===== portal: แถบบน ===== */
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { font-family: "Sarabun"; font-weight: 400; font-size: .72rem; opacity: .7; }
.switch { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); color: #fff; text-decoration: none; font-size: .88rem; white-space: nowrap; }
.switch:hover { background: rgba(255,255,255,.1); }
@media (max-width: 560px) { .switch span { display: none; } .switch { padding: 6px 10px; } }

/* การ์ดเข้า portal บนหน้าแรก */
.apps.portals { grid-template-columns: 1fr 1fr; }
.app.big { padding: 22px 20px; }
.app.big .app-icon { width: 60px; height: 60px; font-size: 1.8rem; }
.app.big .app-name { font-size: 1.3rem; }
@media (max-width: 560px) { .app.big .app-desc { display: block; } .app.big { padding: 16px 14px; } }

/* ชิปวิชา */
.subj-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.subj-chips .muted { margin-right: 4px; }
.chip.on { background: var(--honey); border-color: var(--honey); color: var(--ink); font-weight: 600; }
.subj-chips.static .chip { cursor: default; background: #fff; }
.warn-card { border-left: 5px solid var(--low); }
.prep { background: var(--honey-soft); border-radius: 10px; padding: 8px 12px; margin: 8px 0 0; }
.tomorrow { border-left: 5px solid var(--honey-2); }
.tomorrow p { margin: 4px 0; }

/* สลับวันนี้/พรุ่งนี้ */
.day-switch { display: flex; gap: 6px; }
.day-switch a { flex: 1; text-align: center; padding: 9px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; }
.day-switch a.on { background: var(--honey); border-color: var(--honey); font-weight: 600; }

/* ตารางเรียน */
.tt-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tt-days .card { margin: 0; }
.tt-day.today { border: 2px solid var(--honey-2); }
.tt-list { margin: 0; padding: 0; list-style: none; }
.tt-list li { padding: 5px 0; border-top: 1px dashed var(--line); }
.tt-list li:first-child { border-top: 0; }
.tt-list .muted { display: inline-block; width: 18px; }
.tt-edit summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.tt-edit summary::-webkit-details-marker { display: none; }
.tt-edit[open] summary { margin-bottom: 12px; }
.tt-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.tt-slot { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tt-slot span { width: 48px; flex: none; font-size: .82rem; }
.tt-slot select { margin: 0; padding: 8px; }
@media (max-width: 420px) { .tt-slots { grid-template-columns: 1fr; } }

/* ===== ธีมสมุดคะแนน (ฟ้า) ===== */
.portal-score {
  --bg: #eef4fc; --ink: #1e3354; --ink-2: #3d5272; --muted: #6c7a90; --line: #d9e4f3;
  --honey-soft: #e3edfb; --honey-2: #2f6fde;
  background-image: none;
}
.portal-score .topbar { background: #1e3354; }
.portal-score .btn.primary, .portal-score .seg input:checked + span, .portal-score .day-switch a.on,
.portal-score .chip.on { background: #2f6fde; border-color: #2f6fde; color: #fff; }
.portal-score .btn.primary:hover { background: #2559b5; }
.portal-score .tabs a.on { background: #ffc61f; color: #1e3354; }
.portal-score .card.highlight { border-color: #2f6fde; }
.portal-score .checkin { background: #2f6fde; color: #fff; }
.portal-score .checkin .muted { color: #dbe7fb; }
.portal-score .checkin .btn.primary { background: #fff; border-color: #fff; color: #1e3354; }
.portal-score .eyebrow { color: #2f6fde; }
.portal-score .prep { background: #fff6d6; }
@media (max-width: 860px) {
  .portal-score .tabs a.on { background: #e3edfb; color: #1e3354; }
}

/* ห้องเรียน */
.class-badge { background: #e3edfb; color: #1f4fa8; font-size: .72rem; vertical-align: middle; }
label.check.share { background: #e3edfb; padding: 10px 12px; border-radius: 12px; color: #1e3354; }
.join-box { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; background: var(--bg); border-radius: 14px; padding: 12px; }
.join-box input { grid-column: 1 / -1; margin: 0; font-size: .85rem; }
.join-box .btn { grid-column: 1 / -1; justify-self: start; }
.join-code { font-family: "Kanit", "Sarabun", system-ui, sans-serif; font-size: 1.6rem; letter-spacing: .15em; }
.badge-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .8rem; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.badge-btn.on { background: #2f6fde; border-color: #2f6fde; color: #fff; }
.new-class { position: relative; }
.new-class summary { list-style: none; cursor: pointer; }
.new-class summary::-webkit-details-marker { display: none; }
.new-class form { position: absolute; z-index: 5; top: 110%; left: 0; width: 300px; margin: 0; }
.subj-rename { flex: 1; margin: 0; }
.subj-rename input { margin: 0; padding: 7px 10px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: .9rem; }
/* ปุ่ม Google (ตามแบบของ Google: พื้นขาว ขอบเทา โลโก้ G สี) */
.g-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; padding: 10px 16px;
  background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 999px; font: 500 1rem/1.2 "Sarabun", system-ui, sans-serif;
  text-decoration: none; cursor: pointer; box-shadow: 0 1px 2px rgba(58,35,21,.06); }
.g-btn:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(60,64,67,.25); }
.g-btn:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }
.g-logo { flex: none; vertical-align: -3px; }
.or-sep { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; color: var(--muted); font-size: .85rem; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* นำเข้าข้อมูล */
textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 13px; font: inherit; color: var(--ink); border: 1.5px solid var(--line); border-radius: 12px; background: #fffdf6; resize: vertical; }
textarea:focus { outline: none; border-color: var(--honey-2); box-shadow: 0 0 0 3px rgba(255,198,31,.3); }
.table.roster input { margin: 0; padding: 6px 8px; font-size: .9rem; min-width: 90px; }
.table.roster td { vertical-align: middle; }
.slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.slip { border: 1.5px dashed #9aa7bd; border-radius: 12px; padding: 12px 14px; background: #fff; break-inside: avoid; }
.slip-head { font-size: .78rem; color: var(--muted); }
.slip-name { font-family: "Kanit", "Sarabun", sans-serif; font-size: 1.2rem; margin: 2px 0 6px; }
.slip-row { display: flex; justify-content: space-between; font-size: .95rem; }
.slip-row b { font-family: ui-monospace, Menlo, monospace; letter-spacing: .05em; }
.slip-url { font-size: .75rem; color: var(--muted); margin-top: 6px; }
@media print {
  .topbar, .tabs, .foot, .no-print { display: none !important; }
  body { background: #fff !important; padding: 0 !important; }
  main.wrap { padding: 0 !important; max-width: none; }
  .slips { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

/* ---------- สมาชิก / สิทธิ์ใช้งาน ---------- */
.stats div { background: #fff; border: 1px solid var(--line); }
.sub-row { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.sub-name { min-width: 200px; line-height: 1.5; }
.sub-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; flex: 1; }
.sub-acts details.more { flex-basis: 100%; display: flex; }
.sub-acts details.more[open] { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.sub-acts details.more summary { cursor: pointer; color: var(--blue); text-align: right; width: 100%; }
.sub-acts input { margin: 0; width: auto; padding: 6px 10px; }
.choose { display: grid; gap: 10px; margin-top: 10px; }
.choice { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); background: #fffdf6; }
.choice:hover { border-color: var(--honey-2); background: var(--honey-soft); }
.choice span { grid-row: span 2; font-size: 2rem; text-align: center; }
.choice b { font-family: "Kanit", sans-serif; font-weight: 500; font-size: 1.1rem; }
.choice small { color: var(--muted); }
.gate h1 { font-size: 1.5rem; margin: .2rem 0 .6rem; }
.sales { background: var(--honey-soft); border: 1px dashed var(--honey-2); border-radius: 14px; padding: 12px 14px; margin: 12px 0; }
.app .status { display: inline-block; margin-top: 8px; font-size: .78rem; padding: 2px 10px; border-radius: 99px; background: #e7f7f1; color: #0f6b52; }
.app .status.lock { background: #f4ece4; color: var(--muted); }
.app .status.warn { background: var(--honey-soft); color: #8a5a00; }
.plan.off { opacity: .85; }
/* แถบสลับระบบ (ใช้ในระบบเดิมด้วย) */
.cj-days { background: var(--honey-soft) !important; color: #8a5a00 !important; }
.line-btn { background: #06c755 !important; border-color: #06c755 !important; color: #fff !important; }
.steps-mini { margin: 10px 0 0; padding-left: 20px; } .steps-mini li { margin-bottom: 4px; }
.bigcode { font: 700 1.25rem/1.2 ui-monospace, Menlo, monospace; letter-spacing: .15em; background: var(--honey-soft); border: 1.5px dashed var(--honey-2); border-radius: 10px; padding: 2px 10px; display: inline-block; user-select: all; }
.bigcode.small-code { font-size: 1rem; }
.kid-code { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) { .apps.practice .app-desc { display: block; font-size: .78rem; } }

/* ================= หน้าแรก (ยังไม่เข้าสู่ระบบ) ================= */
.top-login { color: var(--ink); background: var(--honey); text-decoration: none; padding: 7px 16px; border-radius: 999px; font-family: "Kanit"; font-weight: 500; font-size: .95rem; }
.top-login:hover { background: #ffb800; }

/* ===== แถบบนแบบเม็ดยาลอย (เว็บหลัก) — ธีมครูผึ้ง ===== */
.portal-main .topbar { background: transparent; color: var(--ink); padding: 10px 0 6px; }
.portal-main .topbar-in {
  width: auto; max-width: 1048px; margin-inline: max(16px, calc((100% - 1048px) / 2)); padding: 6px 8px 6px 14px; min-height: 58px;
  background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 2px 4px rgba(58,35,21,.04), 0 10px 26px rgba(58,35,21,.09);
}
.portal-main .brand { color: var(--ink); margin-right: 0; }
.portal-main .tabs { margin-left: auto; }
.portal-main .tabs a { color: var(--ink-2); font-weight: 500; }
.portal-main .tabs a:hover { background: var(--honey-soft); color: var(--ink); }
.portal-main .tabs a.on { background: var(--honey); color: var(--ink); }
.portal-main .who { color: var(--ink-2); }
.portal-main .who.on, .portal-main .who:hover { background: var(--honey-soft); color: var(--ink); }

/* เมนูคนยังไม่ล็อกอิน */
.gnav { display: flex; align-items: center; gap: 2px; margin: 0 auto; }
.gnav a { display: flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 500; white-space: nowrap; }
.gnav a:hover { background: var(--honey-soft); color: var(--ink); }
.gnav .ti { display: none; }
.gnav .gnav-start, .gnav .gnav-contact { display: none; }
/* หน้า/ส่วนที่เปิดอยู่ = ขีดเส้นใต้สีน้ำผึ้ง */
.gnav a { position: relative; }
.gnav a[aria-current="page"] { color: var(--ink); }
.gnav a[aria-current="page"]::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 3px; height: 3px; border-radius: 3px; background: var(--honey); }
.portal-main .brand small { color: var(--honey-2); opacity: 1; font-weight: 500; }
.portal-main .top-login { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); padding: 7px 16px; white-space: nowrap; }
.portal-main .top-login:hover { background: var(--honey-soft); }
.top-start { background: var(--honey); color: var(--ink); text-decoration: none; padding: 9px 20px; border-radius: 999px; font-family: "Kanit"; font-weight: 500; white-space: nowrap;
  box-shadow: 0 3px 0 var(--honey-2); transition: transform .12s, box-shadow .12s; }
.top-start:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--honey-2); background: #ffb800; }
.foot a { color: inherit; }
.gnav-toggle { display: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--honey); cursor: pointer; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.gnav-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
.gnav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.gnav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.gnav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.gnav a:focus-visible, .top-login:focus-visible, .top-start:focus-visible, .gnav-toggle:focus-visible { outline: 3px solid var(--honey-2); outline-offset: 2px; }

@media (max-width: 860px) {
  /* มือถือ: เมนูเป็นแผงเลื่อนลงจากปุ่ม ☰ */
  /* ไม่ใช้ blur บนมือถือ: backdrop-filter ทำให้แถบเมนูล่าง (position: fixed) ไปติดอยู่ในเม็ดยาแทน */
  .portal-main .topbar-in { position: relative; gap: 6px; background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .portal-main .brand { margin-right: auto; }
  .gnav-toggle { display: flex; }
  .top-start { display: none; }
  .gnav {
    display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px; margin: 0;
    background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 14px 34px rgba(58,35,21,.16);
  }
  .gnav.open { display: flex; }
  .gnav a { padding: 12px 14px; border-radius: 14px; font-size: 1.02rem; }
  .gnav .ti { display: inline; font-size: 1.15rem; }
  .gnav .gnav-start { display: flex; justify-content: center; margin-top: 6px; background: var(--honey); color: var(--ink); font-family: "Kanit"; }
  .gnav .gnav-start:hover { background: #ffb800; }
  .gnav .gnav-contact { display: flex; margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; color: var(--muted); font-size: .95rem; }
  .gnav a[aria-current="page"]::after { left: 14px; right: auto; width: 28px; bottom: 6px; }
  /* ล็อกอินแล้ว: เมนูยังเป็นแถบล่างแบบแอปเหมือนเดิม */
  .portal-main .tabs a { color: var(--muted); }
  .portal-main .tabs a.on { background: var(--honey-soft); color: var(--ink); }
}
@media (max-width: 380px) { .portal-main .top-login { padding: 8px 8px; font-size: .9rem; } .portal-main .brand span { font-size: 1rem; } }
html { scroll-behavior: smooth; }
#login, #story, #screens, #trial { scroll-margin-top: 76px; }
main.lp { flex: 1; padding-bottom: 20px; }
.lp-hero { padding-bottom: 56px; }
.lp-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); }
.lp-hero .hl { background: linear-gradient(transparent 58%, var(--honey) 58%); padding: 0 4px; }
.lp-hero .lead { margin: 18px 0 22px; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.btn.lp-big { padding: 13px 22px; font-size: 1.05rem; border-radius: 14px; }
.btn.ghost-dark { background: transparent; border-color: #e2c98a; }
.lp-kid { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); }
.lp-sec { padding-top: 56px; padding-bottom: 56px; }
.lp-band { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 56px 0; }
.lp-band.soft { background: var(--honey-soft); border-color: #f5dc94; padding: 0; }
.lp-h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; line-height: 1.3; margin: 0 0 18px; }
.lp-p { font-size: 1.06rem; color: var(--ink-2); max-width: 46em; }
.center { text-align: center; }

/* บทสนทนา */
.chat { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 88%; }
.msg p { margin: 0; padding: 12px 16px; border-radius: 20px; font-size: 1.02rem; line-height: 1.6; }
.msg.me { align-self: flex-end; }
.msg.me p { background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.msg.bee p { background: var(--honey-soft); border: 1px solid #f5dc94; border-bottom-left-radius: 6px; }
.msg .ava { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--honey); display: grid; place-items: center; font-size: 1.25rem; }

/* 3 เสา */
.lp-pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lp-pillars article { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border-top: 5px solid var(--c); }
.lp-pillars .pi { font-size: 2rem; }
.lp-pillars h3 { margin: 6px 0 6px; font-size: 1.3rem; font-weight: 500; }
.lp-pillars p { margin: 0 0 10px; color: var(--ink-2); }
.lp-pillars ul { margin: 0; padding-left: 1.1em; color: var(--ink-2); font-size: .94rem; }
.lp-pillars li::marker { color: var(--c); }

/* ขั้นตอน */
.lp-steps { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: s; }
.lp-steps li { background: #fff; border-radius: var(--radius); padding: 18px 18px 18px 64px; position: relative; counter-increment: s; box-shadow: var(--shadow); }
.lp-steps li::before { content: counter(s); position: absolute; left: 16px; top: 16px; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--honey); display: grid; place-items: center; font-family: "Kanit"; font-weight: 700; }
.lp-steps b { display: block; font-family: "Kanit"; font-weight: 500; font-size: 1.05rem; }
.lp-steps span { font-size: .92rem; color: var(--ink-2); }

/* ตัวอย่างหน้าจอ */
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: 236px; gap: 20px; overflow-x: auto; padding: 10px 4px 22px; margin: 14px -4px 0; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.shot { margin: 0; scroll-snap-align: start; }
.shot figcaption { font-size: .9rem; color: var(--ink-2); margin-top: 12px; line-height: 1.45; }
.shot figcaption b { display: block; font-family: "Kanit"; font-weight: 500; font-size: 1rem; color: var(--ink); }
.phone { height: 440px; border-radius: 30px; border: 7px solid #2b1a10; background: #fff; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 14px 30px rgba(58,35,21,.18); font-size: .8rem; line-height: 1.45; }
.ph-top { padding: 12px 14px 10px; font-family: "Kanit"; font-weight: 500; font-size: .92rem; background: #fff; border-bottom: 1px solid #eee; }
.ph-top.dark { background: var(--ink); color: #fff; border: 0; }
.ph-top.blue { background: #1e3354; color: #fff; border: 0; }
.ph-top.green { background: #16a37f; color: #fff; border: 0; }
.ph-body { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.phone.line .ph-body { background: #8cabd9; }
.phone.web .ph-body { background: var(--bg); }
.b { max-width: 84%; padding: 7px 10px; border-radius: 14px; }
.b.l { background: #fff; align-self: flex-start; }
.b.r { background: #85e249; align-self: flex-end; }
.b.photo { width: 110px; height: 78px; display: grid; place-items: center; text-align: center; font-size: 1.6rem; background: #e9f7dd; }
.b.photo small { display: block; font-size: .66rem; color: #4a6b33; }
.qr { margin-top: auto; display: flex; gap: 5px; flex-wrap: wrap; }
.qr span { background: #fff; border-radius: 999px; padding: 3px 9px; font-size: .7rem; color: #06a24a; border: 1px solid #c8e9d4; }
.flex { background: #fff; border-radius: 14px; overflow: hidden; align-self: flex-start; width: 88%; }
.flex .fx-h { background: var(--honey); padding: 7px 10px; font-weight: 600; }
.flex .fx-h.blue { background: #2f6fde; color: #fff; }
.flex .fx-img { height: 64px; background: #f3ece0; display: grid; place-items: center; font-size: 1.5rem; }
.flex .fx-t { padding: 7px 10px; color: #0e8f6c; font-size: .74rem; }
.flex .fx-btn { margin: 0 10px 7px; padding: 6px; text-align: center; border-radius: 8px; border: 1px solid #ddd; font-weight: 600; }
.flex .fx-btn.ok { background: #16a37f; border-color: #16a37f; color: #fff; }
.flex.big { width: 92%; }
.flex .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; }
.flex .grid span { border: 1px solid var(--line); border-radius: 8px; padding: 8px 4px; text-align: center; font-weight: 600; background: #fffdf6; }
.st-hero { background: var(--ink); color: #fff; border-radius: 14px; padding: 12px; }
.st-hero small { opacity: .8; }
.st-hero b { display: block; font-family: "Kanit"; font-size: 2rem; color: var(--honey); line-height: 1.2; }
.st-hero b span { font-size: .8rem; color: #fff; opacity: .8; margin-left: 4px; font-weight: 400; }
.st-hero i { display: block; height: 8px; border-radius: 6px; background: rgba(255,255,255,.18); margin-top: 6px; position: relative; overflow: hidden; }
.st-hero i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--honey); border-radius: 6px; }
.st-list, .sb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.st-list li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 8px 30px; position: relative; display: flex; justify-content: space-between; }
.st-list li::before { content: ""; position: absolute; left: 9px; top: 50%; width: 13px; height: 13px; margin-top: -7px; border-radius: 4px; border: 2px solid #d8c7a0; }
.st-list li.done::before { background: var(--good); border-color: var(--good); }
.st-list li.done { color: var(--muted); }
.st-list em { font-style: normal; color: #9a6400; font-weight: 600; }
.sb-tabs { display: flex; gap: 4px; }
.sb-tabs span { flex: 1; text-align: center; padding: 5px 2px; border-radius: 8px; background: #fff; border: 1px solid #dbe5f7; color: #1e3354; }
.sb-tabs span.on { background: #2f6fde; color: #fff; border-color: #2f6fde; }
.sb-list li { background: #fff; border-radius: 10px; padding: 8px 10px; border: 1px solid #e3e9f5; }
.sb-list li b { margin-right: 4px; }
.sb-list i { float: right; font-style: normal; font-size: .68rem; color: #fff; background: var(--c); padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.sb-sum { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.sb-sum div { background: #1e3354; color: #fff; border-radius: 10px; padding: 7px 4px; text-align: center; }
.sb-sum b { display: block; font-family: "Kanit"; font-size: 1.05rem; }
.sb-sum small { font-size: .62rem; opacity: .8; }
.pq-n { margin: 0; color: var(--muted); font-size: .72rem; }
.pq { margin: 0 0 4px; font-size: .95rem; font-weight: 600; }
.pq-o { background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 7px 10px; }
.pq-o.ok { border-color: var(--good); background: #e3f6ef; color: #0d6b52; font-weight: 600; }
.pq-ex { margin-top: auto; background: #fff; border-left: 4px solid var(--good); border-radius: 8px; padding: 8px 10px; }

/* บทเรียน */
.lp-split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.lp-ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; font-size: 1.02rem; }
.lp-lessons { display: flex; flex-direction: column; gap: 10px; }
.lesson { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 12px 14px; border-left: 5px solid var(--c); box-shadow: var(--shadow); }
.lesson > div { flex: 1; min-width: 0; }
.lesson b { display: block; font-family: "Kanit"; font-weight: 500; }
.lesson small { color: var(--muted); }
.lesson .li-ic { font-size: 1.6rem; }
.lesson.soon { opacity: .7; }
a.lesson { color: var(--ink); text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s; }
a.lesson:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(58,35,21,.12); }
a.lesson:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255,198,31,.6), var(--shadow); }
@media (prefers-reduced-motion: reduce) { a.lesson { transition: none; } a.lesson:hover { transform: none; } }
.lesson .tag { flex: none; font-size: .75rem; background: #f3ece0; color: var(--muted); padding: 2px 9px; border-radius: 999px; }
.lesson .tag.on { background: #e3f6ef; color: #0d6b52; }

/* FAQ */
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 0; font-family: "Kanit"; font-weight: 500; font-size: 1.03rem; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--honey-2); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--ink-2); }

/* ชวนทดลอง */
.lp-trial { background: var(--ink); color: #fff; border-radius: 26px; padding: 36px; display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; position: relative; overflow: hidden; }
.lp-trial .eyebrow { color: var(--honey); }
.lp-trial .lp-h2 { color: #fff; }
.lp-mini { margin: 0 0 22px; padding-left: 1.3em; line-height: 1.9; color: #f3e6d6; }
.lp-mini b { color: var(--honey); }
.lp-trial .btn:not(.line-btn) { background: #fff; border-color: #fff; }
.lp-trial-note { color: #d8c5b0; margin: 4px 0 0; }
.lp-trial-note a { color: var(--honey); }
.lp-qr { background: #fff; color: var(--ink); border-radius: 18px; padding: 14px; text-align: center; }
.lp-qr .qr-box { width: 168px; height: 168px; }
.lp-qr .qr-box img, .lp-qr .qr-box canvas { width: 100% !important; height: auto !important; }
.lp-qr small { display: block; margin-top: 8px; color: var(--muted); }

@media (max-width: 960px) {
  .lp-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .lp-hero { padding-bottom: 36px; }
  .lp-pillars, .lp-split { grid-template-columns: 1fr; }
  .lp-trial { grid-template-columns: 1fr; padding: 26px 20px; }
  .lp-qr { display: none; }
  .lp-sec { padding-top: 40px; padding-bottom: 40px; }
  .lp-band { padding: 40px 0; }
  .lp-band.soft { padding: 0; }
}
@media (max-width: 560px) {
  .lp-steps { grid-template-columns: 1fr; }
  .msg { max-width: 94%; }
  .msg p { font-size: .97rem; }
  .lp-cta .btn { width: 100%; }
  .shots { grid-auto-columns: 220px; }
}
.shots-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.shots-head p { margin: 0; }
.shots-nav { display: flex; gap: 6px; }
.shots-nav .btn { width: 40px; height: 40px; padding: 0; font-size: 1.4rem; border-radius: 50%; }
@media (max-width: 860px) { .shots-nav { display: none; } }
.sub-group { margin: 14px 0 4px; padding-top: 10px; border-top: 1px dashed var(--line); font-family: "Kanit"; font-weight: 500; }

/* ภาพรวมการฝึก (หน้าแรก) */
.act .card-head { flex-wrap: wrap; align-items: center; }
.act-ctl { display: flex; gap: 8px; align-items: center; }
.act-kid { width: auto; margin: 0; padding: 6px 10px; }
.seg-mini { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg-mini button { border: 0; background: transparent; font: inherit; font-size: .88rem; padding: 4px 14px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.seg-mini button.on { background: var(--honey); color: var(--ink); font-weight: 600; }
.act-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.act-ctl { flex-wrap: wrap; }
.act-gear { border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); font: inherit; font-size: .88rem; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.act-gear:hover, .act-gear.on { background: var(--honey-soft); border-color: var(--honey-2); color: var(--ink); }
.act-gear:focus-visible, .act-cfg .check:focus-within { outline: 3px solid rgba(255,198,31,.6); outline-offset: 2px; }
.act-cfg { background: var(--honey-soft); border: 1px dashed var(--honey-2); border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; }
.act-cfg fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.act-cfg legend { font-family: "Kanit"; font-weight: 500; padding: 0; margin-bottom: 8px; }
.act-cfg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; }
.act-cfg .check { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 4px; border-radius: 8px; cursor: pointer; }
.act-cfg .check .dot { flex: none; }
.act-cfg p { margin: 8px 0 0; }
.act-cfg-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.act-tiles div { background: var(--bg); border-radius: 14px; padding: 14px 8px; text-align: center; border-top: 4px solid var(--c); }
.act-tiles b { display: block; font-family: "Kanit"; font-size: 1.9rem; font-weight: 500; line-height: 1.1; }
.act-tiles span { font-size: .85rem; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.act-tiles .dot { background: var(--c); }
.act-note { margin: 10px 0 0; }
.act-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 190px; align-items: end; padding: 8px 2px 0; border-bottom: 1px solid var(--line); }
.act-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.act-bar { width: min(34px, 70%); display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.act-bar i { display: block; min-height: 3px; }
.act-bar i:first-child { border-radius: 4px 4px 0 0; }
.act-n { font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-bottom: 3px; min-height: 1.1em; }
.act-d { position: absolute; bottom: -38px; font-size: .74rem; color: var(--muted); text-align: center; line-height: 1.2; }
.act-col.is-today .act-d { color: var(--ink); font-weight: 700; }
.act-col:hover .act-bar { filter: brightness(1.08); }
.act-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 46px; font-size: .86rem; color: var(--ink-2); }
.act-legend span { display: inline-flex; align-items: center; gap: 6px; }
.act-foot { margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--muted); }

/* หัวเว็บจอกลาง 861–1100px (2026-11-17): โลโก้/เมนูไม่ขึ้นบรรทัดใหม่ — ซ่อนชื่อผู้ใช้ (เหลือวงกลม) → "กับครูผึ้ง" → ไอคอนเมนู → คำ "ฉันจะเก่ง" (เหลือรูปผึ้ง) */
.brand { white-space: nowrap; flex: none; }
@media (min-width: 861px) { .tabs a, .who { white-space: nowrap; } }
@media (min-width: 861px) and (max-width: 1100px) {
  .who-name { display: none; }
  .topbar-in { gap: 8px; }
  .tabs a { padding: 7px 9px; }
}
@media (min-width: 861px) and (max-width: 1000px) { .brand small { display: none; } }
@media (min-width: 861px) and (max-width: 920px) { .tabs a .ti { display: none; } }
@media (min-width: 861px) and (max-width: 880px) { .brand span { display: none; } }