/*
 * แบบทดสอบวัดพื้นฐาน (pretest.php · ลิงก์ ?x=math) — หน้าตา 2 แบบตามวัย บน .qbt[data-age]
 *   kid  (ป.1–6): พื้นครีม หัวส้ม ตัวการ์ตูนคุยด้วย ปุ่มนูน ตัวเลือกสีละข้อ ดาว ด่าน
 *   teen (ม.1–6): พื้นเข้มแสงส้ม (แบบหน้าแรกโหมดมืดของเว็บใหม่) ปุ่มแคปซูลเรียบ ตัวเลือกสีเดียว
 * แบบที่อนุมัติ: https://claude.ai/artifact/TWUfiucexnUTKXvJF3ZUyg · รูปประกอบข้อสอบ: qb_figures.css (.qb-fig)
 * .kid-only / .teen-only ซ่อนชิ้นที่มีเฉพาะวัยนั้น
 */

/* ---------- โทนสี ---------- */
.qbt {
    --q-bg: #FFF6EE;
    --q-surface: #FFFFFF;
    --q-text: #1F1E1D;
    --q-sub: #524E4C;
    --q-muted: #716C69;
    --q-line: #EFE3DA;
    --q-accent: #FC4013;
    --q-accent-hover: #ED2609;
    --q-accent-dark: #C4180A;
    --q-accent-soft: #FFF3ED;
    --q-accent-text: #C4180A;
    --q-field: #FFFFFF;
    --q-field-line: #E7E6E6;
    --q-focus: #3D8BF2;
    --q-r-card: 26px;
    --q-r-btn: 18px;
    font-family: 'Anuphan', 'Noto Sans Thai', sans-serif;
    color: var(--q-text);
}
.qbt[data-age="teen"] {
    --q-bg: #121110;
    --q-surface: #1F1E1D;
    --q-text: #F6F5F5;
    --q-sub: #D2D0CF;
    --q-muted: #B5B0AD;
    --q-line: #3E3D3B;
    --q-accent-soft: rgba(252, 64, 19, .14);
    --q-accent-text: #FF8A5C;
    --q-field: #151413;
    --q-field-line: #3E3D3B;
    --q-focus: #FFE055;
    --q-r-card: 22px;
    --q-r-btn: 999px;
    color-scheme: dark;
}
.qbt *, .qbt *::before, .qbt *::after { box-sizing: border-box; }
.qbt[data-age="kid"] .teen-only, .qbt[data-age="teen"] .kid-only { display: none !important; }
body.qbt-body-kid { background: #FFF6EE; }
body.qbt-body-teen { background: #121110; }
.qbt-flow, .qbt-result { min-height: 100vh; min-height: 100dvh; background: var(--q-bg); padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
.qbt-wrap { width: 100%; max-width: 640px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.qbt-sub { margin: 0; font-size: var(--fs-sm, 14px); color: var(--q-muted); line-height: 1.55; }
.qbt-h2 { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.35; color: var(--q-text); }
.qbt-logo { height: 20px; width: auto; display: block; }
.qbt-topline { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qbt-card { background: var(--q-surface); border-radius: var(--q-r-card); padding: 20px 18px; box-shadow: 0 16px 36px rgba(124, 20, 10, .10); }
.qbt[data-age="teen"] .qbt-card { border: 1px solid #2E2D2B; box-shadow: none; }

/* ---------- ปุ่ม ---------- */
.qbt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 18px; border-radius: var(--q-r-btn); border: 2px solid transparent; font-family: inherit; font-size: 17px; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer; transition: transform .1s, background .15s; }
.qbt-btn > svg { width: 20px; height: 20px; stroke: currentColor; flex-shrink: 0; }
.qbt-btn:focus-visible { outline: 3px solid var(--q-focus); outline-offset: 2px; }
.qbt-btn:disabled { opacity: .7; cursor: default; }
.qbt-btn.is-lg { width: 100%; min-height: 56px; font-size: 18px; }
.qbt-btn.is-xl { width: 100%; min-height: 60px; font-size: 19px; }
.qbt-btn.is-sm { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: 14px; }
.qbt-btn.is-primary { background: var(--q-accent); color: #FFFFFF; box-shadow: 0 5px 0 var(--q-accent-dark); }
.qbt-btn.is-primary:hover { background: var(--q-accent-hover); color: #FFFFFF; }
.qbt-btn.is-primary:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--q-accent-dark); }
.qbt-btn.is-primary.is-off { background: #F3E6DD; color: #8A817C; box-shadow: 0 5px 0 #E5D6CB; }
.qbt-btn.is-outline { background: var(--q-surface); border-color: var(--q-line); color: var(--q-sub); box-shadow: 0 4px 0 var(--q-line); }
.qbt-btn.is-outline:hover { color: var(--q-text); }
.qbt-btn.is-line { background: #06C755; color: #FFFFFF; box-shadow: 0 8px 18px rgba(6, 199, 85, .25); border-radius: 999px; }
.qbt-btn.is-line:hover { background: #05B34C; color: #FFFFFF; }
.qbt-btn.is-messenger { background: #0866FF; color: #FFFFFF; border-radius: 999px; }
.qbt-btn.is-messenger:hover { background: #0057E0; color: #FFFFFF; }
.qbt-btn.is-warn { align-self: flex-start; background: #FFFFFF; border-color: #EDBA22; color: #7A4B00; }
.qbt-btn.is-white { background: #FFFFFF; color: #C4180A; box-shadow: 0 5px 0 rgba(124, 20, 10, .35); }
.qbt-btn.is-ghostlight { background: transparent; color: #FFFFFF; min-height: 48px; font-weight: 600; font-size: 16px; }
.qbt[data-age="teen"] .qbt-btn.is-primary { box-shadow: 0 10px 26px rgba(252, 64, 19, .3); }
.qbt[data-age="teen"] .qbt-btn.is-primary:active { transform: none; }
.qbt[data-age="teen"] .qbt-btn.is-primary.is-off { background: #2E2D2B; color: #8A8481; box-shadow: none; }
.qbt[data-age="teen"] .qbt-btn.is-outline { background: transparent; box-shadow: none; border-width: 1px; }
.qbt[data-age="teen"] .qbt-btn.is-warn { background: transparent; color: #FFD66B; border-color: #7A5A00; }
.qbt-pair { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }

/* ---------- ช่องกรอก ---------- */
.qbt-label { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 700; color: var(--q-text); }
.qbt[data-age="teen"] .qbt-label { font-size: 14px; font-weight: 600; color: var(--q-sub); }
.qbt-input { width: 100%; min-height: 54px; border: 2px solid var(--q-field-line); border-radius: 18px; padding: 0 16px; font-family: inherit; font-size: 18px; font-weight: 600; color: var(--q-text); background: var(--q-field); }
.qbt-input::placeholder { color: #A39D99; font-weight: 500; }
.qbt-input:focus { outline: none; border-color: var(--q-accent); box-shadow: 0 0 0 4px rgba(252, 64, 19, .18); }
.qbt-input.is-phone { font-size: 20px; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.qbt[data-age="teen"] .qbt-input { border-width: 1px; border-radius: 14px; }
.qbt .hs-field.is-error .qbt-input { border-color: var(--destructive, #DC2626); }
.qbt .hs-field-error { margin-top: 6px; }
.qbt[data-age="teen"] .hs-field-error { color: #FF8A80; }
.qbt-consent { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: #F6F5F5; font-size: 14px; color: var(--q-sub); line-height: 1.55; cursor: pointer; }
.qbt-consent input { width: 22px; height: 22px; margin: 0; accent-color: var(--q-accent); flex-shrink: 0; }
.qbt[data-age="teen"] .qbt-consent { background: transparent; padding: 0; color: var(--q-muted); font-size: 13px; }

/* □ ในโจทย์ = ช่องให้เติม วาดเป็นกล่อง · รูปทรงอื่นขยายให้เท่าตัวหนังสือ (qb_test.js setRich) */
.qbt-blank { display: inline-block; width: .95em; height: .95em; margin: 0 .12em; border: 2px solid currentColor; border-radius: 4px; vertical-align: -.12em; }
.qbt-sym { display: inline-block; font-family: system-ui, 'Segoe UI Symbol', sans-serif; font-size: 1.2em; line-height: 1; vertical-align: -.08em; }

/* ---------- ตัวการ์ตูนพูด ---------- */
.qbt-bubble { position: relative; background: #FFFFFF; color: #1F1E1D; border-radius: 22px; padding: 12px 16px; font-size: 16px; font-weight: 600; line-height: 1.45; box-shadow: 0 10px 24px rgba(124, 20, 10, .18); }
.qbt-bubble::after { content: ""; position: absolute; left: -7px; bottom: 18px; width: 16px; height: 16px; background: #FFFFFF; transform: rotate(45deg); border-radius: 3px; }
.qbt-bubble.is-side { padding: 9px 14px; font-size: 15px; border-radius: 18px; box-shadow: 0 6px 16px rgba(124, 20, 10, .10); }
.qbt-bubble.is-side::after { top: 50%; bottom: auto; margin-top: -7px; width: 14px; height: 14px; }
.qbt-bubble.is-pop { animation: qbt-in .3s ease-out; }
@keyframes qbt-in { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- หน้าเริ่ม ---------- */
.qbt-hero { position: relative; overflow: hidden; color: #FFFFFF; background: linear-gradient(160deg, #FC4013 0%, #FF7A3D 100%); padding: calc(18px + env(safe-area-inset-top, 0px)) 0 64px; }
.qbt-hero::before { content: ""; position: absolute; width: 360px; height: 360px; right: -150px; top: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 224, 85, .9) 0%, rgba(255, 224, 85, .35) 35%, rgba(255, 224, 85, 0) 70%); pointer-events: none; }
.qbt[data-age="teen"] .qbt-hero { background: transparent; padding-bottom: 22px; }
.qbt[data-age="teen"] .qbt-hero::before { width: 520px; height: 520px; left: 50%; right: auto; margin-left: -260px; top: -300px; background: radial-gradient(circle, rgba(252, 64, 19, .55) 0%, rgba(252, 64, 19, .18) 40%, rgba(252, 64, 19, 0) 70%); }
.qbt-hero-in { position: relative; }
.qbt-subjchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .2); font-size: 14px; font-weight: 600; }
.qbt-subjchip i { width: 7px; height: 7px; border-radius: 50%; background: #FFE055; }
.qbt[data-age="teen"] .qbt-subjchip { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.qbt[data-age="teen"] .qbt-subjchip i { background: #FC4013; }
.qbt-greet { display: flex; align-items: flex-end; gap: 4px; margin-top: 16px; }
.qbt-wave { width: 140px; height: 140px; flex-shrink: 0; filter: drop-shadow(0 10px 14px rgba(124, 20, 10, .25)); animation: qbt-wave 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes qbt-wave { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-6deg); } 20% { transform: rotate(5deg); } 30% { transform: rotate(0); } }
.qbt-greet .qbt-bubble { margin-bottom: 34px; }
.qbt-title { margin: 14px 0 0; font-size: 30px; line-height: 1.3; font-weight: 700; text-wrap: balance; }
.qbt[data-age="teen"] .qbt-title { margin-top: 30px; font-size: 34px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.qbt-title em { font-style: normal; color: #FF8A5C; }
.qbt-lead { margin: 10px 0 0; font-size: 16px; line-height: 1.6; color: #D2D0CF; }
.qbt-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.qbt-facts span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .38); font-size: 14px; font-weight: 600; white-space: nowrap; }
.qbt-facts svg { width: 16px; height: 16px; stroke: currentColor; }
.qbt-stats { display: flex; gap: 8px; margin-top: 18px; }
.qbt-stat { flex: 1; min-width: 0; padding: 12px 10px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
.qbt-stat b { display: block; font-size: 19px; font-weight: 700; line-height: 1.2; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.qbt-stat span { display: block; margin-top: 2px; font-size: 13px; color: var(--q-muted); }
/* สิ่งที่จะได้รู้ (หน้าเริ่มของเด็กโต) */
.qbt-learn { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.qbt-learn-k { font-size: 14px; font-weight: 600; color: var(--q-muted); }
.qbt-learn ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.qbt-learn li { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 600; color: #FFFFFF; line-height: 1.4; }
.qbt-learn li i { width: 26px; height: 26px; border-radius: 50%; background: rgba(252, 64, 19, .2); color: #FF8A5C; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qbt-learn li i > svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 3; }
.qbt-learn-meta { margin: 4px 0 0; font-size: 14px; color: var(--q-muted); }
.qbt-formwrap { position: relative; z-index: 2; margin-top: -40px; }
.qbt[data-age="teen"] .qbt-formwrap { margin-top: 44px; }
.qbt-peekform { position: absolute; right: 38px; top: -50px; width: 96px; height: auto; animation: qbt-peek 4s ease-in-out infinite; }
@keyframes qbt-peek { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-6px); } }
.qbt-form { position: relative; }
.qbt-form-in, .qbt-resume { display: flex; flex-direction: column; gap: 16px; }
.qbt-resume b { font-size: 17px; }
.qbt-grades { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.qbt-grades.is-few { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qbt-tracks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
#qbtTrackField[hidden] { display: none; }
.qbt-grade { min-height: 48px; padding: 0; border-radius: 16px; border: 2px solid var(--q-field-line); background: var(--q-surface); font-family: inherit; font-size: 16px; font-weight: 700; color: var(--q-sub); cursor: pointer; box-shadow: 0 3px 0 var(--q-field-line); }
.qbt-grade.is-on { background: var(--q-accent); border-color: var(--q-accent); color: #FFFFFF; box-shadow: 0 3px 0 var(--q-accent-dark); }
.qbt-grade:focus-visible { outline: 3px solid var(--q-focus); outline-offset: 2px; }
.qbt[data-age="teen"] .qbt-grade { border-width: 1px; border-radius: 12px; background: transparent; box-shadow: none; font-weight: 600; }
.qbt[data-age="teen"] .qbt-grade.is-on { background: var(--q-accent); }
.qbt-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border-radius: 18px; background: #FFFFFF; border: 1px dashed #F0C9B5; }
.qbt-note > svg { width: 20px; height: 20px; stroke: #C4180A; flex-shrink: 0; margin-top: 2px; }
.qbt-note p { margin: 0; font-size: 14px; line-height: 1.55; color: #524E4C; }
.qbt-note b { color: #1F1E1D; }
.qbt-tips { display: flex; justify-content: center; gap: 16px; margin-top: 22px; font-size: 13px; color: var(--q-muted); }
.qbt-tips span { display: inline-flex; align-items: center; gap: 5px; }
.qbt-tips svg { width: 14px; height: 14px; stroke: currentColor; }

/* ---------- หน้าจอทำข้อสอบ (เต็มจอ ไม่มีหัวส้ม ให้น้องโฟกัส) ---------- */
.qbt-run { position: fixed; inset: 0; z-index: 1100; display: flex; flex-direction: column; background: var(--q-bg); }
.qbt-run[hidden] { display: none; }
.qbt-run-in { width: 100%; max-width: 640px; margin: 0 auto; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.qbt-top { display: flex; align-items: center; gap: 8px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 0; }
.qbt-icon { width: 44px; height: 44px; border-radius: 14px; border: 2px solid var(--q-line); background: var(--q-surface); color: var(--q-sub); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.qbt-icon > svg { width: 20px; height: 20px; stroke: currentColor; }
.qbt-icon.is-ghost { border-color: transparent; background: transparent; }
.qbt-icon:disabled { opacity: .3; cursor: default; }
.qbt-icon:focus-visible { outline: 3px solid var(--q-focus); outline-offset: 2px; }
.qbt[data-age="teen"] .qbt-icon { border-radius: 50%; border-width: 1px; background: transparent; }
.qbt[data-age="teen"] .qbt-icon.is-ghost { border-color: transparent; }
.qbt-count { flex: 1; min-width: 0; text-align: center; line-height: 1.25; }
.qbt-stage { font-size: 13px; font-weight: 600; color: #C4180A; }
.qbt-num { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.qbt-num span { color: #8A8481; font-weight: 500; }
.qbt[data-age="teen"] .qbt-count { text-align: left; }
.qbt-saved { font-size: 12px; font-weight: 600; color: var(--destructive, #DC2626); }
.qbt-saved:empty { display: none; }
.qbt-starpill { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 10px; border-radius: 999px; background: #FFE98A; color: #7A4B00; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; box-shadow: 0 3px 0 #EDBA22; flex-shrink: 0; }
.qbt-starpill.is-big { height: auto; padding: 5px 12px; font-size: 15px; background: #FFE055; box-shadow: none; }
.qbt-plus { position: absolute; right: calc(100% + 6px); top: 9px; padding: 2px 8px; border-radius: 999px; background: #FC4013; color: #FFFFFF; font-size: 13px; font-weight: 700; opacity: 0; }
.qbt-plus.is-go { animation: qbt-plus 1.2s ease-out forwards; }
@keyframes qbt-plus { 0% { transform: translateY(10px) scale(.6); opacity: 0; } 25% { transform: none; opacity: 1; } 70% { opacity: 1; } 100% { transform: translateY(-12px); opacity: 0; } }
.qbt-pct { font-size: 14px; font-weight: 700; color: #FF8A5C; font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 40px; text-align: right; }
/* เส้นทางด่าน */
.qbt-track { position: relative; display: flex; align-items: center; gap: 3px; height: 14px; margin: 46px 18px 6px; }
.qbt-dot { flex: 1; height: 10px; border-radius: 5px; background: #EFE3DA; transition: background-color .35s ease, height .25s ease, border-color .25s ease; }
.qbt-dot.is-done { background: #FC4013; }
.qbt-dot.is-skip { background: #EDBA22; }
.qbt-dot.is-cur { height: 14px; background: #FFFFFF; border: 2.5px solid #FC4013; }
.qbt-dot.is-gap { margin-right: 6px; }
.qbt-flag { position: absolute; top: -24px; width: 20px; height: 20px; margin-left: -10px; color: #C4180A; }
.qbt-flag { transition: color .3s ease; transform-origin: 20% 100%; }
.qbt-flag.is-got { color: #1F9D63; animation: qbt-flag .7s ease-out; }
@keyframes qbt-flag { 0% { transform: scale(1); } 30% { transform: scale(1.5) rotate(-12deg); } 60% { transform: scale(1.1) rotate(6deg); } 100% { transform: none; } }
.qbt-flag svg { display: block; }
.qbt-head { position: absolute; top: -38px; width: 44px; height: auto; margin-left: -22px; transition: left .55s cubic-bezier(.3, 1.4, .5, 1); }
/* แถบด่าน (เด็กโต) */
.qbt-segs { display: flex; gap: 6px; padding: 14px 16px 0; }
.qbt-seg { flex: 1; height: 6px; border-radius: 3px; background: #2E2D2B; overflow: hidden; }
.qbt-seg i { display: block; height: 100%; background: #FC4013; border-radius: 3px; transition: width .4s ease; }
/* โจทย์ */
.qbt-qbody { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px 12px; }
.qbt-qcard { display: flex; flex-direction: column; gap: 16px; background: var(--q-surface); border-radius: var(--q-r-card); padding: 20px 18px; box-shadow: 0 10px 30px rgba(124, 20, 10, .08); }
.qbt[data-age="teen"] .qbt-qcard { background: transparent; box-shadow: none; padding: 8px 0 0; gap: 18px; }
.qbt-topic-tag { align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--q-muted); padding: 4px 10px; border-radius: 999px; background: var(--q-surface); }
.qbt-passage { background: #FFF9F4; border-radius: 18px; padding: 14px 16px; font-size: 16px; line-height: 1.7; white-space: pre-line; }
.qbt-passage-k { display: block; font-size: 13px; font-weight: 600; color: var(--q-muted); margin-bottom: 4px; }
.qbt[data-age="teen"] .qbt-passage { background: #1A1918; border: 1px solid #2E2D2B; }
.qbt-stem { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.qbt[data-age="teen"] .qbt-stem { font-size: 20px; color: #FFFFFF; }
.qbt-fig { --fig-bg: #FFF9F4; background: var(--fig-bg); border-radius: 18px; }
.qbt[data-age="teen"] .qbt-fig {
    --fig-bg: #1A1918; --fig-paper: #2A2826; --fig-ink: #F6F5F5; --fig-sub: #B5B0AD; --fig-grid: #4A4846;
    --fig-soft: rgba(252, 64, 19, .22); --fig-n: #3E3D3B; --fig-c4: #6B6663;
    border: 1px solid #2E2D2B;
}
.qbt-opts { display: flex; flex-direction: column; gap: 10px; }
.qbt-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 14px 10px 10px; border: 2px solid var(--q-line); border-radius: 18px; background: var(--q-surface); font-family: inherit; font-size: 19px; font-weight: 600; color: var(--q-text); text-align: left; cursor: pointer; box-shadow: 0 4px 0 var(--q-line); overflow-wrap: anywhere; }
.qbt-opt:focus-visible { outline: 3px solid var(--q-focus); outline-offset: 2px; }
.qbt-opt[aria-pressed="true"] { border-color: #FC4013; background: #FFF3ED; box-shadow: 0 4px 0 #FC4013; animation: qbt-pop .35s ease-out; }
@keyframes qbt-pop { 40% { transform: scale(1.03); } }
.qbt-let { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; color: #FFFFFF; flex-shrink: 0; background: #FF6A2B; }
.qbt-opt:nth-child(2) .qbt-let { background: #3D8BF2; }
.qbt-opt:nth-child(3) .qbt-let { background: #1F9D63; }
.qbt-opt:nth-child(4) .qbt-let { background: #8B5CF6; }
.qbt-opt-text { min-width: 0; flex: 1; }
.qbt-tick { display: none; width: 28px; height: 28px; border-radius: 50%; background: #FC4013; color: #FFFFFF; align-items: center; justify-content: center; flex-shrink: 0; }
.qbt-tick > svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 3; }
.qbt-opt[aria-pressed="true"] .qbt-tick { display: inline-flex; }
.qbt[data-age="teen"] .qbt-opt { border-width: 1px; border-radius: 16px; min-height: 56px; font-size: 18px; box-shadow: none; }
.qbt[data-age="teen"] .qbt-opt[aria-pressed="true"] { border-color: #FC4013; background: rgba(252, 64, 19, .14); box-shadow: inset 0 0 0 1px #FC4013; animation: none; }
.qbt[data-age="teen"] .qbt-let, .qbt[data-age="teen"] .qbt-opt .qbt-let { width: 34px; height: 34px; border-radius: 10px; border: 1px solid #4A4846; background: transparent; color: #B5B0AD; font-size: 15px; }
.qbt[data-age="teen"] .qbt-opt[aria-pressed="true"] .qbt-let { background: #FC4013; border-color: #FC4013; color: #FFFFFF; }
.qbt[data-age="teen"] .qbt-tick { display: none !important; }
.qbt-foot { display: flex; flex-direction: column; gap: 12px; padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.qbt-buddy { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.qbt-buddy img { width: 64px; height: 64px; flex-shrink: 0; }
.qbt-toast { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 6px; border-radius: 18px; background: #2A2826; border: 1px solid #4A4846; animation: qbt-toast .45s cubic-bezier(.3, 1.4, .5, 1); }
.qbt-toast img { width: 70px; height: auto; flex-shrink: 0; }
.qbt-toast b { display: block; font-size: 15px; color: #FFFFFF; }
.qbt-toast span { font-size: 13px; color: #B5B0AD; }
@keyframes qbt-toast { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- ผ่านด่าน (เด็กเล็ก) ---------- */
.qbt-cp { position: fixed; inset: 0; z-index: 1105; overflow: hidden auto; background: linear-gradient(170deg, #FF7A3D 0%, #FC4013 55%, #ED2609 100%); color: #FFFFFF; }
.qbt-cp::before { content: ""; position: absolute; width: 520px; height: 520px; left: 50%; margin-left: -260px; top: 40px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 224, 85, .75) 0%, rgba(255, 224, 85, .25) 40%, rgba(255, 224, 85, 0) 70%); pointer-events: none; }
.qbt-cp-in { position: relative; min-height: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; padding: calc(40px + env(safe-area-inset-top, 0px)) 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
.qbt-cf { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; background: #FFE055; animation: qbt-fall 3.2s linear infinite; }
.qbt-cf:nth-child(2n) { background: #FFFFFF; animation-duration: 3.8s; }
.qbt-cf:nth-child(3n) { background: #3D8BF2; }
.qbt-cf:nth-child(5n) { background: #8B5CF6; animation-duration: 2.9s; }
@keyframes qbt-fall { to { transform: translateY(110vh) rotate(540deg); } }
.qbt-cp-chip { padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .2); font-size: 14px; font-weight: 700; }
.qbt-jump { width: 170px; height: 170px; margin-top: 18px; filter: drop-shadow(0 14px 16px rgba(124, 20, 10, .3)); animation: qbt-jump 1.4s ease-in-out infinite; }
@keyframes qbt-jump { 50% { transform: translateY(-10px); } }
.qbt-cp-title { margin: 8px 0 0; font-size: 36px; line-height: 1.25; font-weight: 700; }
.qbt-cp-text { margin: 8px 0 0; font-size: 17px; line-height: 1.55; }
.qbt-cp-stars { margin-top: 22px; display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 20px; background: #FFFFFF; color: #1F1E1D; box-shadow: 0 6px 0 rgba(124, 20, 10, .25); text-align: left; line-height: 1.25; }
.qbt-cp-stars b { font-size: 26px; font-variant-numeric: tabular-nums; }
.qbt-cp-stars small { display: block; font-size: 13px; color: #716C69; }
.qbt-cp-map { position: relative; width: 100%; display: flex; margin-top: 26px; padding: 16px 8px; border-radius: 24px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); }
.qbt-stop { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.qbt-isle { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.qbt-isle svg { width: 24px; height: 24px; }
.qbt-isle.is-got { background: #FFFFFF; color: #1F9D63; box-shadow: 0 4px 0 rgba(124, 20, 10, .25); }
.qbt-isle.is-got svg { stroke: currentColor; stroke-width: 3; }
.qbt-isle.is-next { background: #FFE055; color: #7A4B00; box-shadow: 0 4px 0 #EDBA22; outline: 3px dashed rgba(255, 255, 255, .8); outline-offset: 4px; }
.qbt-isle.is-lock { background: rgba(255, 255, 255, .18); border: 2px solid rgba(255, 255, 255, .4); color: #FFFFFF; }
.qbt-isle.is-lock svg { stroke: currentColor; }
.qbt-cp-actions { width: 100%; margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- ตรวจก่อนส่ง ---------- */
.qbt-fin { position: fixed; inset: 0; z-index: 1105; overflow-y: auto; background: var(--q-bg); }
.qbt-fin-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center; color: #FFFFFF; background: linear-gradient(170deg, #FF7A3D 0%, #FC4013 100%); padding: calc(36px + env(safe-area-inset-top, 0px)) 16px 70px; }
.qbt[data-age="teen"] .qbt-fin-hero { background: radial-gradient(circle at 50% -40%, rgba(252, 64, 19, .5) 0%, rgba(252, 64, 19, 0) 60%); padding-bottom: 24px; align-items: flex-start; text-align: left; max-width: 640px; margin: 0 auto; }
.qbt-ray { position: absolute; left: 50%; top: 50%; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 255, 255, .16) 0deg 10deg, rgba(255, 255, 255, 0) 10deg 24deg); animation: qbt-spin 26s linear infinite; }
@keyframes qbt-spin { to { transform: rotate(360deg); } }
.qbt-fin-art { position: relative; display: flex; align-items: flex-end; justify-content: center; }
.qbt-fin-art img { position: relative; z-index: 2; width: 130px; height: 130px; margin-right: -26px; filter: drop-shadow(0 10px 12px rgba(124, 20, 10, .3)); }
.qbt-badge { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 132px; height: 132px; border-radius: 50%; background: #FFE055; border: 6px solid #FFFFFF; box-shadow: 0 8px 0 #EDBA22, 0 16px 30px rgba(124, 20, 10, .25); color: #7A4B00; animation: qbt-badge .7s cubic-bezier(.3, 1.6, .5, 1); }
.qbt-badge > svg { width: 40px; height: 40px; stroke: currentColor; }
.qbt-badge span { font-size: 14px; font-weight: 700; line-height: 1.2; margin-top: 2px; }
@keyframes qbt-badge { from { transform: scale(.3) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.qbt-fin-title { position: relative; margin: 16px 0 0; font-size: 32px; line-height: 1.25; font-weight: 700; }
.qbt[data-age="teen"] .qbt-fin-title { margin-top: 8px; font-size: 30px; font-weight: 600; }
.qbt-fin-text { position: relative; margin: 6px 0 0; font-size: 17px; }
.qbt[data-age="teen"] .qbt-fin-text { color: var(--q-muted); font-size: 16px; }
.qbt-fin-body { position: relative; z-index: 2; max-width: 640px; margin: -44px auto 0; padding: 0 16px calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
.qbt[data-age="teen"] .qbt-fin-body { margin-top: 0; }
.qbt-fin-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.qbt-fin-msg { display: flex; align-items: center; gap: 10px; }
.qbt-fin-msg img { width: 60px; height: auto; flex-shrink: 0; }
.qbt-fin-msg p { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.45; }
.qbt-qmap { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.qbt-cell { min-height: 40px; padding: 0; border: 0; border-radius: 12px; font-family: inherit; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; background: #FFF3ED; color: #C4180A; cursor: pointer; }
.qbt-cell.is-skip { background: #FFF4CC; color: #7A4B00; box-shadow: inset 0 0 0 2px #EDBA22; }
.qbt-cell:focus-visible { outline: 3px solid var(--q-focus); outline-offset: 1px; }
.qbt[data-age="teen"] .qbt-cell { background: #2A2826; color: #D2D0CF; border-radius: 10px; }
.qbt[data-age="teen"] .qbt-cell.is-skip { background: rgba(237, 186, 34, .14); color: #FFD66B; box-shadow: inset 0 0 0 1px #7A5A00; }
.qbt-handnote { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 20px; background: #FFFFFF; border: 2px dashed #F0C9B5; }
.qbt-handnote > svg { width: 32px; height: 32px; stroke: #C4180A; flex-shrink: 0; }
.qbt-handnote p { margin: 0; font-size: 15px; line-height: 1.5; color: #524E4C; }
.qbt-handnote b { color: #1F1E1D; }

/* หน้าต่างพักไว้ก่อน */
.qbt-dim { position: fixed; inset: 0; z-index: 1110; background: rgba(31, 30, 29, .45); }
.qbt-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1111; max-width: 640px; margin: 0 auto; background: #FFFFFF; border-radius: 32px 32px 0 0; padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; font-family: 'Anuphan', sans-serif; color: #1F1E1D; --q-accent: #FC4013; --q-accent-hover: #ED2609; --q-accent-dark: #C4180A; --q-r-btn: 18px; --q-muted: #716C69; --q-text: #1F1E1D; }
.qbt-dim[hidden], .qbt-sheet[hidden] { display: none; }
.qbt-grab { width: 40px; height: 4px; border-radius: 2px; background: #D2D0CF; align-self: center; }

/* ---------- ส่งต่อให้ผู้ปกครอง ---------- */
.qbt-hand { display: flex; flex-direction: column; gap: 18px; padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
.qbt-hand-head { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 24px; background: #FFFFFF; }
.qbt-hand-head img { flex-shrink: 0; height: auto; }
.qbt[data-age="teen"] .qbt-hand-head { padding: 0; background: transparent; justify-content: space-between; align-items: flex-end; }
.qbt-okchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: #FFF3ED; font-size: 13px; font-weight: 700; color: var(--q-accent-text); }
.qbt-okchip > svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 3; }
.qbt[data-age="teen"] .qbt-okchip { padding: 0; background: transparent; }
.qbt-hand-title { margin: 6px 0 0; font-size: 22px; line-height: 1.35; font-weight: 700; text-wrap: balance; }
.qbt[data-age="teen"] .qbt-hand-title { font-size: 30px; font-weight: 600; color: #FFFFFF; }
.qbt[data-age="teen"] .qbt-hand .qbt-stats { margin-top: 0; }
.qbt[data-age="teen"] .qbt-hand .qbt-stat { background: var(--q-surface); border-color: #2E2D2B; }
.qbt-forparent h2 { margin: 0; font-size: 20px; font-weight: 700; }
.qbt-forparent p { margin: 4px 0 0; font-size: 15px; color: var(--q-sub); line-height: 1.6; }
.qbt-gets { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.qbt-gets li { display: flex; align-items: center; gap: 12px; font-size: 15px; line-height: 1.45; }
.qbt-gets i { width: 36px; height: 36px; border-radius: 12px; background: #FFF3ED; color: #C4180A; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qbt-gets i > svg { width: 18px; height: 18px; stroke: currentColor; }
.qbt-hand-h2 { margin: 0; font-size: 17px; font-weight: 700; color: #FFFFFF; }
.qbt-picks { display: flex; gap: 8px; }
.qbt-pick { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border-radius: 16px; border: 2px solid var(--q-line); background: var(--q-surface); color: var(--q-sub); font-family: inherit; font-size: 14px; font-weight: 600; text-align: left; line-height: 1.35; cursor: pointer; }
.qbt-pick > svg { width: 22px; height: 22px; stroke: var(--q-accent-text); }
.qbt-pick[aria-pressed="true"] { border-color: #FC4013; background: var(--q-accent-soft); color: var(--q-text); }
.qbt-pick:focus-visible { outline: 3px solid var(--q-focus); outline-offset: 2px; }
.qbt[data-age="teen"] .qbt-pick { border-width: 1px; background: transparent; }
.qbt-panel { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 20px; background: var(--q-surface); }
.qbt-panel[hidden] { display: none; }
.qbt[data-age="teen"] .qbt-panel { border: 1px solid #2E2D2B; }
.qbt-panel-text { margin: 0; font-size: 14px; color: var(--q-sub); line-height: 1.6; }
.qbt-linkrow { display: flex; gap: 8px; align-items: center; }
.qbt-linkbox { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px; background: var(--q-field); border: 1px solid var(--q-field-line); font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; }

/* ---------- หน้าผล ---------- */
.qbt-rhero { position: relative; overflow: hidden; color: #FFFFFF; background: linear-gradient(165deg, #FF7A3D 0%, #FC4013 100%); border-radius: 0 0 32px 32px; padding: calc(20px + env(safe-area-inset-top, 0px)) 0 22px; }
.qbt-rhero::before { content: ""; position: absolute; width: 380px; height: 380px; right: -170px; top: -170px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 224, 85, .85) 0%, rgba(255, 224, 85, .3) 40%, rgba(255, 224, 85, 0) 70%); pointer-events: none; }
.qbt[data-age="teen"] .qbt-rhero { background: #121110; }
.qbt[data-age="teen"] .qbt-rhero::before { width: 440px; height: 440px; right: -200px; top: -220px; background: radial-gradient(circle, rgba(252, 64, 19, .5) 0%, rgba(252, 64, 19, 0) 70%); }
.qbt-rhero-in { position: relative; display: flex; flex-direction: column; gap: 14px; }
.qbt-rlabel { font-size: 13px; font-weight: 700; letter-spacing: .3px; opacity: .95; }
.qbt-rid { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.qbt-rid h1 { margin: 0; font-size: 30px; line-height: 1.25; font-weight: 700; }
.qbt-rid-text { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.qbt-rmascot { width: 120px; height: 120px; flex-shrink: 0; filter: drop-shadow(0 10px 12px rgba(124, 20, 10, .3)); }
.qbt[data-age="teen"] .qbt-rid { align-items: flex-end; }
.qbt[data-age="teen"] .qbt-rid h1 { font-size: 28px; font-weight: 600; }
.qbt[data-age="teen"] .qbt-rid img { width: 92px; height: auto; margin-bottom: -6px; }
.qbt-kvs { display: flex; gap: 8px; }
.qbt-kv { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); }
.qbt-kv small { display: block; font-size: 12px; opacity: .9; }
.qbt-kv b { display: block; font-size: 16px; line-height: 1.3; }
.qbt-rungs { display: flex; flex-direction: column; gap: 8px; }
.qbt-rung { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #1F1E1D; border: 1px solid #2E2D2B; }
.qbt-rung.is-cur { border-color: #FC4013; background: rgba(252, 64, 19, .12); }
.qbt-rung-k { width: 44px; font-size: 17px; font-weight: 700; flex-shrink: 0; }
.qbt-rung-v { flex: 1; min-width: 0; font-size: 14px; color: #D2D0CF; display: flex; flex-direction: column; gap: 6px; }
.qbt-rung-row { display: flex; justify-content: space-between; font-size: 13px; }
.qbt-rung-row b { color: #FF8A5C; }
.qbt-rung-row span { color: #B5B0AD; }
.qbt-rung-ok { width: 28px; height: 28px; border-radius: 50%; background: #1F9D63; color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qbt-rung-ok > svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 3; }
.qbt-tagset { display: flex; flex-direction: column; gap: 8px; }
.qbt-tagset-k { font-size: 13px; font-weight: 600; color: #B5B0AD; }
.qbt-tagset > div { display: flex; flex-wrap: wrap; gap: 6px; }
.qbt-tag { display: inline-flex; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.qbt-tag.is-good { background: rgba(31, 157, 99, .18); color: #7BE0AE; }
.qbt-tag.is-weak { background: rgba(252, 64, 19, .18); color: #FF9F7A; }
/* ส่วนของผู้ปกครอง: สว่างเสมอ */
.qbt-rbody { display: flex; flex-direction: column; gap: 16px; padding-top: 20px; color: #1F1E1D; }
.qbt[data-age="teen"] .qbt-rbody { --q-muted: #716C69; --q-text: #1F1E1D; }
.qbt-result[data-age="teen"] { background: #F6F5F5; }
.qbt-forlabel { display: flex; align-items: center; gap: 8px; padding: 0 4px; font-size: 15px; font-weight: 700; color: #524E4C; }
.qbt-forlabel > svg { width: 20px; height: 20px; stroke: #C4180A; }
.qbt-rcard { background: #FFFFFF; border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 8px 24px rgba(124, 20, 10, .07); }
.qbt-scorecard { flex-direction: row; align-items: center; gap: 16px; }
.qbt-scorecard svg { flex-shrink: 0; }
.qbt-scorecard svg text { font-family: 'Anuphan', sans-serif; }
.qbt-scorecard-text { min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.qbt-scorecard-head { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.5; }
.qbt-chip { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.qbt-chip.is-success { background: #DDF4E8; color: #136B42; }
.qbt-chip.is-warning { background: #FFF4CC; color: #7A4B00; }
.qbt-chip.is-brand { background: #FFE3D6; color: #9C1510; }
.qbt-steps { display: flex; align-items: flex-end; gap: 10px; min-height: 200px; padding-top: 14px; }
.qbt-step { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qbt-step-blk { width: 100%; border-radius: 14px 14px 6px 6px; display: flex; flex-direction: column; align-items: center; padding-top: 10px; font-variant-numeric: tabular-nums; }
.qbt-step-blk b { font-size: 20px; }
.qbt-step-blk span { font-size: 12px; font-weight: 600; }
.qbt-step-blk.is-start { box-shadow: inset 0 0 0 2.5px #FC4013; }
.qbt-step-k { font-size: 15px; }
.qbt-step-flag { position: absolute; top: -14px; z-index: 1; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: #1F1E1D; color: #FFFFFF; font-size: 12px; font-weight: 700; white-space: nowrap; }
.qbt-advice { margin: 0; padding: 12px 14px; border-radius: 16px; background: #FFF3ED; font-size: 15px; line-height: 1.6; }
.qbt-miscon { display: flex; gap: 12px; align-items: flex-start; }
.qbt-miscon i { width: 34px; height: 34px; border-radius: 11px; background: #FFF4CC; color: #7A4B00; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qbt-miscon i > svg { width: 18px; height: 18px; stroke: currentColor; }
.qbt-miscon p { margin: 0; font-size: 15px; line-height: 1.6; }
.qbt-topic { display: flex; flex-direction: column; gap: 6px; }
.qbt-topic + .qbt-topic { margin-top: 12px; padding-top: 12px; border-top: 1px solid #F1ECE8; }
.qbt-topic-head { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.qbt-topic-head span { font-size: 14px; color: #716C69; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qbt-bar { height: 10px; border-radius: 5px; background: #F1ECE8; overflow: hidden; }
.qbt-bar i { display: block; height: 100%; border-radius: 5px; }
.qbt-bar.is-dark { height: 8px; background: #2E2D2B; }
.qbt-bar.is-dark i { background: #FC4013; }
.qbt-fah { background: #F2FBF5; box-shadow: none; border: 1.5px solid #BFE8CF; }
.qbt-fah-head { display: flex; gap: 12px; align-items: center; }
.qbt-fah-head img { flex-shrink: 0; }
.qbt-fah-head .qbt-sub { color: #524E4C; }
/* การ์ดวางแผนจากผลนี้ (เว็บใหม่ /plan/): การ์ดขาวปกติ ปุ่มหลักส้ม + ปุ่มรองแชทฟ้าแบบเส้นขอบ */
.qbt-fah.is-plan { background: #FFFFFF; border-color: transparent; box-shadow: 0 8px 24px rgba(124, 20, 10, .07); }
.qbt-planlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qbt-planlist li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.5; }
.qbt-planck { width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: #FFF3ED; color: #C4180A; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qbt-planck > svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 3; }
.qbt-btn.is-line-outline { background: #FFFFFF; border-color: #06C755; color: #06893B; border-radius: 999px; }
.qbt-btn.is-line-outline:hover { background: #F2FBF5; color: #06893B; }
.qbt-btn.is-messenger-outline { background: #FFFFFF; border-color: #0866FF; color: #0057E0; border-radius: 999px; }
.qbt-btn.is-messenger-outline:hover { background: #EEF4FF; color: #0057E0; }
.qbt-altchat { align-self: center; padding: 6px 10px; font-size: 14px; font-weight: 600; color: #0057E0; text-decoration: underline; text-underline-offset: 3px; }
.qbt-altchat:hover { color: #0046B5; }
.qbt-more-head { display: flex; align-items: center; gap: 10px; }
.qbt-more-head img { flex-shrink: 0; height: auto; }
.qbt-subjrow { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 14px; border-radius: 18px; border: 2px solid #EFE3DA; background: #FFFFFF; color: #1F1E1D; text-decoration: none; font-weight: 700; font-size: 16px; box-shadow: 0 3px 0 #EFE3DA; }
.qbt-subjrow:hover { color: #1F1E1D; border-color: #FC4013; }
.qbt-subjrow:focus-visible { outline: 3px solid #3D8BF2; outline-offset: 2px; }
.qbt-subjicon { width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: #FFF3ED; color: #C4180A; flex-shrink: 0; }
.qbt-subjicon > svg { width: 20px; height: 20px; stroke: currentColor; }
.qbt-subjicon.is-english { background: #E6F0FE; color: #2763C4; }
.qbt-subjicon.is-science { background: #E3F6EC; color: #136B42; }
.qbt-subjicon.is-thai { background: #FBF3C6; color: #985910; }
.qbt-subjicon.is-social { background: #F0F9FF; color: #0284C7; }
.qbt-subjicon.is-chinese { background: #FEF2F2; color: #B91C1C; }
.qbt-subjicon.is-physics, .qbt-subjicon.is-earth { background: #F0F9FF; color: #0284C7; }
.qbt-subjicon.is-chemistry { background: #FBF3C6; color: #985910; }
.qbt-subjicon.is-biology { background: #E3F6EC; color: #136B42; }
.qbt-go { margin-left: auto; width: 18px; height: 18px; stroke: currentColor; }
.qbt-code { margin: 0; text-align: center; font-size: 13px; color: #716C69; }
.qbt-code b { color: #524E4C; letter-spacing: .5px; font-variant-numeric: tabular-nums; }

/* คอลัมน์ของหน้าส่งต่อ / หน้าผล — มือถือเรียงต่อกันตามลำดับอ่าน (qbt-ord-N) */
.qbt-hand-info, .qbt-hand-act { display: flex; flex-direction: column; gap: 18px; }
.qbt-rcol { display: contents; }
.qbt-ord-1 { order: 1; } .qbt-ord-2 { order: 2; } .qbt-ord-3 { order: 3; } .qbt-ord-4 { order: 4; }
.qbt-ord-5 { order: 5; } .qbt-ord-6 { order: 6; } .qbt-ord-7 { order: 7; }

/* ---------- เลือกวิชา (หน้าหัวส้มเดิม) ---------- */
.qbt-subject-pick { display: flex; flex-direction: column; gap: 10px; }

@media (min-width: 768px) {
    .qbt-qbody { padding: 22px 24px 12px; }
    .qbt-foot { padding-left: 24px; padding-right: 24px; }
    .qbt-track { margin-left: 26px; margin-right: 26px; }
}

/* ---------- จอกว้าง (คอม / ไอแพดแนวนอน): กรอบ 1140 แบบหน้าเว็บหลัก แบ่งซ้าย-ขวา ---------- */
@media (min-width: 960px) {
    .qbt { --gut: max(32px, calc((100% - 1140px) / 2)); }
    .qbt-wrap { max-width: 1204px; padding-left: 32px; padding-right: 32px; }

    /* หน้าเริ่ม: ซ้าย = ตัวการ์ตูน + หัวข้อ, ขวา = กล่องกรอกชื่อ เต็มจอ */
    .qbt-start { position: relative; overflow: hidden; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) 460px; column-gap: 72px; align-items: center; padding: 112px var(--gut) 64px; background: linear-gradient(160deg, #FC4013 0%, #FF7A3D 100%); }
    .qbt[data-age="teen"] .qbt-start { background: #121110; }
    .qbt-start .qbt-wrap { max-width: none; padding: 0; }
    .qbt-hero, .qbt[data-age="teen"] .qbt-hero { position: static; overflow: visible; background: none; padding: 0; }
    .qbt-hero-in { position: static; }
    .qbt-hero::before { width: 680px; height: 680px; right: -220px; top: -260px; }
    .qbt[data-age="teen"] .qbt-hero::before { width: 900px; height: 900px; left: 30%; top: -520px; }
    .qbt-topline { position: absolute; top: 36px; left: var(--gut); right: var(--gut); }
    .qbt-logo { height: 24px; }
    .qbt-greet { margin-top: 0; }
    .qbt-wave { width: 150px; height: 150px; }
    .qbt-greet .qbt-bubble { font-size: 18px; padding: 14px 20px; }
    .qbt-title { font-size: 52px; line-height: 1.22; }
    .qbt[data-age="teen"] .qbt-title { margin-top: 0; font-size: 56px; line-height: 1.2; }
    .qbt-lead { font-size: 18px; max-width: 540px; }
    .qbt-facts { margin-top: 20px; gap: 8px; }
    .qbt-facts span { padding: 9px 14px; font-size: 15px; }
    .qbt-stats { max-width: 580px; margin-top: 24px; }
    .qbt-learn { margin-top: 28px; }
    .qbt-learn li { font-size: 19px; }
    .qbt-formwrap, .qbt[data-age="teen"] .qbt-formwrap { margin-top: 0; }
    .qbt[data-age="teen"] .qbt-side { padding-top: 50px; }
    .qbt-form { padding: 26px 24px; }

    /* หน้าส่งต่อ: ซ้าย = สรุป, ขวา = กรอกเบอร์ */
    .qbt-hand { display: grid; grid-template-columns: minmax(0, 1fr) 460px; column-gap: 64px; align-items: start; padding-top: 72px; }
    .qbt-hand-title { font-size: 30px; }
    .qbt[data-age="teen"] .qbt-hand-title { font-size: 40px; }

    /* ทำข้อสอบ: กว้างเท่ากรอบเว็บ ตัวเลือก 2 คอลัมน์ ตัวการ์ตูนกับปุ่มอยู่แถวเดียวกัน */
    .qbt-run-in { max-width: 1204px; padding: 0 32px; }
    .qbt-top, .qbt-segs, .qbt-qbody, .qbt-foot { padding-left: 0; padding-right: 0; }
    .qbt-track { margin-left: 8px; margin-right: 8px; }
    .qbt-qcard { padding: 28px 32px; gap: 20px; }
    .qbt-stem { font-size: 24px; }
    .qbt[data-age="teen"] .qbt-stem { font-size: 24px; }
    .qbt-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .qbt-fig svg { max-height: 340px; width: auto; }
    .qbt-foot { flex-direction: row; align-items: center; gap: 24px; }
    .qbt-buddy, .qbt-toast { flex: 1; min-width: 0; }
    .qbt-foot .qbt-pair { width: 480px; flex-shrink: 0; margin-left: auto; }

    /* หน้าผล: หัวแบ่งซ้าย-ขวา เนื้อหา 2 คอลัมน์ */
    .qbt-rhero { padding-top: 32px; padding-bottom: 36px; border-radius: 0 0 40px 40px; }
    .qbt-rhero-in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 40px; align-items: center; }
    .qbt-rhero-in > .qbt-topline { position: static; grid-column: 1 / -1; }
    .qbt-rid { justify-content: flex-start; gap: 28px; }
    .qbt-rid h1 { font-size: 40px; }
    .qbt-kvs { align-self: center; }
    .qbt-rmascot { width: 150px; height: 150px; }
    .qbt[data-age="teen"] .qbt-rid { grid-column: 1 / -1; }
    .qbt-rungs { grid-column: 1; grid-row: 3 / span 2; }
    .qbt-tagset { grid-column: 2; align-self: start; }
    .qbt-rbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; align-items: start; padding-top: 28px; }
    .qbt-forlabel, .qbt-code { grid-column: 1 / -1; }
    .qbt-rcol { display: flex; flex-direction: column; gap: 20px; }
}

/* ---------- การเคลื่อนไหว ---------- */
/* ปุ่ม: กดแล้วยุบ / ชี้แล้วลอยเล็กน้อย */
.qbt-btn, .qbt-grade, .qbt-opt, .qbt-pick, .qbt-cell, .qbt-subjrow, .qbt-icon { transition: transform .15s ease, box-shadow .15s ease, background-color .2s ease, border-color .2s ease, color .2s ease; }
.qbt-btn:active, .qbt-pick:active, .qbt-cell:active, .qbt-icon:active { transform: scale(.97); }
.qbt-opt:active { transform: translateY(2px); }
@media (hover: hover) {
    .qbt-opt:hover { border-color: #F5B79C; }
    .qbt[data-age="teen"] .qbt-opt:hover { border-color: #6B6663; }
    .qbt-grade:hover { transform: translateY(-2px); }
    .qbt-subjrow:hover { transform: translateY(-2px); }
}
.qbt-grade.is-on { animation: qbt-chip .32s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes qbt-chip { 0% { transform: scale(.9); } 60% { transform: scale(1.08); } 100% { transform: none; } }
.qbt-starpill.is-bump { animation: qbt-bump .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes qbt-bump { 40% { transform: scale(1.18) rotate(-4deg); } }
.qbt-seg i { transition: width .5s cubic-bezier(.3, 1.2, .5, 1); }

/* เข้า / ออก */
@keyframes qbt-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes qbt-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes qbt-fadeout { to { opacity: 0; } }
@keyframes qbt-zoom { from { opacity: 0; transform: scale(.6) translateY(20px); } 70% { transform: scale(1.06); } to { opacity: 1; transform: none; } }
.is-leaving { animation: qbt-fadeout .22s ease forwards !important; pointer-events: none; }

/* หน้าเริ่ม: ชิ้นส่วนค่อย ๆ ลอยขึ้นตามลำดับ */
.qbt-start .qbt-topline, .qbt-start .qbt-greet, .qbt-start .qbt-title, .qbt-start .qbt-lead, .qbt-start .qbt-facts, .qbt-start .qbt-learn, .qbt-start .qbt-form, .qbt-start .qbt-note, .qbt-start .qbt-tips { animation: qbt-rise .55s cubic-bezier(.2, .8, .3, 1) both; }
.qbt-start .qbt-greet { animation-delay: .05s; }
.qbt-start .qbt-title { animation-delay: .12s; }
.qbt-start .qbt-lead, .qbt-start .qbt-facts { animation-delay: .2s; }
.qbt-start .qbt-learn { animation-delay: .26s; }
.qbt-start .qbt-learn li { animation: qbt-rise .45s cubic-bezier(.2, .8, .3, 1) both; }
.qbt-start .qbt-learn li:nth-child(1) { animation-delay: .34s; } .qbt-start .qbt-learn li:nth-child(2) { animation-delay: .42s; } .qbt-start .qbt-learn li:nth-child(3) { animation-delay: .5s; }
.qbt-start .qbt-form { animation-delay: .18s; }
.qbt-start .qbt-note, .qbt-start .qbt-tips { animation-delay: .3s; }
.qbt-start .qbt-peekform { animation: qbt-peekin .6s .45s cubic-bezier(.3, 1.5, .5, 1) both, qbt-peek 4s 1.2s ease-in-out infinite; }
@keyframes qbt-peekin { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* หน้าทำข้อสอบ: ขึ้นมาจากด้านล่าง · โจทย์เลื่อนตามทิศที่ไป */
.qbt-run:not([hidden]) .qbt-run-in { animation: qbt-rise .4s cubic-bezier(.2, .8, .3, 1); }
.qbt-run:not([hidden]) { animation: qbt-fade .3s ease; }
.qbt-qcard.is-in-next { animation: qbt-in-next .38s cubic-bezier(.2, .8, .3, 1); }
.qbt-qcard.is-in-prev { animation: qbt-in-prev .38s cubic-bezier(.2, .8, .3, 1); }
@keyframes qbt-in-next { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes qbt-in-prev { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }

/* ผ่านด่าน: พื้นจางเข้า ตัวการ์ตูนเด้ง แล้วข้อความตามมา */
.qbt-cp:not([hidden]) { animation: qbt-fade .3s ease; }
.qbt-cp:not([hidden]) .qbt-cp-chip { animation: qbt-rise .4s .1s both; }
.qbt-cp:not([hidden]) .qbt-jump { animation: qbt-zoom .6s .15s cubic-bezier(.3, 1.4, .5, 1) both, qbt-jump 1.4s .9s ease-in-out infinite; }
.qbt-cp:not([hidden]) .qbt-cp-title { animation: qbt-zoom .5s .3s cubic-bezier(.3, 1.4, .5, 1) both; }
.qbt-cp:not([hidden]) .qbt-cp-text { animation: qbt-rise .4s .42s both; }
.qbt-cp:not([hidden]) .qbt-cp-stars { animation: qbt-rise .4s .5s both; }
.qbt-cp:not([hidden]) .qbt-cp-map { animation: qbt-rise .4s .58s both; }
.qbt-cp:not([hidden]) .qbt-isle.is-next { animation: qbt-zoom .5s .8s cubic-bezier(.3, 1.6, .5, 1) both; }
.qbt-cp:not([hidden]) .qbt-cp-actions { animation: qbt-rise .4s .66s both; }

/* ตรวจก่อนส่ง */
.qbt-fin:not([hidden]) { animation: qbt-fade .3s ease; }
.qbt-fin:not([hidden]) .qbt-fin-art img { animation: qbt-zoom .6s .1s cubic-bezier(.3, 1.4, .5, 1) both; }
.qbt-fin:not([hidden]) .qbt-badge { animation: qbt-badge .7s .25s cubic-bezier(.3, 1.6, .5, 1) both; }
.qbt-fin:not([hidden]) .qbt-fin-title { animation: qbt-rise .45s .2s both; }
.qbt-fin:not([hidden]) .qbt-fin-text { animation: qbt-rise .45s .28s both; }
.qbt-fin:not([hidden]) .qbt-fin-body > * { animation: qbt-rise .45s .34s both; }
.qbt-fin:not([hidden]) .qbt-fin-body > *:nth-child(2) { animation-delay: .42s; }
.qbt-fin:not([hidden]) .qbt-fin-body > *:nth-child(n+3) { animation-delay: .5s; }

/* พักไว้ก่อน: แผ่นเลื่อนขึ้น */
.qbt-dim:not([hidden]) { animation: qbt-fade .25s ease; }
.qbt-sheet:not([hidden]) { animation: qbt-sheet .35s cubic-bezier(.2, .9, .3, 1); }
@keyframes qbt-sheet { from { transform: translateY(100%); } to { transform: none; } }

/* ครึ่งทาง (เด็กโต) */
.qbt-toast.is-leaving { animation: qbt-toastout .25s ease forwards !important; }
@keyframes qbt-toastout { to { opacity: 0; transform: translateY(16px); } }

/* หน้าส่งต่อ */
.qbt-hand:not([hidden]) .qbt-hand-info > *, .qbt-hand:not([hidden]) .qbt-hand-act > * { animation: qbt-rise .5s cubic-bezier(.2, .8, .3, 1) both; }
.qbt-hand-info > *:nth-child(2) { animation-delay: .06s !important; }
.qbt-hand-info > *:nth-child(3) { animation-delay: .12s !important; }
.qbt-hand-info > *:nth-child(4) { animation-delay: .18s !important; }
.qbt-hand-act > * { animation-delay: .2s !important; }
.qbt-hand-head img { animation: qbt-zoom .6s .1s cubic-bezier(.3, 1.4, .5, 1) both; }
.qbt-panel:not([hidden]) { animation: qbt-rise .32s cubic-bezier(.2, .8, .3, 1) both; }

/* หน้าผล: การ์ดลอยขึ้นตามลำดับ กราฟค่อย ๆ เติม */
.qbt-rhero-in > * { animation: qbt-rise .55s cubic-bezier(.2, .8, .3, 1) both; }
.qbt-rhero-in > *:nth-child(2) { animation-delay: .08s; }
.qbt-rhero-in > *:nth-child(3) { animation-delay: .16s; }
.qbt-rhero-in > *:nth-child(n+4) { animation-delay: .24s; }
.qbt-rmascot { animation: qbt-zoom .7s .2s cubic-bezier(.3, 1.4, .5, 1) both; }
.qbt-rbody .qbt-rcard, .qbt-forlabel { animation: qbt-rise .55s cubic-bezier(.2, .8, .3, 1) both; }
.qbt-rbody .qbt-ord-1 { animation-delay: .2s; } .qbt-rbody .qbt-ord-2 { animation-delay: .28s; } .qbt-rbody .qbt-ord-3 { animation-delay: .32s; }
.qbt-rbody .qbt-ord-4 { animation-delay: .38s; } .qbt-rbody .qbt-ord-5 { animation-delay: .44s; } .qbt-rbody .qbt-ord-6 { animation-delay: .5s; }
.qbt-ring-fill { animation: qbt-ring 1.1s .45s cubic-bezier(.3, .8, .3, 1) both; }
@keyframes qbt-ring { from { stroke-dasharray: 0 277; } }
.qbt-step-blk { transform-origin: 50% 100%; animation: qbt-grow-y .7s cubic-bezier(.3, 1.3, .5, 1) both; }
.qbt-step:nth-child(1) .qbt-step-blk { animation-delay: .5s; } .qbt-step:nth-child(2) .qbt-step-blk { animation-delay: .62s; } .qbt-step:nth-child(3) .qbt-step-blk { animation-delay: .74s; }
@keyframes qbt-grow-y { from { transform: scaleY(0); } }
.qbt-step-flag { animation: qbt-zoom .5s 1.1s cubic-bezier(.3, 1.6, .5, 1) both; }
.qbt-bar i { transform-origin: 0 50%; animation: qbt-grow-x .9s .6s cubic-bezier(.3, .9, .3, 1) both; }
@keyframes qbt-grow-x { from { transform: scaleX(0); } }

/* เปลี่ยนหน้าตาเด็กเล็ก ↔ เด็กโต: วงกลมขยายออกจากปุ่มชั้นที่กด */
html.qbt-vt-reveal::view-transition-old(root) { animation: none; }
html.qbt-vt-reveal::view-transition-new(root) { animation: qbt-reveal .7s cubic-bezier(.45, 0, .2, 1); }
@keyframes qbt-reveal { from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 50%)); } to { clip-path: circle(150vmax at var(--vt-x, 50%) var(--vt-y, 50%)); } }

@media (prefers-reduced-motion: reduce) {
    .qbt, .qbt *, .qbt-sheet, .qbt-sheet *, .qbt-dim { animation: none !important; transition: none !important; }
    html::view-transition-new(root), html::view-transition-old(root) { animation: none !important; }
    .qbt-plus.is-go { opacity: 1; }
}

/* ---------- แบบฝึกหัดหลังเรียน (homework_page.php · ?x=<รหัส> ของชุด homework) — สีตามวัยจากโทน --q-* ---------- */
.qbt-hw { position: relative; overflow: hidden; }
.qbt-hw::before { content: ""; position: absolute; top: -140px; right: -140px; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(252, 64, 19, .28) 0%, rgba(252, 64, 19, 0) 70%); pointer-events: none; }
.qbt[data-age="teen"].qbt-hw::before { background: radial-gradient(circle, rgba(252, 64, 19, .45) 0%, rgba(252, 64, 19, 0) 70%); }
.qbt-hw-wrap { position: relative; display: flex; flex-direction: column; gap: 16px; padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
.qbt-hw-label { font-size: 14px; font-weight: 600; color: var(--q-accent-text); }
.qbt-hw-mascot { width: 96px; height: 96px; }
.qbt-hw-h1 { margin: 0; font-size: 24px; line-height: 1.35; font-weight: 700; color: var(--q-text); text-wrap: balance; }
.qbt-hw-card { display: flex; flex-direction: column; gap: 12px; }
.qbt-hw-k { font-size: 13px; color: var(--q-muted); }
.qbt-hw-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.qbt-hw-tag { display: inline-flex; padding: 5px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--q-accent-soft); color: var(--q-accent-text); border: 1px solid rgba(252, 64, 19, .3); }
.qbt-hw-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.qbt-hw-facts > div { padding: 10px 6px; border-radius: 16px; background: var(--q-bg); border: 1px solid var(--q-line); text-align: center; min-width: 0; }
.qbt-hw-facts b { display: block; font-size: 20px; line-height: 1.3; color: var(--q-text); font-variant-numeric: tabular-nums; }
.qbt-hw-facts b.is-sm { font-size: 15px; line-height: 1.75; }
.qbt-hw-facts span { font-size: 12px; color: var(--q-muted); }
.qbt-hw-note { display: flex; gap: 10px; align-items: flex-start; }
.qbt-hw-note > svg { width: 18px; height: 18px; stroke: var(--q-accent-text); flex-shrink: 0; margin-top: 2px; }
.qbt-hw-note p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--q-sub); }
.qbt-hw-go { width: 100%; margin-top: 4px; }
.qbt-hw-score { display: flex; align-items: center; gap: 16px; }
.qbt-hw-ring { flex-shrink: 0; }
.qbt-hw-ring-bg { stroke: var(--q-line); }
.qbt-hw-ring-text { fill: var(--q-text); font-family: 'Anuphan', sans-serif; }
.qbt-hw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qbt-hw-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--q-surface); border: 1px solid var(--q-line); }
.qbt-hw-mk { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: #1F9D63; color: #FFFFFF; }
.qbt-hw-mk > svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 3; }
.qbt-hw-row.is-bad .qbt-hw-mk { background: transparent; border: 1.5px solid var(--q-accent-text); color: var(--q-accent-text); }
.qbt-hw-rt { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; color: var(--q-text); }
.qbt-hw-rt small { display: block; font-size: 13px; font-weight: 500; color: var(--q-muted); }
/* แบบทดสอบวัดผล (progress_test.php): หัวข้อทบทวน + ผลรายเรื่องเทียบครั้งก่อน */
.qbt-hw-tag.is-review { background: transparent; color: var(--q-sub); border-color: var(--q-line); }
.qbt-pt-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qbt-pt-legend { font-size: 12px; color: var(--q-muted); }
.qbt-pt-legend i, .qbt-pt-bar b { display: inline-block; width: 2px; background: var(--q-text); opacity: .55; }
.qbt-pt-legend i { height: 12px; vertical-align: -2px; margin-right: 5px; }
.qbt-pt-row { display: flex; flex-direction: column; gap: 5px; }
.qbt-pt-top { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.qbt-pt-name { flex: 1; min-width: 0; font-weight: 600; color: var(--q-text); overflow-wrap: anywhere; }
.qbt-pt-name small { font-weight: 500; color: var(--q-muted); font-size: 12px; }
.qbt-pt-score { font-size: 13px; color: var(--q-sub); font-variant-numeric: tabular-nums; }
.qbt-pt-trend { font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--q-muted); }
.qbt-pt-trend.is-up { color: #1F9D63; }
.qbt-pt-trend.is-down { color: var(--q-accent-text); }
.qbt-pt-bar { position: relative; height: 8px; border-radius: 4px; background: var(--q-line); overflow: hidden; }
.qbt-pt-bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: #1F9D63; }
.qbt-pt-bar.is-mid > i { background: #E0A31A; }
.qbt-pt-bar.is-low > i { background: var(--q-accent); }
.qbt-pt-bar b { position: absolute; top: -2px; bottom: -2px; margin-left: -1px; }
.qbt-pt-was { font-size: 12px; color: var(--q-muted); }
.qbt-pt-more { display: flex; flex-direction: column; gap: 10px; }
.qbt-pt-more > summary { list-style: none; width: 100%; cursor: pointer; }
.qbt-pt-more > summary::-webkit-details-marker { display: none; }
.qbt-pt-more[open] > summary { margin-bottom: 10px; }
