/* บ้านพี่ส่าย — โทนโลโก้กวดวิชาพี่ส่าย (แดง · ทอง · ดำ) แบบพรีเมียม · ธีมสีเปลี่ยนได้ */
@font-face { font-family: 'BoonJot'; src: url('/fonts/BoonJot-Italic.woff2') format('woff2'); font-display: swap; }

:root, [data-theme="cream"], [data-theme="auto"], [data-theme="cute"], [data-theme="video"] {
  --bg: #FFFBF3; --bg-glow: #FCE9C4; --surface: #FFFFFF; --text: #1C1210; --muted: #8B7A6B; --line: #E7DAC0; --soft: #F6EEDD; --accent: #C4000F;
}
[data-theme="night"] { --bg: #120B09; --bg-glow: #3A100E; --surface: #211512; --text: #F6EBD9; --muted: #B6A48D; --line: #3B2A23; --soft: #2D1F1A; --accent: #FF5A5F; }
[data-theme="sakura"] { --bg: #FFF4F8; --bg-glow: #FFD9E8; --surface: #FFFFFF; --text: #2B1221; --muted: #9B7088; --line: #F3D2E0; --soft: #FDE6EF; --accent: #D6336C; }
[data-theme="ocean"] { --bg: #F1F7FF; --bg-glow: #CFE4FF; --surface: #FFFFFF; --text: #0F1D33; --muted: #687D98; --line: #D3E2F4; --soft: #E3EFFD; --accent: #1D6FD8; }
/* ธีมตั้งเอง: --bg และ --accent มาจากที่น้องเลือก ที่เหลือคำนวณให้เข้ากัน */
[data-theme="custom"] { --bg-glow: color-mix(in srgb, var(--accent) 22%, var(--bg)); --line: color-mix(in srgb, var(--accent) 22%, var(--bg)); --soft: color-mix(in srgb, var(--accent) 11%, var(--bg)); }
[data-theme="custom"][data-mode="light"] { --surface: color-mix(in srgb, var(--bg) 30%, #fff); --text: #1C1210; --muted: color-mix(in srgb, #1C1210 55%, var(--bg)); }
[data-theme="custom"][data-mode="dark"] { --surface: color-mix(in srgb, var(--bg) 84%, #fff); --text: #F6EBD9; --muted: color-mix(in srgb, #F6EBD9 62%, var(--bg)); }
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] { --bg: #120B09; --bg-glow: #3A100E; --surface: #211512; --text: #F6EBD9; --muted: #B6A48D; --line: #3B2A23; --soft: #2D1F1A; --accent: #FF5A5F; }
}
:root {
  --red: #E3151B; --crimson: #C4000F; --gold: #F7BA00; --gold-d: #B07A00; --ink: #1C1210; --ink-2: #2B1A16;
  --green: #06C755; --ok: #1E9E62;
  --foil: linear-gradient(100deg, #B07A00 0%, #F7BA00 22%, #FFE9A8 45%, #F7BA00 62%, #C98F00 100%);
  --r: 18px; --shadow: 0 10px 30px -14px rgba(60, 20, 10, .35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'BoonJot', 'Sarabun', system-ui, sans-serif; font-size: 18px; line-height: 1.55; color: var(--text);
  background: var(--bg) radial-gradient(1200px 500px at 100% -10%, var(--bg-glow) 0%, transparent 60%) no-repeat; min-height: 100vh; }
body.has-tabs { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
body.bare { background: var(--ink); }
a { color: var(--accent); }
button { font: inherit; }
.wrap { max-width: none; margin: 0; padding: 0 clamp(14px, 3vw, 44px); }
h1, h2 { line-height: 1.25; margin: .2em 0 .4em; }
.muted { color: var(--muted); } .small { font-size: 14px; }

/* แถบมุมมองแอดมิน */
.viewbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 12px; font-size: 15px; color: #1C1210; background: repeating-linear-gradient(45deg, #FFD54A 0 14px, #FFC929 14px 28px); }
.viewbar a { color: #1C1210; font-weight: bold; background: #fff; padding: 2px 10px; border-radius: 999px; text-decoration: none; }

/* ส่วนหัว */
.top { position: sticky; top: 0; z-index: 20; background: var(--ink); border-bottom: 2px solid transparent; border-image: var(--foil) 1; box-shadow: 0 4px 18px rgba(0,0,0,.25); }
.viewbar + .top { top: 36px; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand img { width: 58px; height: auto; flex: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.05; }
.brand b { font-size: 22px; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.brand i { font-style: normal; font-size: 10px; letter-spacing: .22em; color: #D9C9A8; }
.tools { display: flex; align-items: center; gap: 8px; }
.online { display: flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(247,186,0,.35); background: rgba(255,255,255,.06); color: #F4E7CF; font-size: 14px; cursor: default; }
.online[data-admin] { cursor: pointer; }
.online i { width: 9px; height: 9px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px rgba(34,197,94,.25); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(34,197,94,.08); } }
.online b { font-size: 16px; color: #fff; }
.ibtn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 1px solid rgba(247,186,0,.35); background: rgba(255,255,255,.06); color: var(--gold); cursor: pointer; }
.ibtn.on { background: var(--gold); color: #1a0f00; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(247,186,0,.25); }
.viewsel { max-width: 150px; font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 10px; border: 1px solid rgba(247,186,0,.5); background: #2B1A16; color: #FFE9A8; }
.me img, .me .ph { display: block; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; background: #3A2620; }

/* เมนูลอย */
.menu { position: absolute; right: clamp(12px, 3vw, 44px); top: 66px; z-index: 40; width: min(340px, calc(calc(100vw / var(--fz, 1)) - 24px)); max-height: calc(70vh / var(--fz, 1)); overflow: auto; padding: 14px;
  border-radius: 18px; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: 0 24px 50px -12px rgba(0,0,0,.45); }
.menu-h { font-size: 14px; color: var(--muted); margin: 2px 0 8px; }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.sw { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-size: 14px; }
.sw span { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); }
.sw.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(247,186,0,.25); }
.sw-cream span { background: linear-gradient(135deg, #FFFBF3 50%, #F7BA00 50%); }
.sw-night span { background: linear-gradient(135deg, #120B09 50%, #C4000F 50%); }
.sw-auto span { background: linear-gradient(135deg, #FFFBF3 50%, #120B09 50%); }
.sw-sakura span { background: linear-gradient(135deg, #FFF4F8 50%, #D6336C 50%); }
.sw-ocean span { background: linear-gradient(135deg, #F1F7FF 50%, #1D6FD8 50%); }
.sw-custom span { background: conic-gradient(#E3151B, #F7BA00, #16A34A, #0EA5E9, #7C3AED, #DB2777, #E3151B); }
.custom { padding: 10px; margin: -4px 0 12px; border-radius: 14px; background: var(--soft); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.seg button { padding: 7px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.seg button.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(247,186,0,.22); }
.dots { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 10px; }
.dot { aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(0,0,0,.12); cursor: pointer; padding: 0; }
.dot.on { outline: 3px solid var(--gold); outline-offset: 1px; }
.dot.pick { position: relative; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.dot.pick input { position: absolute; inset: -6px; width: 150%; height: 150%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.langs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.lg { padding: 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-size: 15px; }
.lg.on { border-color: var(--gold); background: var(--soft); }
.swatches.big { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.langs.big { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.ol-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px dashed var(--line); }
.ol-row img, .ol-row .ph { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--soft); }

main.wrap { padding-top: 18px; padding-bottom: 10px; }
.hello { margin: 4px 0 14px; font-size: clamp(22px, 4.2vw, 40px); line-height: 1.25; }
.hello .art { position: relative; display: inline-block; max-width: 100%; padding: .9em 1.9em 1.15em; color: #fff; }
.hello .brush { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: 0; }
.hello .txt { position: relative; z-index: 2; text-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 10px rgba(0,0,0,.35), 0 0 22px rgba(0,0,0,.2); }
.hello .hl { position: absolute; z-index: 1; left: 12%; width: 78%; bottom: .62em; height: .62em; opacity: .95; }
.sec { font-size: 20px; margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.sec::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* ประกาศ */
.ann { position: relative; margin: 0 0 16px; padding: 16px 18px 16px 20px; border-radius: 18px; color: #fff;
  background: linear-gradient(120deg, #C4000F, #E3151B 45%, #F7BA00); box-shadow: 0 16px 30px -16px rgba(196,0,15,.8); }
.ann-tag { display: inline-block; font-size: 13px; padding: 2px 10px; border-radius: 999px; background: rgba(0,0,0,.25); margin-bottom: 6px; }
.ann b { display: block; font-size: 22px; }
.ann p { margin: 4px 0 0; }

/* บัตรสมาชิก + นับถอยหลัง */
.top-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.card { --c1: #3A120E; --c2: #1C1210; --glow: rgba(227,21,27,.55);
  position: relative; overflow: hidden; flex: 0 1 520px; width: 100%; max-width: 520px; container-type: inline-size; aspect-ratio: 1.586 / 1; display: flex; flex-direction: column; justify-content: space-between; border-radius: 18px; padding: 16px 20px; color: #FFF5E0;
  background: radial-gradient(120% 140% at 0% 0%, var(--c1) 0%, var(--c2) 60%), var(--c2);
  box-shadow: 0 22px 40px -18px var(--glow), inset 0 0 0 1px rgba(247, 186, 0, .35); }
.card::before { content: ''; position: absolute; inset: auto -30% -60% auto; width: 80%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, var(--glow), transparent 65%); }
.card::after { content: ''; position: absolute; inset: 8px; border-radius: 12px; border: 1px solid rgba(247,186,0,.25); pointer-events: none; }
.c-ADMIN { --c1: #3A120E; --c2: #1C1210; --glow: rgba(227,21,27,.6); }
.c-G15-3 { --c1: #3B1450; --c2: #170A22; --glow: rgba(168,85,247,.55); }
.c-G15-2 { --c1: #13306B; --c2: #0A1430; --glow: rgba(59,130,246,.55); }
.c-G15-1 { --c1: #2C3A4E; --c2: #0E141D; --glow: rgba(148,163,184,.5); }
.c-ME5 { --c1: #0D4A35; --c2: #06190F; --glow: rgba(16,185,129,.5); }
.c-ME4 { --c1: #0B4B55; --c2: #061A1F; --glow: rgba(20,184,166,.5); }
.c-TE4 { --c1: #5A2A12; --c2: #1E0D05; --glow: rgba(234,88,12,.55); }
.c-ME2 { --c1: #5A0C2A; --c2: #1E0610; --glow: rgba(225,29,72,.55); }
.c-ME1 { --c1: #5A3E06; --c2: #1F1503; --glow: rgba(245,158,11,.55); }
.c-TE1 { --c1: #5A1A44; --c2: #1F0817; --glow: rgba(236,72,153,.55); }
.card-shine { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,233,168,.16) 48%, transparent 60%); animation: shine 6s ease-in-out infinite; }
@keyframes shine { 0%, 60% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
@media (prefers-reduced-motion: reduce) { .card-shine, .online i { animation: none; } }
.card-top, .card-mid, .card-bot { position: relative; z-index: 1; }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.card-brand { font-size: 15px; color: #E9D7B5; }
.card-tier { font-size: 11px; letter-spacing: .2em; padding: 4px 10px; border-radius: 999px; color: var(--ink); background: var(--foil); }
.card-mid { display: flex; align-items: center; gap: 4cqw; }
.card-pic { width: 22cqw; height: 22cqw; border-radius: 50%; padding: 4px; background: var(--foil); flex: none; }
.card-pic img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: var(--ink-2); }
.card-name { font-size: clamp(24px, 8cqw, 44px); line-height: 1.1; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card-full { font-size: clamp(13px, 3.4cqw, 18px); color: #E9D7B5; }
.card-bot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.card-bot > div { display: flex; flex-direction: column; }
.card-bot .r { text-align: right; }
.card-lbl { font-size: 11px; letter-spacing: .15em; color: #C9B48F; }
.card-code { font-size: 22px; letter-spacing: .06em; color: #FFF; }
.card-course, .card-since { font-size: 14px; color: #E9D7B5; }
/* นับถอยหลังวันสอบ — Royal Exam Timeline (บัตรดำทองคู่กับบัตรสมาชิก ทุกธีม) */
.cd { flex: 1 1 380px; max-width: 640px; position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
  padding: 14px 22px; border-radius: 18px; border: 1px solid rgba(212,175,55,.35); color: #FFF8ED; -webkit-font-smoothing: antialiased;
  background: radial-gradient(ellipse at 100% 0%, rgba(247,186,0,.10), transparent 45%), radial-gradient(ellipse at 0% 110%, color-mix(in srgb, var(--glow, rgba(227,21,27,.55)) 45%, transparent), transparent 55%),
    linear-gradient(145deg, var(--c1, #3A120E) 0%, var(--c2, #1C1210) 100%);
  box-shadow: 0 12px 32px rgba(28,18,16,.16), 0 3px 8px rgba(28,18,16,.08), inset 0 1px 0 rgba(255,243,196,.12); }
.cd::before { content: ""; position: absolute; top: 0; left: 12%; right: 12%; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,243,196,.8), rgba(247,186,0,.5), transparent); }
.cd::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55; pointer-events: none;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.012) 0 1px, transparent 1px 5px); }
.cd-i { flex: 1; display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "t d" "bar bar"; align-items: center; column-gap: 16px; row-gap: 7px;
  padding: 11px 10px; border-bottom: 1px solid rgba(255,255,255,.07); animation: cdIn .45s cubic-bezier(.22,1,.36,1) both; }
.cd-i:last-child { border-bottom: 0; }
.cd-i:nth-child(2) { animation-delay: 70ms; } .cd-i:nth-child(3) { animation-delay: 140ms; }
.cd-t { grid-area: t; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cd-t b { font-size: 19px; font-weight: 400; line-height: 1.3; overflow-wrap: anywhere; }
.cd-t time { font-size: 13px; color: rgba(255,248,237,.68); }
.cd-k { align-self: flex-start; font-size: 11px; letter-spacing: .04em; color: #F3D98B; padding: 1px 9px; margin-bottom: 3px; border-radius: 99px; background: rgba(212,175,55,.15); border: 1px solid rgba(212,175,55,.25); }
.cd-d { grid-area: d; display: flex; align-items: baseline; justify-content: flex-end; gap: 7px; min-width: 96px; white-space: nowrap; }
.cd-d .n { font-size: 34px; line-height: .95; letter-spacing: -.035em; padding-right: .07em; font-variant-numeric: tabular-nums; color: #E8DDD0; }
.cd-d small { font-size: 13px; color: rgba(255,248,237,.6); }
.cd-bar { grid-area: bar; height: 2px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.08); }
.cd-bar span { display: block; height: 100%; width: var(--p); border-radius: inherit; background: rgba(232,221,208,.38);
  transform-origin: left center; animation: cdBar .8s .18s cubic-bezier(.22,1,.36,1) both; }
.cd-i.near { border-radius: 12px; padding: 11px 12px 13px; background: rgba(212,175,55,.07); border: 1px solid rgba(212,175,55,.22); }
.cd-i.near + .cd-i { border-top: 0; }
.cd-i.near .cd-t b { font-size: 21px; }
.cd-i.near .cd-d .n { font-size: 56px; background: linear-gradient(165deg, #FFF8DC 0%, #FFF3C4 22%, #F7BA00 55%, #D39A2F 78%, #B98022 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.cd-i.near .cd-d small { font-size: 15px; color: #F3D98B; }
.cd-i.near .cd-bar span { background: linear-gradient(90deg, #9E7B2F 0%, #F3D98B 100%); box-shadow: 0 0 6px rgba(243,217,139,.3); }
.cd.one .cd-i { background: transparent; row-gap: 18px; }
.cd.one .cd-t b { font-size: 26px; } .cd.one .cd-t time { font-size: 15px; }
.cd.one .cd-d .n { font-size: 104px; } .cd.one .cd-d small { font-size: 18px; }
.cd-now { padding: 9px 15px; border-radius: 9px; border: 1px solid rgba(255,243,196,.28); background: linear-gradient(135deg, #A80D24, #C81020); color: #FFF3C4;
  font-size: 19px; box-shadow: 0 4px 16px rgba(227,21,27,.18); }
.cd-i.today { background: linear-gradient(110deg, rgba(227,21,27,.24), rgba(227,21,27,.06)); border-radius: 13px; }
@keyframes cdIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes cdBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .cd-i, .cd-bar span { animation: none; } }
@media (max-width: 480px) {
  .cd { padding: 8px 12px; border-radius: 18px; }
  .cd-i { column-gap: 10px; padding: 9px 5px; } .cd-i.near { padding: 9px 6px 11px; }
  .cd-t b { font-size: 16px; } .cd-i.near .cd-t b { font-size: 18px; } .cd-t time { font-size: 12px; }
  .cd-d { min-width: 80px; gap: 5px; } .cd-d .n { font-size: 28px; } .cd-i.near .cd-d .n { font-size: 46px; }
  .cd.one .cd-d .n { font-size: 84px; } .cd.one .cd-t b { font-size: 20px; }
}

/* ปุ่มหน้าแรก (กรอบสี) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.tile { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 176px; padding: 16px 130px 16px 18px;
  border-radius: 22px; color: #fff; text-decoration: none; box-shadow: 0 14px 26px -16px rgba(0,0,0,.6); transition: transform .15s; }
.tile:hover { transform: translateY(-3px); }
.tile::after { content: ''; position: absolute; right: -40px; bottom: -40px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255,255,255,.16); }
.tile-pill:empty { display: none; }
.tile-pill { font-size: 13px; padding: 2px 12px; border-radius: 999px; background: #FFD84D; color: #3B2600; margin-bottom: 6px; }
.tile-t { font-size: 24px; line-height: 1.2; }
.tile-d { font-size: 14px; opacity: .92; }
.tile-go { margin-top: auto; padding-top: 10px; font-size: 15px; }
.tile-art { position: absolute; z-index: 1; right: 16px; bottom: 16px; width: 104px; height: 104px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px -8px rgba(0,0,0,.4); }
.tile-art img { width: 78px; height: 78px; }
.tc-blue { background: linear-gradient(135deg, #1EA7F0, #1477D6); }
.tc-red { background: linear-gradient(135deg, #E5323E, #C4161F); }
.tc-orange { background: linear-gradient(135deg, #FDB515, #E98A08); }
.tc-green { background: linear-gradient(135deg, #2E9E5A, #1E7A43); }
.tc-pink { background: linear-gradient(135deg, #F06BAA, #D63A85); }
.tc-ink { background: linear-gradient(135deg, #3A120E, #1C1210); box-shadow: inset 0 0 0 1px rgba(247,186,0,.5), 0 14px 26px -16px rgba(0,0,0,.6); }
.tc-ink .tile-t { background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* กล่องเนื้อหา + ฟอร์ม */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); margin: 0 auto 16px; max-width: 640px; }
.panel.wide { max-width: none; }
.panel.center { text-align: center; }
.panel h2 { font-size: 20px; }
.panel-head p { margin: 0 0 8px; color: var(--muted); }
.step { display: inline-block; font-size: 13px; letter-spacing: .08em; color: var(--gold-d); background: var(--soft); padding: 2px 10px; border-radius: 999px; }
.big { font-size: 52px; }
.hero-ic { width: 96px; height: 96px; padding: 10px; border-radius: 50%; background: var(--soft); display: block; margin: 0 auto 6px; }
.form { display: grid; gap: 14px; margin-top: 10px; }
.form label { display: flex; flex-wrap: wrap; gap: 6px 4px; font-size: 17px; }
.form label > input, .form label > select { flex-basis: 100%; }
.form label b { color: var(--crimson); }
.inline-form { grid-template-columns: 1fr auto; align-items: end; }
input, select { font: inherit; font-size: 18px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(247,186,0,.22); }
.btn-gold, .btn-ghost, .btn-line { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 14px; padding: 13px 22px; font-size: 19px; text-decoration: none; cursor: pointer; border: 0; }
.btn-gold { background: var(--foil); color: var(--ink); box-shadow: 0 8px 20px -10px rgba(176,122,0,.9), inset 0 -2px 0 rgba(0,0,0,.12); }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.wide { width: 100%; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; margin-top: 14px; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.alert { background: #FFF0EE; border: 1px solid #F3C2BC; color: #7A0710; padding: 10px 14px; border-radius: 12px; }
.alert.ok { background: #EEF9F2; border-color: #BFE6CF; color: #146B43; }
.info { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; text-align: left; margin: 14px auto; max-width: 460px; }
.info dt { color: var(--muted); } .info dd { margin: 0; }
.prose h2 { font-size: 20px; margin-top: 1.2em; }
.me-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.me-grid .card { margin-bottom: 16px; }
.me-grid .panel { max-width: none; }
.code-form { max-width: 380px; margin: 14px auto 0; }
.code-in { text-align: center; font-size: 24px; letter-spacing: .12em; text-transform: uppercase; }

/* แอดมิน */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-head h1 { margin: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips span { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 12px; background: var(--soft); font-size: 14px; color: var(--muted); }
.chips b { font-size: 22px; color: var(--accent); }
.list { display: grid; gap: 8px; }
.li { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--line); }
.av { position: relative; flex: none; }
.av img, .av .ph { display: block; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--soft); }
.av.is-on::after { content: ''; position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #22C55E; border: 2px solid var(--surface); }
.li-main { flex: 1; min-width: 0; }
.tag { font-size: 13px; padding: 1px 8px; border-radius: 999px; background: var(--soft); }
.st-pending { background: #FFF3CC; color: var(--gold-d); } .st-active { background: #E2F6EA; color: var(--ok); }
.st-suspended, .st-rejected { background: #FDE5E3; color: #7A0710; } .st-admin { background: var(--ink); color: var(--gold); }
.btn-sm { font-size: 14px; padding: 7px 12px; border-radius: 10px; border: 0; cursor: pointer; background: var(--foil); color: var(--ink); white-space: nowrap; }
.btn-sm.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--muted); }

/* แถบล่าง (แอดมินเท่านั้น) */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center; gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(28,18,16,.96); backdrop-filter: blur(8px); border-top: 1px solid rgba(247,186,0,.35); }
.tabs a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; font-size: 13px; color: #CDBB9A; text-decoration: none; padding: 4px 0; border-radius: 12px; }
.tabs a img { width: 30px; height: 30px; }
.tabs a.on { color: var(--gold); background: rgba(247,186,0,.12); }
.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 24px 0 14px; }
.foot a { color: var(--muted); }

/* หน้าเข้าสู่ระบบ */
.gate { position: relative; min-height: calc(100vh / var(--fz, 1)); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 18px;
  background: radial-gradient(900px 600px at 50% 0%, #5A0A10 0%, transparent 70%), radial-gradient(700px 500px at 100% 100%, #3D0A0B 0%, transparent 70%), var(--ink); color: #F6E9D0; }
.gate-tools { position: absolute; top: 14px; right: 14px; }
.gate-tools .menu { top: 46px; right: 0; }
.gate-card { position: relative; width: 100%; max-width: 420px; text-align: center; padding: 30px 24px 26px; border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); box-shadow: inset 0 0 0 1px rgba(247,186,0,.35), 0 30px 60px -20px rgba(0,0,0,.7); }
.gate-logo { width: 78%; height: auto; filter: drop-shadow(0 12px 22px rgba(0,0,0,.45)); }
.pill { display: inline-block; margin-top: 16px; font-size: 12px; letter-spacing: .25em; padding: 5px 14px; border-radius: 999px; color: var(--ink); background: var(--foil); }
.foil { font-size: 46px; margin: 10px 0 4px; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { margin: 0 0 20px; color: #D9C9A8; font-size: 17px; }
.btn-line { width: 100%; background: var(--green); color: #FFF; font-size: 21px; box-shadow: 0 12px 24px -10px rgba(6,199,85,.7); }
.btn-line:active, .btn-gold:active { transform: translateY(1px); }
.hint { font-size: 14px; color: #B9A685; margin: 14px 0 0; }
.gate .alert { background: rgba(227,21,27,.15); border-color: rgba(227,21,27,.5); color: #FFD9D4; }
.gate-foot { font-size: 13px; margin-top: 18px; } .gate-foot a { color: #B9A685; }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .brand i { display: none; } .brand b { font-size: 18px; } .brand img { width: 46px; }
  .online span { display: none; }
  .viewsel { max-width: 96px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { min-height: 190px; padding: 12px 12px 92px; }
  .tile-t { font-size: 19px; } .tile-d { font-size: 12.5px; }
  .tile-art { width: 74px; height: 74px; right: 10px; bottom: 10px; } .tile-art img { width: 56px; height: 56px; }
  .tile-go { position: absolute; left: 12px; bottom: 12px; }
  .card { padding: 14px 16px; } .cd { max-width: none; flex-basis: 100%; }
  .inline-form { grid-template-columns: 1fr; }
}

/* ───── ตารางเรียน: วันนี้ + สัปดาห์ (Today First · ChatGPT 2 ธ.ค.) ───── */
.sched { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 2.2fr); gap: 14px; margin: 0 0 18px; }
.sched.team { grid-template-columns: 1fr; }
.today { position: relative; overflow: hidden; border-radius: 22px; padding: 18px 18px 16px; color: #FFF5E0;
  background: radial-gradient(130% 120% at 0% 0%, #4A0D0F 0%, #1C1210 62%), #1C1210; box-shadow: 0 18px 36px -18px rgba(60,10,10,.8), inset 0 0 0 1px rgba(247,186,0,.28); }
.today::after { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--foil); }
.today-k { font-size: 14px; color: #D9C59C; }
.today-h h2 { margin: 0 0 10px; font-size: 26px; line-height: 1.2; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.today-list { display: grid; gap: 8px; }
.today-none { margin: 4px 0 0; color: #E9D9B8; font-size: 18px; }
.tcls { font: inherit; text-align: left; width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "sub st" "time st"; align-items: center; gap: 0 10px;
  padding: 11px 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: inherit; }
button.tcls { cursor: pointer; } button.tcls:hover { background: rgba(255,255,255,.1); }
.tcls-sub { grid-area: sub; font-size: 21px; } .tcls-time { grid-area: time; font-size: 14px; color: #D9C59C; }
.tcls-st { grid-area: st; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.1); white-space: nowrap; max-width: calc(46vw / var(--fz, 1)); overflow: hidden; text-overflow: ellipsis; }
.tcls.s-live { border-color: rgba(227,21,27,.8); background: linear-gradient(100deg, rgba(227,21,27,.35), rgba(255,255,255,.05)); }
.tcls.s-live .tcls-st { background: #E3151B; color: #fff; }
.tcls.s-live .tcls-st::before { content: '●'; margin-right: 5px; animation: blink 1.4s infinite; }
.tcls.s-soon .tcls-st { background: var(--foil); color: var(--ink); }
.tcls.s-done { opacity: .55; } .tcls.s-closed { opacity: .7; } .tcls.s-closed .tcls-sub { text-decoration: line-through; }
.tcls.s-leave .tcls-st { background: #6D5BD0; color: #fff; } .tcls.s-leavep .tcls-st { background: transparent; box-shadow: inset 0 0 0 1.5px #F7BA00; color: #FFE9A8; }
@keyframes blink { 50% { opacity: .25; } }
.push-hint { display: inline-block; margin-top: 12px; font-size: 14px; color: #FFE9A8; text-decoration: none; border-bottom: 1px dashed rgba(247,186,0,.6); }

.week { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 14px 14px 10px; box-shadow: var(--shadow); min-width: 0; }
.week-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.week-h h3 { margin: 0; font-size: 20px; }
.week-nav { display: flex; gap: 6px; align-items: center; }
.week-nav a { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 10px; border: 1.5px solid var(--line); color: var(--text); text-decoration: none; font-size: 15px; }
.week-nav a[aria-label] { font-size: 22px; }
.wgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wday { border-radius: 14px; padding: 6px; background: var(--soft); min-height: 118px; display: flex; flex-direction: column; gap: 5px; }
.wday.off { background: transparent; border: 1px dashed var(--line); }
.wday.is-today { box-shadow: inset 0 0 0 2px var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.wday-h { display: flex; align-items: baseline; justify-content: space-between; padding: 0 2px; }
.wday-h b { font-size: 15px; } .wday-h span { font-size: 13px; color: var(--muted); }
.wday.is-today .wday-h span { color: var(--crimson); font-weight: bold; }
.wcls { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 0; padding: 6px 7px; border-radius: 10px; border: 0; background: var(--surface); color: var(--text);
  box-shadow: 0 1px 0 var(--line), inset 3px 0 0 var(--accent); min-width: 0; }
button.wcls { cursor: pointer; } button.wcls:hover { box-shadow: 0 1px 0 var(--line), inset 3px 0 0 var(--accent), 0 0 0 2px color-mix(in srgb, var(--gold) 55%, transparent); }
.wcls-sub { font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wcls small { font-size: 12px; color: var(--muted); }
.wcls-st { font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-live .wcls-st { color: #E3151B; } .s-soon .wcls-st { color: var(--gold-d); } .s-done { opacity: .55; }
.wcls.s-closed { box-shadow: 0 1px 0 var(--line), inset 3px 0 0 #9CA3AF; background: repeating-linear-gradient(135deg, var(--surface) 0 6px, var(--soft) 6px 12px); }
.wcls.s-closed .wcls-sub { text-decoration: line-through; color: var(--muted); }
.wcls.s-leave { box-shadow: 0 1px 0 var(--line), inset 3px 0 0 #6D5BD0; } .s-leave .wcls-st { color: #6D5BD0; }
.wcls.s-leavep { box-shadow: 0 1px 0 var(--line), inset 3px 0 0 var(--gold); } .s-leavep .wcls-st { color: var(--gold-d); }
.week-tip { margin: 8px 2px 0; }

/* bottom sheet (iPhone) / modal (คอม) */
.sheet { border: 0; padding: 0; width: min(520px, 100%); border-radius: 24px; background: var(--surface); color: var(--text); box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
.sheet::backdrop { background: rgba(20,10,8,.55); backdrop-filter: blur(2px); }
.sheet .form { padding: 18px 20px 6px; margin: 0; }
.sheet #leave-cancel { padding: 0 20px 20px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; } .sheet-h h2 { margin: 0; }
.sheet-what { margin: 0; font-size: 20px; } .sheet-what small { display: block; color: var(--muted); font-size: 15px; }
#leave-fields { display: grid; gap: 14px; padding-bottom: 16px; }
.xbtn { border: 0; background: var(--soft); color: var(--muted); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px; flex: none; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.team-c { border-radius: 14px; padding: 8px 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.team-c > b { font-size: 17px; color: #FFE9A8; }
.tc-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 8px; font-size: 15px; padding: 2px 0; }
.tc-row small { color: #D9C59C; } .tc-row .wcls-st { grid-column: 1 / -1; color: #D9C59C; }
.tc-row.s-live .wcls-st { color: #FF7A7E; } .tc-row.s-done { opacity: .5; }
.ann.closure { background: linear-gradient(120deg, #1C1210, #3A2A20 55%, #6B4E12); box-shadow: 0 16px 30px -18px rgba(60,40,10,.8); }

/* ───── หลังบ้านทีมพี่ (แถบข้าง 3 หมวด · ChatGPT 2 ธ.ค.) ───── */
.adm { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 18px; align-items: start; }
.adm-nav { position: sticky; top: 12px; display: grid; gap: 12px; padding: 14px 10px; border-radius: 22px; background: var(--ink); color: #E9D9B8; box-shadow: var(--shadow); }
.adm-g { display: grid; gap: 2px; }
.adm-gh { font-size: 12px; letter-spacing: .08em; color: #A8946F; padding: 0 10px 2px; }
.adm-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; color: #F3E4C4; text-decoration: none; font-size: 17px; }
.adm-nav a:hover { background: rgba(255,255,255,.06); }
.adm-nav a.on { background: rgba(247,186,0,.16); color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.adm-badge { margin-left: auto; font-size: 12px; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 999px; background: #E3151B; color: #fff; }
.adm-h { margin: 0 0 12px; font-size: 30px; }
.adm-main .panel { margin: 0 0 14px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; align-items: start; }
.filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 8px; }
.filter input[type=search] { flex: 1 1 260px; width: auto; } .filter select { flex: 0 1 300px; width: auto; }
.fchips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.fchip { font-size: 14px; padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--text); text-decoration: none; }
.fchip.on { background: var(--ink); color: var(--gold); border-color: var(--ink); }
.st-row { border: 1px solid var(--line); border-radius: 14px; }
.st-row > summary { list-style: none; display: flex; gap: 12px; align-items: center; padding: 10px; cursor: pointer; }
.st-row > summary::-webkit-details-marker { display: none; }
.st-row .chev { color: var(--muted); font-size: 22px; transition: transform .15s; } .st-row[open] .chev { transform: rotate(90deg); }
.st-more { padding: 0 12px 12px 66px; display: grid; gap: 10px; }
.st-more .info { margin: 0; }
.row-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-act form, .li form { margin: 0; }
.btn-sm.danger { background: #FDE5E3; color: #7A0710; border: 1.5px solid #F3C2BC; }
a.btn-sm { text-decoration: none; display: inline-block; }
.danger-zone { border-color: #F3C2BC; }
.gen { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; margin-top: 10px; }
.gen label { display: grid; gap: 4px; font-size: 15px; color: var(--muted); }
.gen .span2, .gen fieldset { grid-column: 1 / -1; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; } legend { font-size: 15px; color: var(--muted); padding: 0; margin-bottom: 4px; }
.seg4 > div, .seg4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; } .seg4 legend { grid-column: 1 / -1; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .seg2 legend { grid-column: 1 / -1; }
.opt { position: relative; cursor: pointer; } .opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: grid; gap: 0; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); font-size: 16px; height: 100%; }
.opt small { font-size: 12.5px; color: var(--muted); }
.opt input:checked + span { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(247,186,0,.25); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
.opt input:focus-visible + span { outline: 2px solid var(--accent); }
.chk { display: inline-flex !important; grid-auto-flow: column; align-items: center; gap: 6px !important; padding: 6px 10px; border-radius: 10px; border: 1.5px solid var(--line); color: var(--text) !important; font-size: 15px; margin: 0 6px 6px 0; cursor: pointer; }
.chk input { width: 18px; height: 18px; padding: 0; accent-color: var(--crimson); }
.chk.all { background: var(--soft); }
textarea { font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); width: 100%; resize: vertical; }
.bh { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; } .bh h2 { margin: 0; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; margin-top: 12px; }
.code-li { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 12px; border: 1px solid var(--line); flex-wrap: wrap; }
.code-li code, .pcard code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 17px; letter-spacing: .06em; font-style: normal; }
.code-li code { flex: 1; } .code-li.dim code { color: var(--muted); }
.tbl { overflow-x: auto; margin: 8px 0; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-weight: normal; color: var(--muted); font-size: 13px; padding: 6px 8px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr.on td { background: var(--soft); } .tbl td.nw { white-space: nowrap; }
.tbl tr[data-href] { cursor: pointer; }
.pat h3 { margin: 14px 0 6px; font-size: 18px; }
.wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wk-d { background: var(--soft); border-radius: 12px; padding: 6px; display: grid; gap: 4px; align-content: start; min-height: 70px; }
.wk-d.off { background: transparent; border: 1px dashed var(--line); }
.wk-s { position: relative; background: var(--surface); border-radius: 9px; padding: 4px 26px 4px 7px; box-shadow: inset 3px 0 0 var(--accent); }
.wk-s span { display: block; font-size: 15px; line-height: 1.2; } .wk-s small { font-size: 12px; color: var(--muted); }
.wk-s form { position: absolute; top: 3px; right: 3px; } .wk-s .xbtn { width: 20px; height: 20px; font-size: 10px; }
.tag.lock { background: #EDE9FE; color: #5B21B6; } .tag.gold { background: var(--foil); color: var(--ink); }
.dows { display: flex; flex-wrap: wrap; }

/* พิมพ์การ์ดรหัส */
.print-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; padding: 8mm; background: #fff; color: #1C1210; }
.pcard { display: flex; gap: 12px; align-items: center; border: 1.5px dashed #B07A00; border-radius: 12px; padding: 10px 12px; break-inside: avoid; }
.pcard img { width: 70px; height: auto; } .pcard div { display: grid; gap: 2px; } .pcard code { font-size: 22px; font-weight: bold; }
body.bare:has(.print-sheet) { background: #fff; }
@media print { .print-sheet { padding: 0; } @page { margin: 10mm; } }

@media (max-width: 1100px) { .sched { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .adm { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .adm-nav { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; overflow-x: auto; padding: 6px; border-radius: 16px; scrollbar-width: none; margin: 0 -4px; }
  .adm-nav::-webkit-scrollbar { display: none; }
  .adm-g { display: contents; } .adm-gh { display: none; }
  .adm-nav a { flex: none; white-space: nowrap; font-size: 15px; padding: 8px 12px; }
  .adm-nav a.on { box-shadow: inset 0 -2px 0 var(--gold); }
  .adm-h { font-size: 24px; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wgrid { grid-template-columns: 1fr; gap: 5px; }
  .wday { min-height: 0; display: grid; grid-template-columns: 46px minmax(0, 1fr); grid-auto-flow: row dense; gap: 5px 8px; align-items: center; padding: 7px 8px; }
  .wday-h { grid-column: 1; grid-row: 1; flex-direction: column; align-items: flex-start; align-self: start; padding-top: 4px; }
  .wday > .wcls, .wday > small { grid-column: 2; }
  .wcls { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "sub st" "time st"; gap: 0 8px; align-items: center; }
  .wcls-sub { grid-area: sub; } .wcls small { grid-area: time; } .wcls-st { grid-area: st; font-size: 12.5px; max-width: calc(42vw / var(--fz, 1)); }
  .wday.off { padding: 5px 8px; }
  .sheet { margin: auto 0 0; width: 100%; max-width: none; border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .st-more { padding: 0 10px 12px; }
  .seg4, .seg4 > div { grid-template-columns: 1fr 1fr; }
  .wk { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gen { grid-template-columns: 1fr 1fr; } .gen label { grid-column: span 1; }
  .print-sheet { grid-template-columns: 1fr; }
  .tcls-sub { font-size: 19px; }
}
.gen .w2 { grid-column: span 2; }
@media (max-width: 640px) { .gen .w2 { grid-column: 1 / -1; } }

/* การ์ดตารางรวม (โก้ 2 ธ.ค.): วันที่ใกล้ที่สุด + ย่อ/ขยายทั้งสัปดาห์ในการ์ดเดียว */
.sched.one { display: block; }
.sched.one .today { padding-bottom: 12px; }
.sched.one .near { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 4px 18px; align-items: center; }
.sched.one .today-list { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.wk-more { margin-top: 12px; }
.wk-more > summary { list-style: none; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; padding: 9px 14px; border-radius: 12px;
  color: #FFE9A8; background: rgba(247,186,0,.1); border: 1px solid rgba(247,186,0,.35); font-size: 16px; user-select: none; }
.wk-more > summary::-webkit-details-marker { display: none; }
.wk-more > summary:hover { background: rgba(247,186,0,.18); }
.wk-more > summary i { font-style: normal; transition: transform .2s; }
.wk-more[open] > summary i { transform: rotate(180deg); }
.wk-more .l, .wk-more[open] .m { display: none; } .wk-more[open] .l { display: inline; }
.wk-more .week { margin-top: 10px; color: var(--text); box-shadow: none; }
.week-tip { color: var(--muted); }
.pre-list { margin: 12px 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); line-height: 2; }
.pre-list b { display: block; line-height: 1.4; }
.code-in.sm { font-size: 18px; letter-spacing: .06em; }
/* ปุ่ม − / + ทีละ 5 */
.stepper { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 6px; }
.stepper input { text-align: center; font-size: 20px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper button { border: 0; border-radius: 12px; font-size: 26px; line-height: 1; color: #fff; cursor: pointer; }
.st-plus { background: #16A34A; } .st-minus { background: #DC2626; }
.stepper button:active { transform: translateY(1px); }
.span-all { grid-column: 1 / -1; margin: 0; }
.opt input:disabled + span { opacity: .4; cursor: not-allowed; }
.gen-sum { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--soft); font-size: 15px; }
.gen-sum:empty { display: none; }
@media (max-width: 900px) { .sched.one .near { grid-template-columns: 1fr; } }
.pat-soon { margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: rgba(247,186,0,.14); color: #FFE9A8; font-size: 15px; }
.renew { margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--gold) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.renew a { white-space: nowrap; }

/* ไทล์ตารางเรียน (โก้ 2 ธ.ค.): ลักษณะเดียวกับปุ่มอื่น · บัตรสมาชิกเด่นที่สุด */
.tc-purple { background: linear-gradient(135deg, #8B5CF6, #6D28D9); }
button.tile { font: inherit; text-align: left; border: 0; cursor: pointer; width: 100%; }
.tile-st { position: relative; z-index: 2; margin-top: 8px; }
.tile-st .tcls-st { display: inline-block; font-size: 13px; padding: 2px 10px; border-radius: 999px; background: rgba(0,0,0,.22); color: #fff; }
.tile-st.s-live .tcls-st { background: #E3151B; } .tile-st.s-live .tcls-st::before { content: '●'; margin-right: 5px; animation: blink 1.4s infinite; }
.tile-st.s-soon .tcls-st { background: #FFD84D; color: #3B2600; }
.tile-st.s-leave .tcls-st, .tile-st.s-leavep .tcls-st { background: rgba(255,255,255,.9); color: #5B21B6; }
@media (min-width: 1200px) { .tiles.has-sched { grid-template-columns: repeat(5, minmax(0, 1fr)); } .tiles.has-sched .tile { padding-right: 100px; } .tiles.has-sched .tile-t { font-size: 21px; } .tiles.has-sched .tile-d { font-size: 13px; } .tiles.has-sched .tile-art { width: 84px; height: 84px; } .tiles.has-sched .tile-art img { width: 62px; height: 62px; } }
@media (max-width: 1199px) { .tiles.has-sched .sched-tile { grid-column: 1 / -1; min-height: 150px; } }
.wide-sheet { width: min(1100px, calc(100% - 24px)); }
.sched-sheet { padding: 18px 20px 16px; }
.sched-sheet .week { box-shadow: none; border: 0; padding: 8px 0 0; }
.sched-sheet .pat-soon { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); color: var(--text); margin-top: 10px; }
@media (max-width: 640px) { .wide-sheet { width: 100%; max-height: calc(88vh / var(--fz, 1)); } }
@media (max-width: 640px) {
  .tiles.has-sched .sched-tile { min-height: 0; padding: 12px 110px 44px 14px; }
  .tiles.has-sched .sched-tile .tile-art { width: 78px; height: 78px; right: 14px; bottom: 50%; transform: translateY(50%); }
  .tiles.has-sched .sched-tile .tile-art img { width: 58px; height: 58px; }
  .tiles.has-sched .sched-tile .tile-st { margin-top: 6px; }
}

/* การ์ดคาบเรียน (โก้ 2 ธ.ค. รอบ 3): แถวเดียวกับบัตร + นับถอยหลัง */
.top-row { display: grid; grid-template-columns: minmax(0, 520px) repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: stretch; }
.top-row > .card { max-width: 520px; }
.top-row > .cd { max-width: none; }
.nx { justify-content: flex-start; gap: 8px; padding: 16px 18px; }
.nx-h { display: flex; flex-direction: column; gap: 2px; }
.nx-day { font-size: 24px; font-weight: 400; line-height: 1.25; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nx-list { display: grid; gap: 7px; }
.nx-row { font: inherit; text-align: left; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "sub st" "time st"; align-items: center; column-gap: 10px;
  padding: 10px 12px; border-radius: 13px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #FFF8ED; }
button.nx-row { cursor: pointer; } button.nx-row:hover { background: rgba(255,255,255,.1); }
.nx-sub { grid-area: sub; font-size: 23px; line-height: 1.2; }
.nx-time { grid-area: time; font-size: 17px; color: #F3D98B; font-variant-numeric: tabular-nums; }
.nx-st { grid-area: st; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.12); white-space: nowrap; max-width: calc(44vw / var(--fz, 1)); overflow: hidden; text-overflow: ellipsis; }
.nx-row.s-live { border-color: rgba(227,21,27,.8); background: linear-gradient(100deg, rgba(227,21,27,.35), rgba(255,255,255,.05)); }
.nx-row.s-live .nx-st { background: #E3151B; color: #fff; } .nx-row.s-live .nx-st::before { content: '●'; margin-right: 5px; animation: blink 1.4s infinite; }
.nx-row.s-soon .nx-st { background: var(--foil); color: var(--ink); }
.nx-row.s-done { opacity: .5; } .nx-row.s-closed .nx-sub { text-decoration: line-through; opacity: .7; }
.nx-row.s-leave .nx-st { background: #6D5BD0; color: #fff; } .nx-row.s-leavep .nx-st { background: transparent; box-shadow: inset 0 0 0 1.5px #F7BA00; color: #FFE9A8; }
.nx-none { margin: 4px 0; color: #E9D9B8; }
.nx-pat { margin: 0; padding: 6px 10px; border-radius: 10px; background: rgba(247,186,0,.14); color: #FFE9A8; font-size: 14px; }
.nx-more { margin-top: auto; align-self: flex-start; font: inherit; font-size: 15px; color: #FFE9A8; background: none; border: 0; padding: 4px 0; cursor: pointer; border-bottom: 1px dashed rgba(247,186,0,.6); }
@media (max-width: 1100px) { .top-row { grid-template-columns: 1fr 1fr; } .top-row > .card { grid-column: 1 / -1; } }
@media (max-width: 640px) { .top-row { grid-template-columns: 1fr; } .nx-sub { font-size: 21px; } .nx-day { font-size: 21px; } }

/* กล่องข้อความ */
.help-cta { display: flex; align-items: center; gap: 14px; margin: 14px 0 16px; padding: 14px 16px; border-radius: 18px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #E5323E, #C4161F); box-shadow: 0 12px 24px -14px rgba(196,0,15,.8); }
.help-cta b { display: block; font-size: 19px; } .help-cta small { font-size: 13.5px; opacity: .9; }
.help-cta > span:nth-child(2) { flex: 1; }
.help-ic { width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 24px; flex: none; }
.help-go { font-size: 26px; } .help-new { background: #FFD84D; color: #3B2600; border-radius: 999px; padding: 2px 10px; font-size: 13px; white-space: nowrap; }
.help { max-width: 760px; margin: 0 auto; }
.help .panel { max-width: none; }
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kinds .opt b { font-size: 16px; }
.att { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.att-btn { display: inline-flex !important; cursor: pointer; padding: 8px 14px; border-radius: 12px; border: 1.5px dashed var(--line); font-size: 15px; color: var(--text); }
.att-prev { position: relative; } .att-prev img { max-height: 90px; max-width: 160px; border-radius: 10px; display: block; }
.att-prev .xbtn { position: absolute; top: -8px; right: -8px; }
.tk { text-decoration: none; color: var(--text); } .tk.is-new { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.tk-ic { font-size: 26px; flex: none; }
.tk-open { background: #FFF3CC; color: var(--gold-d); } .tk-answered { background: #E2F6EA; color: var(--ok); } .tk-closed { background: var(--soft); color: var(--muted); }
.th-h { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; } .th-h h1, .th-h h2 { margin: 0; font-size: 22px; }
.chat { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; background: var(--soft); margin: 10px 0; max-height: calc(60vh / var(--fz, 1)); overflow-y: auto; }
.bb { align-self: flex-start; max-width: 82%; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--surface); border: 1px solid var(--line); }
.bb.me { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: color-mix(in srgb, var(--gold) 20%, var(--surface)); }
.bb.team .bb-who { color: var(--crimson); }
.bb-who { display: block; font-size: 12px; color: var(--muted); }
.bb p { margin: 2px 0; overflow-wrap: anywhere; } .bb img { max-width: 100%; max-height: 320px; border-radius: 10px; margin-top: 4px; display: block; }
.chat-form { margin-top: 0; }
@media (max-width: 640px) { .kinds { grid-template-columns: 1fr; } }
.kinds .opt { display: block !important; } .kinds .opt span { width: 100%; }
.help h1 { font-size: 26px; line-height: 1.3; }
/* ประตูแจ้งเตือน */
.nt { max-width: 560px; margin-top: 24px; }
.nt-bell { font-size: 64px; line-height: 1; animation: ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-5deg); } }
.nt h1 { font-size: 26px; margin: 10px 0 6px; } .nt h2 { font-size: 20px; margin: 18px 0 6px; }
.nt-step { margin: 14px 0; padding: 14px 16px; border-radius: 16px; background: var(--soft); text-align: left; }
.nt-step[data-s="ask"], .nt-step[data-s="ok"] { background: transparent; text-align: center; }
.nt-go { width: 100%; font-size: 22px; padding: 16px; }
.nt-ol { margin: 6px 0; padding-left: 22px; line-height: 1.9; } .nt-ic { font-size: 18px; }
@media (prefers-reduced-motion: reduce) { .nt-bell { animation: none; } }

/* แชทครอบครัว (หน้าตาข้างในป๊อปอัพ) */
.info-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin: -4px 0 18px; }
.info-row > .cd { max-width: none; }
.chatc { display: flex; flex-direction: column; min-height: 0; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.chatc-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: linear-gradient(135deg, #16A34A, #0F7A37); color: #fff; }
.chatc-h > div { flex: 1; display: grid; } .chatc-h b { font-size: 19px; } .chatc-h small { font-size: 13px; opacity: .9; }
.chatc-ic { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 20px; }
.chatc-n { min-width: 26px; text-align: center; padding: 2px 8px; border-radius: 999px; background: #E3151B; font-size: 14px; }
.chatc-soon { padding: 2px 10px; border-radius: 999px; background: #FFD84D; color: #3B2600; font-size: 13px; }
.chatc-body { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 10px 12px; background: var(--soft); min-height: 150px; }
.cm { align-self: flex-start; max-width: 80%; padding: 6px 10px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--line); display: grid; font-size: 15px; }
.cm.me { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: color-mix(in srgb, var(--gold) 22%, var(--surface)); }
.cm.team .cm-who { color: var(--crimson); }
.cm.sys { align-self: center; max-width: 92%; background: var(--ink); color: #FFE9A8; border: 0; border-radius: 10px; font-size: 13.5px; text-align: center; }
.cm-who { font-size: 12px; color: var(--muted); } .cm-at { justify-self: end; font-size: 11px; color: var(--muted); }
.chatc-empty { margin: auto 0; text-align: center; color: var(--text); font-size: 15px; }
.chatc-in { display: flex; align-items: center; gap: 8px; margin: 10px 12px 12px; padding: 9px 12px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--muted); font-size: 15px; }
.chatc-in span:first-child { flex: 1; } .chatc-send { width: 30px; height: 30px; border-radius: 50%; background: #16A34A; color: #fff; display: grid; place-items: center; font-size: 14px; }

/* ปุ่มแชทลอย (โก้ 2 ธ.ค.): ลากได้ ชิดขอบจอเสมอ · แตะเปิดป๊อปอัพแชท */
.chat-fab { position: fixed; z-index: 30; right: 10px; top: 80px; width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: grab;
  font-size: 28px; color: #fff; background: radial-gradient(circle at 30% 25%, #4ADE80, #16A34A 55%, #0F7A37); box-shadow: 0 10px 24px -8px rgba(0,0,0,.55), 0 0 0 3px rgba(255,255,255,.85);
  touch-action: none; user-select: none; -webkit-user-select: none; transition: left .22s cubic-bezier(.22,1,.36,1), top .22s cubic-bezier(.22,1,.36,1), transform .15s; }
.chat-fab.dragging { transition: none; cursor: grabbing; transform: scale(1.08); }
.chat-fab-n { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #E3151B; color: #fff; font-size: 13px; line-height: 22px; box-shadow: 0 0 0 2px #fff; }
.chat-pop { border: 0; padding: 0; background: transparent; width: min(400px, calc(100% - 24px)); max-height: min(640px, calc(calc(100vh / var(--fz, 1)) - 24px)); overflow: visible; }
.chat-pop::backdrop { background: rgba(20,10,8,.35); }
.chat-pop .chatc { height: min(600px, calc(calc(100vh / var(--fz, 1)) - 40px)); box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
.chatc-x { background: rgba(255,255,255,.2); color: #fff; margin-left: 6px; }
@media (max-width: 640px) {
  .chat-pop { width: 100%; max-width: none; max-height: none; height: 100%; margin: 0; inset: 0; }
  .chat-pop .chatc { height: 100%; border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
}

/* 4 แท็บในห้องแชท */
.ctabs { display: flex; gap: 4px; padding: 6px 8px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.ctab { flex: 1 0 auto; font: inherit; font-size: 14.5px; padding: 7px 10px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ctab.on { background: color-mix(in srgb, #16A34A 14%, var(--surface)); color: #0F7A37; box-shadow: inset 0 -2px 0 #16A34A; }
.ctab b { margin-left: 5px; font-size: 11px; padding: 0 6px; border-radius: 999px; background: #E3151B; color: #fff; }
.cpanes { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cpane { display: none; flex: 1; flex-direction: column; min-height: 0; overflow-y: auto; }
.cpane.on { display: flex; }
.cpane .chatc-body { overflow-y: auto; }
.chatc-in .ph { font-size: 18px; } .chatc-in .tx { flex: 1; }
.aud { display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--soft); font-size: 12.5px; white-space: nowrap; }
.aud span { padding: 3px 8px; border-radius: 999px; } .aud .aud-on { background: #16A34A; color: #fff; }
.cm.lock { background: #EDE9FE; border-color: #C4B5FD; } .cm.lock.team { align-self: flex-end; border-radius: 14px 14px 4px 14px; }
.cm-lock { font-size: 11px; color: #5B21B6; }
.cm-img { display: grid; place-items: center; width: 140px; height: 90px; margin: 3px 0; border-radius: 10px; background: repeating-linear-gradient(45deg, var(--soft) 0 8px, var(--line) 8px 16px); font-size: 13px; color: var(--muted); }
.clist { display: grid; gap: 8px; padding: 12px; }
.ci { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.ci-ic { font-size: 22px; } .ci-m { flex: 1; display: grid; } .ci-m b { font-weight: 400; font-size: 16px; } .ci-m small { font-size: 13px; color: var(--muted); }
.ci-go { font-size: 14px; color: var(--accent); } .ci.w-late { border-color: #F3C2BC; background: #FFF6F5; } .ci.w-done { opacity: .8; }
.prog { padding: 14px; display: grid; gap: 10px; }
.prog-k { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .prog-k > div { padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; }
.prog-k b { font-size: 28px; color: #0F7A37; } .prog-k small { font-size: 12.5px; color: var(--muted); }
.prog-r { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 12px; background: var(--surface); color: #16A34A; }
.prog-r span { color: var(--text); } .prog-r b { color: var(--text); font-weight: 400; } .prog-r svg { width: 100%; }

/* แชทของทีมพี่: 3 คอลัมน์ */
.mock-note { margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: #FFF3CC; color: var(--gold-d); font-size: 14px; }
.tchat { display: grid; grid-template-columns: 300px minmax(0, 1fr) 280px; gap: 12px; height: calc(calc(100vh / var(--fz, 1)) - 190px); min-height: 560px; }
.tc-rooms, .tc-info { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 0; }
.tc-search { display: grid; grid-template-columns: 1fr 104px; gap: 6px; } .tc-search input, .tc-search select { font-size: 14px; padding: 8px 10px; }
.tc-rooms .fchips { margin: 0; } .tc-rooms .fchip { font-size: 12.5px; padding: 3px 9px; }
.tc-list { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 4px; }
.tc-room { font: inherit; text-align: left; display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.tc-room:hover { background: var(--soft); } .tc-room.on { background: color-mix(in srgb, #16A34A 12%, var(--surface)); box-shadow: inset 3px 0 0 #16A34A; }
.tc-room.alert .tc-rm small { color: #B91C1C; }
.tc-room .av .ph { display: grid; place-items: center; width: 40px; height: 40px; font-size: 17px; }
.tc-rm { flex: 1; min-width: 0; display: grid; } .tc-rm b { font-weight: 400; font-size: 15.5px; } .tc-rm small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-meta { display: grid; justify-items: end; gap: 2px; } .tc-meta small { font-size: 11.5px; color: var(--muted); }
.tc-meta b { min-width: 20px; text-align: center; font-size: 11.5px; padding: 0 6px; border-radius: 999px; background: #E3151B; color: #fff; } .tc-meta b.lk { background: #7C3AED; }
.tc-bulk { width: 100%; }
.tc-main { min-height: 0; }
.tc-main .chatc-h { position: relative; }
.tc-back, .tc-info-btn { font: inherit; border: 0; background: rgba(255,255,255,.2); color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 18px; }
.tc-back { display: none; }
.tc-quick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 0 12px 10px; font-size: 13px; color: var(--muted); } .tc-quick .fchip { font-size: 12.5px; padding: 3px 9px; }
.tc-info { overflow-y: auto; } .tc-info h3 { font-size: 16px; margin: 10px 0 4px; } .tc-info .info { font-size: 14px; margin: 0; }
.tc-card { display: flex; gap: 10px; align-items: center; } .tc-card .ph { display: grid; place-items: center; width: 48px; height: 48px; font-size: 20px; } .tc-card div { display: grid; } .tc-card small { color: var(--muted); font-size: 13px; }
.tc-mem { display: grid; gap: 4px; font-size: 14px; }
.tc-note { margin: 0; padding: 8px 10px; border-radius: 10px; background: #FFF9E6; border: 1px dashed var(--gold); font-size: 14px; }
@media (max-width: 1280px) { .tchat { grid-template-columns: 280px minmax(0, 1fr); } .tc-info { display: none; } .tchat.show-info .tc-info { display: flex; position: fixed; z-index: 40; right: 12px; top: 80px; bottom: 12px; width: 300px; } }
@media (max-width: 760px) {
  .tchat { grid-template-columns: 1fr; height: calc(calc(100vh / var(--fz, 1)) - 150px); }
  .tchat .tc-main { display: none; } .tchat.in-room .tc-rooms { display: none; } .tchat.in-room .tc-main { display: flex; }
  .tc-back { display: block; } .tchat.show-info .tc-info { left: 12px; width: auto; }
}
.ctabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
.ctab { position: relative; display: grid; justify-items: center; gap: 0; padding: 5px 2px; font-size: 13px; line-height: 1.2; }
.ctab i { font-style: normal; font-size: 18px; } .ctab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ctab b { position: absolute; top: 1px; right: calc(50% - 22px); margin: 0; }
.chatc-in .ph, .chatc-in .aud { flex: none !important; } .chatc-in .tx { flex: 1; text-align: left; }
.tc-info-btn { display: none; } @media (max-width: 1280px) { .tc-info-btn { display: block; } }
.tc-info { position: relative; } .tc-info-x { display: none; position: absolute; top: 10px; right: 10px; }
@media (max-width: 1280px) { .tchat.show-info .tc-info-x { display: block; } }
@media (max-width: 760px) {
  .tc-main .chatc-in { flex-wrap: wrap; border-radius: 18px; row-gap: 6px; }
  .tc-main .chatc-in .aud { width: 100%; justify-content: center; }
  .tc-main .chatc-in .aud span { flex: 1; text-align: center; }
}
/* นับถอยหลัง + แถบหด (โก้ 2 ธ.ค.) */
.nx-row { grid-template-areas: "sub st" "time cd" "bar bar"; row-gap: 2px; }
.nx-cd { grid-area: cd; justify-self: end; font-size: 22px; line-height: 1.1; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: #FFF3C4; }
.nx-row.s-live .nx-cd { color: #FFB4B6; }
.nx-bar { grid-area: bar; display: block; height: 6px; margin-top: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.nx-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #B07A00, #F7BA00 60%, #FFE9A8); box-shadow: 0 0 8px rgba(247,186,0,.45); transition: width 1s linear; }
.nx-row.s-soon .nx-bar i { background: linear-gradient(90deg, #C4000F, #F97316 55%, #F7BA00); }
.nx-row.s-live .nx-bar i { background: linear-gradient(90deg, #7A0710, #E3151B 60%, #FF7A7E); box-shadow: 0 0 10px rgba(227,21,27,.55); }
@media (max-width: 640px) { .nx-cd { font-size: 20px; } }
.nx-cd { display: flex; align-items: baseline; gap: 4px; } .nx-cd small { font-size: 13px; color: rgba(255,248,237,.65); } .nx-cd b { font-weight: 400; }
.nx-st:empty, .nx-st[hidden] { display: none; }
.nx-cd[hidden], .nx-bar[hidden], .nx-st[hidden] { display: none !important; }
.nx-row.s-soon .nx-st { background: var(--foil); color: var(--ink); }

/* ===== คลิปย้อนหลัง (ขั้น 5 · ตัวอย่างหน้าตา) ===== */
.cl { padding: 18px 0 34px; }
.cl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.cl-head h1 { font-size: clamp(28px, 3.4vw, 36px); margin: 0; }
.cl-head p { margin: 2px 0 0; }
.cl-search { display: flex; align-items: center; gap: 8px; flex: 0 1 380px; min-width: 240px; padding: 0 14px; height: 46px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.cl-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 17px; color: var(--text); outline: none; }
.cl-bar { display: block; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 22%, transparent); overflow: hidden; }
.cl-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--crimson), var(--red)); }
.cl-new { display: inline-block; padding: 0 10px; border-radius: 99px; background: color-mix(in srgb, var(--gold) 18%, var(--surface)); border: 1px solid var(--gold-d); color: var(--gold-d); font-size: 13px; line-height: 1.6; }
.cl-new.sm { font-size: 12px; padding: 0 8px; }

.cl-resume { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 18px; border-radius: 20px; text-decoration: none; color: #F6EBD9;
  background: radial-gradient(600px 160px at 0% 0%, rgba(227,21,27,.35), transparent 70%), var(--ink); border: 1.5px solid transparent;
  background-clip: padding-box; box-shadow: 0 0 0 1.5px rgba(247,186,0,.55), var(--shadow); }
.cl-resume-play { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(227,21,27,.45); }
.cl-resume-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cl-resume-txt b { font-size: 21px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-resume-txt .muted { color: #CDBB9F; font-size: 15px; }
.cl-resume .cl-bar { max-width: 420px; background: rgba(255,255,255,.14); margin-top: 4px; }
.cl-eyebrow { font-size: 14px; letter-spacing: .04em; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cl-resume-go { padding: 10px 20px; border-radius: 14px; background: var(--red); color: #fff; font-size: 17px; white-space: nowrap; }

.cl-subj, .cl-exam, .cl-sub2 { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin-bottom: 10px; }
.cl-subj::-webkit-scrollbar, .cl-exam::-webkit-scrollbar, .cl-sub2::-webkit-scrollbar { display: none; }
.cl-subj a { flex: none; padding: 8px 20px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-size: 17px; }
.cl-subj a.on { background: var(--crimson); border-color: var(--crimson); color: #fff; box-shadow: 0 6px 16px -6px rgba(196,0,15,.6); }
.cl-mode { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 16px; background: var(--ink); box-shadow: 0 0 0 1px rgba(247,186,0,.45); }
.cl-mode a { padding: 9px 22px; border-radius: 12px; color: #D9C9A8; text-decoration: none; font-size: 18px; min-height: 44px; display: flex; align-items: center; }
.cl-mode a.on { background: var(--foil); color: #1C1210; }
.cl-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 8px 0 10px; }
.cl-sec h2 { font-size: 22px; margin: 0; }

.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.cl-chap { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px 18px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.cl-chap:hover { transform: translateY(-2px); border-color: rgba(247,186,0,.7); }
.cl-chap::before { content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 0 4px 4px 0; background: var(--foil); }
.cl-chap-t { font-size: 19px; line-height: 1.35; padding-right: 54px; }
.cl-chap-m { color: var(--muted); font-size: 15px; }
.cl-chap-p { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.cl-chap-p .cl-bar { flex: 1; }
.cl-chap .cl-new { position: absolute; top: 14px; right: 14px; }
.cl-chap.full .cl-bar i { background: var(--foil); }
.cl-chap.full .cl-chap-p span:last-child { color: var(--gold-d); }
.cl-chap.empty { opacity: .6; box-shadow: none; border-style: dashed; }
.cl-chap.empty::before { background: var(--line); }

/* หน้าดูคลิป */
.cl-watch { padding-top: 12px; }
.cl-up { display: inline-block; margin-bottom: 10px; padding: 4px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-size: 16px; }
.cl-wgrid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr); gap: 18px; align-items: start; }
.cl-player { border-radius: 18px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px rgba(247,186,0,.35), 0 18px 40px -18px rgba(0,0,0,.6); }
.cl-video { position: relative; aspect-ratio: 16 / 9; background: #0E0B0A; overflow: hidden; }
.cl-board { position: absolute; inset: 0; background: linear-gradient(160deg, #1f3a2c, #162a20); color: #EDEFE6; font-family: system-ui, sans-serif; }
.cl-board span { position: absolute; left: 7%; opacity: .92; }
.cl-board .b1 { top: 10%; font-size: clamp(14px, 2.4vw, 30px); color: #FFE08A; }
.cl-board .b2 { top: 30%; font-size: clamp(18px, 3.6vw, 46px); }
.cl-board .b3 { top: 50%; font-size: clamp(12px, 2vw, 26px); }
.cl-board .b4 { top: 64%; font-size: clamp(12px, 2vw, 26px); color: #BFE6CF; }
.cl-wm { text-shadow: 0 0 3px rgba(0,0,0,.55); position: absolute; padding: 2px 10px; border-radius: 8px; font-size: clamp(11px, 1.3vw, 16px); color: rgba(255,255,255,.42); background: rgba(0,0,0,.14); pointer-events: none; white-space: nowrap; font-family: system-ui, sans-serif; letter-spacing: .02em; }
.cl-ctl { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 8px; background: linear-gradient(transparent, rgba(0,0,0,.82)); color: #fff; }
.cl-seek { position: relative; height: 5px; border-radius: 99px; background: rgba(255,255,255,.25); margin: 0 4px 8px; }
.cl-seek span { position: absolute; top: 0; bottom: 0; left: 0; border-radius: inherit; }
.cl-seek-buf { background: rgba(255,255,255,.35); }
.cl-seek-done { background: var(--red); }
.cl-seek-dot { width: 15px; height: 15px; top: -5px !important; margin-left: -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(227,21,27,.45); }
.cl-ctl-row { display: flex; align-items: center; gap: 4px; }
.cl-ctl-row button { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px; border: 0; border-radius: 10px; background: transparent; color: #fff; cursor: pointer; position: relative; }
.cl-ctl-row button:hover { background: rgba(255,255,255,.12); }
.cl-ctl-row button.big { color: #fff; }
.cl-ctl-row .sp { flex: 1; }
.cl-mid { display: none; position: absolute; inset: 0 0 48px; align-items: center; justify-content: center; gap: 28px; }
.cl-mid button { display: grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; }
.cl-mid button.big { width: 66px; height: 66px; background: rgba(227,21,27,.9); }
.cl-mid svg { width: 28px; height: 28px; }
.cl-time { font-family: system-ui, sans-serif; font-size: 14px; font-variant-numeric: tabular-nums; margin-left: 6px; white-space: nowrap; }
.cl-time i { font-style: normal; opacity: .7; }
.cl-rate { font-family: system-ui, sans-serif; font-size: 14px; font-weight: 700; border: 1px solid rgba(247,186,0,.6) !important; color: #FFE08A !important; height: 30px !important; }
.cl-ctl-row .gear em { position: absolute; right: 0; top: 3px; font-style: normal; font-family: system-ui, sans-serif; font-size: 9px; font-weight: 800; padding: 0 3px; border-radius: 4px; background: rgba(255,255,255,.2); }
.cl-info { padding: 14px 4px 0; }
.cl-info h1 { font-size: clamp(24px, 2.6vw, 30px); margin: 0 0 2px; }
.cl-info p { margin: 0; }
.cl-leave { margin-top: 10px !important; display: inline-block; padding: 6px 14px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 16%, var(--surface)); border: 1px solid rgba(176,122,0,.4); font-size: 15px; }
.cl-side { display: flex; flex-direction: column; gap: 12px; }
.cl-box { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); }
.cl-box h2 { font-size: 21px; margin: 0 0 8px; }
.cl-box h3 { font-size: 17px; margin: 0 0 8px; color: var(--muted); }
.cl-prog { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.cl-prog .cl-bar { flex: 1; }
.cl-pdf { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 12px 0 0; border: 1px solid var(--line); background: var(--soft); border-radius: 12px; text-decoration: none; color: var(--text); font-size: 16px; }
.cl-pdf:hover { background: var(--soft); }
.cl-pdf span { flex: 1; min-width: 0; line-height: 1.35; display: flex; flex-direction: column; }
.cl-pdf small { font-size: 12px; color: var(--muted); }
.cl-pdf i { font-style: normal; color: var(--accent); font-size: 14px; white-space: nowrap; }
.cl-list ol { list-style: none; margin: 0 -8px; padding: 0; }
.cl-list li a { display: flex; align-items: flex-start; gap: 10px; padding: 9px 8px; border-radius: 12px; text-decoration: none; color: var(--text); }
.cl-list li a:hover { background: var(--soft); }
.cl-list li.cur a { background: color-mix(in srgb, var(--red) 10%, var(--surface)); box-shadow: inset 3px 0 0 var(--red); }
.cl-st { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--line); font-size: 14px; color: #fff; }
.cl-st svg { width: 14px; height: 14px; }
.cl-list li.done .cl-st { background: var(--gold-d); border-color: var(--gold-d); }
.cl-list li.part .cl-st { border-color: var(--red); border-right-color: var(--line); border-bottom-color: var(--line); }
.cl-list li.cur .cl-st { background: var(--red); border-color: var(--red); }
.cl-li-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cl-li-t b { font-size: 16px; line-height: 1.35; font-weight: normal; }
.cl-list li.cur .cl-li-t b { color: var(--accent); }
.cl-li-t > span:not(.cl-bar) { font-size: 13px; color: var(--muted); }
.cl-li-t .cl-bar { height: 4px; margin-top: 3px; }
.cl-list li.done .cl-li-t b { color: var(--muted); }

/* ตะลุยโจทย์ */
.cl-exam a { flex: none; padding: 10px 24px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 18px; color: var(--text); cursor: pointer; }
.cl-exam a.on { background: var(--ink); color: #FFE9A8; border-color: var(--gold); box-shadow: 0 0 0 1px rgba(247,186,0,.4); }
.cl-sub2 a { flex: none; padding: 5px 16px; border-radius: 99px; font-size: 16px; color: var(--muted); cursor: pointer; border: 1px solid transparent; }
.cl-sub2 a.on { color: var(--accent); border-color: var(--accent); background: var(--surface); }
.cl-set { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.cl-set summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; cursor: pointer; list-style: none; font-size: 19px; }
.cl-set summary::-webkit-details-marker { display: none; }
.cl-set summary::after { content: '›'; margin-left: 4px; color: var(--muted); transition: transform .2s; }
.cl-set[open] summary::after { transform: rotate(90deg); }
.cl-set-m { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.cl-set-m .cl-bar { width: 110px; }
.cl-qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 8px; padding: 0 16px 16px; }
.cl-qgrid a { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: 15px; line-height: 1.3; }
.cl-qgrid a:hover { border-color: var(--accent); }
.cl-qgrid a span { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); font-size: 11px; color: #fff; }
.cl-qgrid a.done span { background: var(--gold-d); border-color: var(--gold-d); }
.cl-qgrid a.done { color: var(--muted); }
.cl-qgrid a.part span { border-color: var(--red); }
.center { text-align: center; }

@media (max-width: 1100px) { .cl-wgrid { grid-template-columns: minmax(0, 1fr); } .cl-side { display: grid; grid-template-columns: 1fr 1fr; } .cl-side > * { grid-column: 1 / -1; } }
@media (max-width: 700px) {
  .cl-side { display: flex; }
  .cl-watch .cl-player { position: sticky; top: 62px; z-index: 5; margin: 0 calc(-1 * clamp(14px, 3vw, 44px)); border-radius: 0; }
  .cl-ctl-row .vol, .cl-ctl-row .pc { display: none; }
  .cl-mid { display: flex; }
  .cl-ctl-row button { min-width: 44px; height: 44px; }
  .cl-time { font-size: 12px; margin-left: 2px; }
  .cl-resume { grid-template-columns: auto 1fr; padding: 14px; }
  .cl-resume-play { width: 48px; height: 48px; }
  .cl-resume-txt b { font-size: 18px; white-space: normal; }
  .cl-resume-go { grid-column: 1 / -1; text-align: center; }
  .cl-mode { display: flex; } .cl-mode a { flex: 1; justify-content: center; }
  .cl-search { flex: 1 1 100%; }
  .cl-set-m { margin-left: 0; width: 100%; }
}
@media (hover: none) { .cl-mid { display: flex; } .cl-ctl-row .pc { display: none; } .cl-ctl-row button { min-width: 44px; height: 44px; } }
.sheet .gen { padding: 18px 20px; margin: 0; }
.sheet .gen h3 { margin: 0; }
.ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wk-edit { all: unset; display: flex; flex-direction: column; flex: 1; min-width: 0; cursor: pointer; }
.wk-edit:hover span { color: var(--accent); }
.wk-edit:focus-visible { outline: 2px solid var(--gold); border-radius: 6px; }
td.nowrap { white-space: nowrap; } td.nowrap form { display: inline-block; }
.cl-practice { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 11px 14px; border-radius: 14px; text-decoration: none; color: #fff; background: linear-gradient(135deg, var(--crimson), var(--red)); box-shadow: 0 8px 18px -10px rgba(196,0,15,.7); min-height: 48px; }
.cl-practice:hover { filter: brightness(1.06); }
.cl-practice-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.18); font-size: 18px; flex: none; }
.cl-practice > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.cl-practice b { font-weight: normal; font-size: 17px; }
.cl-practice small { font-size: 12px; opacity: .85; }
.cl-practice i { font-style: normal; font-size: 22px; }
.cl-sec { align-items: flex-end; flex-wrap: wrap; }
.cl-sec h2 { margin-bottom: 2px; }
.cl-practice-subj { margin-top: 0; min-width: 280px; }
@media (max-width: 700px) { .cl-practice-subj { width: 100%; min-width: 0; } }
/* ปุ่มแชทลอย: เฉดเดียวกับบัตรสมาชิกของคอร์ส (ใช้ --c1 --c2 --glow ของ .c-XXX) + ขอบทองแบบบัตร */
.chat-fab[class*=" c-"]:not(.c-NONE) { background: radial-gradient(circle at 30% 25%, var(--glow), var(--c1) 58%, var(--c2)); box-shadow: 0 10px 24px -8px rgba(0,0,0,.55), 0 0 0 2.5px #F7BA00, 0 0 18px -2px var(--glow); }
.chat-fab.c-ADMIN { background: radial-gradient(circle at 30% 25%, #E3151B, #3A120E 60%, #1C1210); }
/* ห้องแชท: หัวห้อง ปุ่มส่ง แท็บที่เลือก ใช้สีตามบัตรของคอร์ส (น้อง) / บัตร ADMIN (ทีมพี่) */
:is(.chat-pop, .tchat)[class*=" c-"]:not(.c-NONE) .chatc-h { background: radial-gradient(500px 120px at 0% 0%, var(--glow), transparent 70%), linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: inset 0 -2px 0 #F7BA00; }
:is(.chat-pop, .tchat)[class*=" c-"]:not(.c-NONE) .chatc-send { background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 0 0 1.5px #F7BA00; }
:is(.chat-pop, .tchat)[class*=" c-"]:not(.c-NONE) .ctab.on { background: color-mix(in srgb, var(--c1) 14%, var(--surface)); color: var(--c1); box-shadow: inset 0 -2px 0 var(--c1); }
.tchat.c-ADMIN .tc-room.on { background: color-mix(in srgb, #E3151B 10%, var(--surface)); box-shadow: inset 3px 0 0 #E3151B; }
.tchat.c-ADMIN .aud .aud-on { background: #3A120E; }

/* ───── สมัคร / ยืนยันตัวตน / ผู้ปกครอง (3 ธ.ค. 2569 · ยกจากหน้าตัวอย่างที่โก้อนุมัติในแชท Google Sheets) ───── */
.su .panel { max-width: 760px; }
.su.narrow .panel { max-width: 560px; }
.su h1 { line-height: 1.25; margin: .2em 0 .3em; font-size: 28px; }
.su .sec { display: block; font-size: inherit; margin: 18px 0 0; border-top: 1px dashed var(--line); padding-top: 14px; }
.su .sec::after { content: none; }
.su .sec h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 0 0 4px; }
.su .sec h2 .n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--gold); font-size: 16px; flex: none; }
.su .hint { margin: 0 0 8px 40px; color: var(--muted); font-size: 15px; }
.su .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.su .full { grid-column: 1 / -1; }
.su .f { display: flex; flex-direction: column; gap: 6px; font-size: 17px; position: relative; }
.su .f > span b { color: var(--accent); }
.su .f > span em, .su .f > label em { font-style: normal; color: var(--muted); font-size: 14px; }
.su textarea { font: inherit; font-size: 18px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); width: 100%; resize: vertical; min-height: 76px; }
.su select { appearance: none; padding-right: 40px; cursor: pointer; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238B7A6B' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center; }
.su input[readonly] { background: var(--soft); color: var(--muted); }
.su .f.bad input, .su .f.bad select { border-color: #E06A60; background-color: color-mix(in srgb, #E06A60 8%, var(--bg)); }
.su .err { display: none; color: #C0262E; font-size: 14px; }
.su .f.bad .err { display: block; }
.su .ok-tick { position: absolute; right: 12px; top: 43px; color: #1E9E62; font-size: 18px; display: none; font-style: normal; }
.su .f.good .ok-tick { display: block; }
.su .pick { position: relative; }
.su .pick input { padding-right: 40px; }
.su .pick .caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.su .list { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 6px); max-height: 320px; overflow: auto; background: var(--surface); border: 1.5px solid var(--gold); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: none; }
.su .list.open { display: block; }
.su .list .g { font-size: 13px; letter-spacing: .06em; color: var(--gold-d); padding: 8px 10px 4px; }
.su .opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); cursor: pointer; font: inherit; font-size: 17px; min-height: 44px; }
.su .opt:hover, .su .opt.hi { background: var(--soft); }
.su .opt .ab { flex: none; font-size: 14px; color: var(--ink); background: color-mix(in srgb, var(--gold) 28%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); padding: 1px 8px; border-radius: 999px; }
.su .opt .sub { display: block; font-size: 13px; color: var(--muted); }
.su .empty { padding: 10px; color: var(--muted); font-size: 15px; }
.su .chosen { display: none; margin-top: 6px; font-size: 15px; color: var(--muted); }
.su .chosen.on, .su .other.on { display: block; }
.su .other { display: none; margin-top: 8px; }
.su .seg4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.su .seg4 button { font: inherit; padding: 11px 6px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; font-size: 17px; min-height: 48px; }
.su .seg4 button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--gold); }
.su .seg4 button:disabled { opacity: .35; cursor: not-allowed; }
.su .f.bad .seg4 button { border-color: #E06A60; }
.su .staff { margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--gold) 12%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--gold) 60%, transparent); }
.su .staff input { letter-spacing: .3em; background: var(--surface); }
.su .tick { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); cursor: pointer; font-size: 17px; }
.su .tick input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); padding: 0; }
.su .tick small { display: block; color: var(--muted); font-size: 14px; }
.su .tick.vip { border-color: #F3C2BC; background: color-mix(in srgb, #E06A60 7%, var(--bg)); }
.su .note-red { color: #C0262E; font-size: 14px; }
.su .inst { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: var(--soft); }
.su .inst .r { display: grid; grid-template-columns: 70px 1fr 1fr; gap: 10px; align-items: center; }
.su .inst .r b { font-weight: normal; color: var(--gold-d); font-size: 16px; }
.su .inst input { padding: 10px 12px; font-size: 17px; background: var(--surface); }
.su .inst input[readonly] { background: var(--surface); color: var(--text); opacity: .8; }
.su .inst .warn { display: none; color: #C0262E; font-size: 14px; }
.su .inst .warn.on { display: block; }
.su .total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: var(--ink); color: #F4E6C6; }
.su .total b { font-size: 28px; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.su .total small { display: block; font-size: 14px; color: #CDB98F; }
.su .who { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 14px; border-radius: 14px; background: var(--soft); font-size: 16px; color: var(--muted); }
.su .who b { font-weight: normal; color: var(--text); }
.su .btn-gold, .su .btn-dark { width: 100%; margin-top: 20px; }
.su .btn-gold:disabled { opacity: .55; cursor: wait; }
.su .btn-dark { font: inherit; border-radius: 14px; padding: 12px 20px; font-size: 18px; cursor: pointer; background: var(--ink); color: var(--gold); border: 0; margin-top: 16px; }
.su .alert { display: none; margin: 10px 0 0; }
.su .alert.on, .su .alert.show { display: block; }
.su .alert.good { background: #EEF9F2; border-color: #BFE6CF; color: #146B43; }
.su .row { justify-content: stretch; margin-top: 20px; }
.su .row .btn-gold { flex: 1; width: auto; margin-top: 0; }
.su .hide { display: none !important; }
.su .modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(28,18,16,.55); }
.su .modal.on { display: flex; }
.su .modal .panel { width: 100%; max-height: calc(92vh / var(--fz, 1)); overflow: auto; margin: 0; max-width: 620px; }
.su .bill { border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.su .bill .hd { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 10px; margin-bottom: 10px; }
.su .bill .hd b { font-size: 22px; }
.su .bill .hd small { display: block; color: var(--muted); font-size: 14px; }
.su .bill .tag { font-size: 13px; color: var(--ink); background: var(--foil); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.su .bill .ln { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.su .bill .ln.minus { color: #1E9E62; }
.su .bill .ln.sum { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-size: 21px; color: var(--accent); }
.su .bill .how { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--soft); font-size: 16px; line-height: 1.7; }
.su .copy-h { margin: 18px 0 0; color: var(--muted); font-size: 15px; }
.su .copy-row { margin-top: 8px; }
.su .copy-row .btn-gold { font-size: 17px; padding: 12px 14px; }
.su .close-btn { width: 100%; margin-top: 12px; }
.su .img-fallback { display: none; margin-top: 10px; text-align: center; }
.su .img-fallback.on { display: block; }
.su .img-fallback p { margin: 0 0 8px; color: var(--muted); font-size: 15px; }
.su .img-fallback img { width: 100%; max-width: 420px; border-radius: 14px; border: 1px solid var(--line); -webkit-touch-callout: default; }
/* ยืนยันตัวตน */
.su .roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.su .roles label { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--bg); cursor: pointer; text-align: center; min-height: 110px; justify-content: center; }
.su .roles label .ic { font-size: 30px; line-height: 1; }
.su .roles label b { font-weight: normal; font-size: 19px; }
.su .roles label small { color: var(--muted); font-size: 14px; line-height: 1.35; }
.su .roles label { position: relative; }
.su .roles input { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.su .roles label:has(input:checked) { border-color: var(--ink); background: var(--ink); color: #F4E6C6; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 45%, transparent); }
.su .roles label:has(input:checked) b { color: var(--gold); }
.su .roles label:has(input:checked) small { color: #CDB98F; }
.su .roles label:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.su .vform .f { margin-top: 12px; }
.su .vform:has(input[value=parent]:checked) .only-st { display: none; }
.su .vform:not(:has(input[value=parent]:checked)) .only-pa { display: none; }
.su .tries { margin: 10px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.su .lost { margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: var(--soft); }
.su .lost p { margin: 0 0 10px; }
.su .lost .row { margin-top: 0; }
.su .lost .row > * { flex: 1; }
.su .out { margin-top: 14px; text-align: center; }
.su .done-ic { font-size: 54px; text-align: center; line-height: 1; margin: 6px 0; }
.su .invite { margin-top: 16px; padding: 14px 16px; border-radius: 16px; border: 1.5px dashed color-mix(in srgb, var(--gold) 70%, transparent); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.su .invite p { margin: 0 0 8px; }
.su .invite input { font-size: 15px; background: var(--surface); }
.su .kids { display: grid; gap: 10px; margin-top: 14px; }
.su .kid { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--soft); }
.su .kid b { font-weight: normal; font-size: 19px; }
.su .kid small { display: block; color: var(--muted); font-size: 14px; }
@media (max-width: 640px) {
  .su .grid { grid-template-columns: 1fr; }
  .su .panel { padding: 18px 16px; }
  .su h1 { font-size: 24px; }
  .su .hint { margin-left: 0; }
  .su .seg4 { grid-template-columns: repeat(2, 1fr); }
  .su .inst .r { grid-template-columns: 1fr 1fr; }
  .su .inst .r b { grid-column: 1 / -1; }
  .su .row .btn-ghost { flex: 1; }
}
.li.warn { border-color: #F3C2BC; background: color-mix(in srgb, #E06A60 7%, var(--surface)); }
.su .enter, .su .billb { width: 100%; margin-top: 16px; }
/* คาบพิเศษ/ชดเชย/ย้ายคาบ (3 ธ.ค. 2569) */
.seg3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .seg3 legend { grid-column: 1 / -1; }
.seg3 .opt span { text-align: center; justify-content: center; }
.xk[hidden] { display: none !important; }
.xgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; padding: 12px; border-radius: 14px; background: var(--soft); }
.xgrid .span2 { grid-column: 1 / -1; }
.xgrid select:disabled { opacity: .6; }
.xarrow { margin: 0; font-size: 15px; color: var(--crimson); font-weight: 700; text-align: center; }
.xb { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-style: normal; font-size: 12.5px; line-height: 1.6; vertical-align: middle; font-weight: 700; letter-spacing: .2px; }
.xb-extra, .tag.xb-extra { background: var(--foil, #F7BA00); color: var(--ink, #1a1a1a); }
.xb-makeup, .tag.xb-makeup { background: #1F1A17; color: #F7D774; }
.xb-move, .tag.xb-move { background: var(--crimson, #B91C1C); color: #fff; }
.nx-sub .xb { font-size: 13px; }
.wcls-sub .xb { margin-left: 4px; padding: 0 6px; font-size: 11px; }
.nx-note { grid-column: 1 / 2; font-size: 14px; color: #E9D9B8; }
.ann.extra { border-left: 4px solid var(--gold); }
@media (max-width: 640px) { .seg3 .opt span { padding: 10px 6px; font-size: 15px; } }
.xtime { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .xmove .xdate { grid-column: 1 / -1; }
/* ── ธีมกระดาษฉีก (แบบคลิป CapCut "Aesthetic") ──
   พื้นหลังหน้าเว็บ: ธีม ลายน่ารัก (--bg-pat สุ่มจากเซิร์ฟเวอร์ ดู bgsync.ts / views.ts) · ธีม วิดีโอ (.bgv)
   กรอบทุกกรอบ: ขอบกระดาษฉีกสีขาวยื่นออกนอกกรอบ ไม่ยุ่งกับข้างในกรอบ (img/torn-frame.webp · สร้างด้วย torn_frame.py) */
:root { --bg-pat: none; --pat-int: 20; --pat-veil: calc((100 - var(--pat-int)) * 1%); }
/* ลายน่ารัก: ลายจาก Drive (ขนาดตามไฟล์) ทับด้วยสีพื้นตามความเข้มที่น้องเลือก */
html[data-theme="cute"] body:not(.bare) { background: linear-gradient(color-mix(in srgb, var(--bg) var(--pat-veil), transparent), color-mix(in srgb, var(--bg) var(--pat-veil), transparent)), var(--bg-pat) 0 0 repeat, var(--bg); }
/* วิดีโอ: คลิปเต็มจอด้านหลัง + ม่านสีพื้นตามความเข้ม */
html[data-theme="video"] { background: #000; }
html[data-theme="video"] body:not(.bare) { background: transparent; }
.bgv { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; pointer-events: none; }
.bgveil { position: fixed; inset: 0; z-index: -1; background: var(--bg); opacity: calc((100 - var(--pat-int)) / 100); pointer-events: none; }
.card, .today, .cd, .tile, .panel { border-style: solid; border-color: transparent; border-image: url(/img/torn-frame.webp) 96 / 48px / 24px round; }
.card, .today, .tile { border-width: 0; }
.tiles, .sched { gap: 24px; }
/* ขอบกระดาษฉีกรอบพื้นหลังข้อความทักทาย — ตามรูปแปรงสี ยืด/หดตามความยาวข้อความเองอัตโนมัติ (filter #torn-paper อยู่ใน homePage) */
.hello .brush { filter: url(#torn-paper); }
.hello { margin-bottom: 22px; }
/* เมนูตั้งค่าลายพื้นหลัง (ในเมนูธีม 🎨) */
.patgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 8px 0 12px; }
.patgrid .pt { aspect-ratio: 1; border-radius: 10px; border: 2px solid var(--line); background-size: 90px; background-position: center; cursor: pointer; padding: 0; }
.patgrid .pt.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(247,186,0,.3); }
.patint { width: 100%; accent-color: var(--gold); margin: 0 0 14px; }
.patint-h b { color: var(--text); }
.sw-cute span { background: url(/img/bg/hearts-check.svg) center / 48px; }
.sw-video span { background: radial-gradient(circle at 40% 50%, #fff 0 22%, transparent 23%), linear-gradient(135deg, #C4000F, #F7BA00); }
.sw .sw-n { font-style: normal; font-size: 11px; color: var(--muted); }
.sw:disabled { opacity: .5; cursor: not-allowed; }
.bg-note { font-size: 13px; color: var(--muted); margin: -2px 0 12px; }
.seg button { font-size: 13px; }
/* ───── ปลั๊กอิน: พิชิตบทเรียน · เกมฝึกทักษะ (3 ธ.ค. 2569) ───── */
.tc-purple { background: linear-gradient(135deg, #8B5CF6, #5B21B6); }
@media (max-width: 1199px) { .tiles:not(.has-sched) > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 1200px) { .tiles:not(.has-sched) { grid-template-columns: repeat(5, minmax(0, 1fr)); } .tiles:not(.has-sched) .tile { padding-right: 96px; } .tiles:not(.has-sched) .tile-art { width: 80px; height: 80px; } .tiles:not(.has-sched) .tile-art img { width: 58px; height: 58px; } .tiles:not(.has-sched) .tile-t { font-size: 21px; } .tiles:not(.has-sched) .tile-d { font-size: 13px; } }
.pg-head { display: flex; align-items: center; gap: 18px; margin: 8px 0 18px; padding: 18px 22px; border-radius: 22px; background: linear-gradient(120deg, #1C1210, #3A120E 60%, #5B21B6); color: #FFF8ED; box-shadow: 0 16px 30px -18px rgba(0,0,0,.7); }
.pg-head h1 { margin: 0; font-size: 30px; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pg-head p { margin: 4px 0 0; color: #F3E6CF; font-size: 16px; }
.pg-hero { width: 84px; height: 84px; flex: none; padding: 12px; border-radius: 50%; background: #fff; box-shadow: 0 8px 18px -8px rgba(0,0,0,.5); box-sizing: border-box; }
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.pg-card { position: relative; display: grid; gap: 4px; padding: 18px 18px 16px; min-height: 150px; border-radius: 20px; background: var(--surface); border: 1.5px solid var(--line); color: var(--text); text-decoration: none; box-shadow: 0 10px 22px -18px rgba(0,0,0,.5); transition: transform .15s, box-shadow .15s, border-color .15s; }
a.pg-card:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 16px 28px -18px rgba(0,0,0,.55); }
.pg-ic { font-size: 40px; line-height: 1; font-style: normal; }
.pg-t { font-size: 22px; font-weight: 700; margin-top: 6px; }
.pg-d { font-size: 14px; color: var(--muted); }
.pg-go { margin-top: auto; padding-top: 8px; color: var(--crimson, #C4161F); font-weight: 700; }
.pg-card.off { background: var(--soft, #F5EFE6); box-shadow: none; border-style: dashed; border-color: #C9B79C; } .pg-card.off .pg-ic { filter: grayscale(1); opacity: .55; } .pg-card.off .pg-t, .pg-card.off .pg-d { color: var(--muted); }
.pg-soon { margin-top: auto; padding-top: 8px; color: var(--muted); font-size: 14px; }
.pg-empty { padding: 28px; text-align: center; color: var(--muted); }
body.is-play .foot { display: none; }
body.is-play main.wrap { max-width: none; padding: 0; }
/* หน้าเล่นปลั๊กอินเต็มจอเสมอ ไม่ย่อ/ขยายตามแถบขนาดตัวอักษร (โก้ 4 ธ.ค.) · หัวเว็บยังซูมตามแถบ · --play-top = ขอบบนจริงของกรอบเกม (plug.js วัดให้) */
body.is-play > main { zoom: 1 !important; }
.pg-play { height: calc(100dvh - var(--play-top, 68px)); min-height: 420px; }
.pg-play iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: normal; } /* โก้ 4 ธ.ค.: ปลั๊กอินใช้พื้นหลังของเว็บ */
body.is-play .viewbar ~ main .pg-play { height: calc(100dvh - var(--play-top, 112px)); }
@media (max-width: 640px) { .pg-head { padding: 14px 16px; gap: 12px; } .pg-head h1 { font-size: 24px; } .pg-hero { width: 56px; height: 56px; } .pg-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .pg-card { min-height: 128px; padding: 14px; } .pg-t { font-size: 18px; } .pg-ic { font-size: 32px; } }
/* การ์ดวิชา (พิชิตบทเรียน/เกม) ใช้ .tile ของหน้าแรก · สีประจำวิชา */
.pg-tiles { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 640px) { .pg-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pg-tiles > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.sj-math { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.sj-physics { background: linear-gradient(135deg, #8B5CF6, #5B21B6); }
.sj-chemistry { background: linear-gradient(135deg, #10B981, #047857); }
.sj-biology { background: linear-gradient(135deg, #F472B6, #BE185D); }
.sj-english { background: linear-gradient(135deg, #FBBF24, #EA580C); }
.sj-science { background: linear-gradient(135deg, #22D3EE, #0E7490); }
.sj-thai { background: linear-gradient(135deg, #F87171, #B91C1C); }
.sj-social { background: linear-gradient(135deg, #F59E0B, #92400E); }
.sj-g0 { background: linear-gradient(135deg, #F97316, #C2410C); } .sj-g1 { background: linear-gradient(135deg, #3B82F6, #1D4ED8); } .sj-g2 { background: linear-gradient(135deg, #10B981, #047857); } .sj-g3 { background: linear-gradient(135deg, #8B5CF6, #5B21B6); }
.sj-g4 { background: linear-gradient(135deg, #F472B6, #BE185D); } .sj-g5 { background: linear-gradient(135deg, #22D3EE, #0E7490); } .sj-g6 { background: linear-gradient(135deg, #F87171, #B91C1C); } .sj-g7 { background: linear-gradient(135deg, #FBBF24, #EA580C); }
.tile-emo { font-size: 56px; line-height: 1; font-style: normal; }
.tile.sj.off { cursor: default; } .tile.sj.off:hover { transform: none; }
.tile.sj .tile-pill:not(:empty) { position: relative; z-index: 2; }
/* แบบ B: ลายสัญลักษณ์ประจำวิชา */
.pg-tiles .tile.sj::before { content: attr(data-pat); position: absolute; inset: -10px -20px auto auto; width: 70%; font-size: 30px; line-height: 1.5; color: #fff; opacity: .16; transform: rotate(-12deg); white-space: normal; word-spacing: 14px; text-align: right; pointer-events: none; z-index: 0; }
.pg-tiles .tile.sj.off::before { background: none; }
/* แบบ C: พรีเมียมเข้ม ขอบทอง */
/* ปุ่มย้อนกลับมาตรฐาน (โก้ 3 ธ.ค.): มุมซ้ายบน ก่อนโลโก้ · มีเฉพาะหน้าที่ย้อนแล้วไม่ใช่หน้าแรก · กลับไปตำแหน่งเดิม */
.top .back { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 10px; border-radius: 999px; border: 1.5px solid #E7B84A; color: #FFE7A8; text-decoration: none; font-size: 16px; background: rgba(255,255,255,.04); }
.top .back b { font-size: 26px; line-height: 1; margin-top: -3px; font-weight: 700; }
.top .back:hover { background: rgba(231,184,74,.16); }
.top .back + .brand { margin-right: auto; }
.top .wrap:has(.back) { justify-content: flex-start; } .top .wrap:has(.back) .tools { margin-left: auto; }
@media (max-width: 640px) { .top .back { height: 38px; padding: 0 10px 0 8px; } .top .back span { display: none; } .top .back:has(+ .brand) + .brand span { display: none; } }
/* ตัวเลือกสำหรับให้โก้เลือก (ภาพเปรียบเทียบ): a = วงกลม · b = แคปซูล (ตั้งต้น) · c = ข้อความ */
.top .back { width: 40px; padding: 0; justify-content: center; } .top .back span { display: none; }

/* แถบหัวทุกหัวข้อ (โก้ 3 ธ.ค.) — พื้นแปรงสีขอบกระดาษฉีกแบบเดียวกับข้อความทักทาย */
.sec-head { margin: 6px 0 20px; }
.sec-head .art { position: relative; display: inline-flex; max-width: 100%; box-sizing: border-box; align-items: center; gap: 18px; padding: .9em 1.9em 1.15em; font-size: clamp(18px, 2.2vw, 26px); color: #fff; }
.sec-head .brush { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: 0; filter: url(#torn-paper); }
.sec-ic { position: relative; z-index: 2; flex: none; width: 78px; height: 78px; padding: 12px; box-sizing: border-box; border-radius: 50%; background: #fff; box-shadow: 0 8px 18px -8px rgba(0,0,0,.45); }
.sec-txt { position: relative; z-index: 2; min-width: 0; text-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 10px rgba(0,0,0,.35), 0 0 22px rgba(0,0,0,.2); }
.sec-txt h1 { margin: 0; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.2; color: #fff; }
.sec-txt p { margin: 4px 0 0; font-size: 17px; color: #fff; }
@media (max-width: 640px) { .sec-head .art { gap: 12px; padding: 1em 1.4em 1.2em; } .sec-ic { width: 56px; height: 56px; padding: 8px; } .sec-txt p { font-size: 14px; } }

/* ขนาดตัวอักษรทั้งเว็บ (โก้ 3 ธ.ค.): ขยายทั้งหน้าตามสัดส่วน (zoom) · --fz ตั้งจาก localStorage bp_fz · หน่วย vh/vw หารด้วย --fz แล้ว
   ปุ่มแชทลอยกับพื้นหลังวิดีโอไม่ขยาย · เมนูธีมคงขนาดเดิมเสมอ (กดลดกลับได้แน่นอน) */
html { --fz: 1; }
body > :not(#chat-fab):not(.bgv):not(.bgveil):not(script) { zoom: var(--fz); }
#prefs { zoom: calc(1 / var(--fz)); }
.menu-h.sl-h { margin-bottom: 0; } .menu-h.sl-h b { color: var(--text); }
.patint { display: block; height: 22px; margin: 0 0 12px; }
/* เลขเวอร์ชัน + วันอัปเดต ต่อท้าย ONSITE MEMBERS (เฉพาะทีมพี่) */
.brand i em { font-style: normal; }
.brand .ver { font-size: 10px; font-style: normal; letter-spacing: .04em; color: #E7B84A; margin-left: .7em; white-space: nowrap; }
.brand .ver::before { content: '· '; color: #D9C9A8; }
.brand .ver.new { color: #1C1210; background: #F7BA00; border-radius: 999px; padding: 0 6px; } .brand .ver.new::before { content: ''; }
@media (max-width: 640px) { .brand i:has(.ver) { display: block; } .brand i:has(.ver) em { display: none; } .brand .ver { margin-left: 0; font-size: 9.5px; } .brand .ver::before { content: ''; } }
#prefs { width: min(340px, calc(100vw - 24px)); max-height: 70vh; }
@media (max-width: 640px) { body > header.top, body > .viewbar { zoom: 1 !important; } body > header.top #prefs { zoom: 1; } }
/* โหมดพักหน้าจอ (โก้ 3 ธ.ค.) — คลิปพื้นหลังเต็มจอ ความเข้ม 100% อยู่บนสุด */
.ss { position: fixed; inset: 0; z-index: 2147483000; background: #000; opacity: 0; transition: opacity .6s ease; cursor: none; }
.ss.in { opacity: 1; } .ss.out { opacity: 0; transition-duration: .3s; }
.ss video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* จอแนวตั้ง (มือถือ/iPad ตั้ง): คลิป 16:9 แสดงเต็มคลิปไม่ตัดข้าง วางกลางจอ */
@media (orientation: portrait) { .ss video { object-fit: contain; } }
.ss-fill { position: absolute; inset: -10%; width: 120%; height: 120%; filter: blur(28px) brightness(.55) saturate(1.2); display: none; }
@media (orientation: portrait) { .ss-fill { display: block; } }
.ss-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.55), transparent 38%), linear-gradient(to bottom, rgba(0,0,0,.35), transparent 22%); pointer-events: none; }
.ss-brand { position: absolute; top: max(22px, env(safe-area-inset-top)); left: 28px; display: flex; align-items: center; gap: 10px; opacity: .9; }
.ss-brand img { width: 54px; height: auto; } .ss-brand span { font-size: 22px; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ss-clock { position: absolute; left: 32px; bottom: max(30px, env(safe-area-inset-bottom)); color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.ss-time { font-size: clamp(56px, 9vw, 120px); line-height: 1; font-variant-numeric: tabular-nums; }
.ss-date { font-size: clamp(16px, 2vw, 24px); margin-top: 6px; color: #FFE7A8; }
.ss-hint { position: absolute; right: 28px; bottom: max(34px, env(safe-area-inset-bottom)); color: rgba(255,255,255,.85); font-size: 15px; padding: 8px 14px; border-radius: 999px; background: rgba(0,0,0,.35); animation: ss-hint 6s ease forwards; }
@keyframes ss-hint { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 640px) { .ss-brand { left: 18px; } .ss-brand img { width: 44px; } .ss-clock { left: 20px; } .ss-hint { left: 20px; right: auto; bottom: auto; top: max(80px, env(safe-area-inset-top)); font-size: 13px; } }

main.wrap { padding-bottom: 32px; } body.is-play main.wrap { padding-bottom: 0; }
/* ───── เครื่องเล่นคลิปจริง (ขั้น 5) ───── */
.cl-video video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
.cl-video:fullscreen { aspect-ratio: auto; width: 100vw; height: 100vh; } .cl-video:-webkit-full-screen { aspect-ratio: auto; width: 100vw; height: 100vh; }
.cl-wm { z-index: 3; transition: left 1.2s ease, top 1.2s ease; }
.cl-video:fullscreen .cl-wm { font-size: 20px; }
.cl-ctl, .cl-mid { z-index: 4; transition: opacity .25s ease; }
.cl-player.playing:not(.show) .cl-ctl, .cl-player.playing:not(.show) .cl-mid { opacity: 0; pointer-events: none; }
.cl-player.playing:not(.show) .cl-video { cursor: none; }
.cl-menu { z-index: 6; }
.cl-player.muted .vol { opacity: .45; }
.cl-stall { position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(86%, 380px); display: grid; gap: 6px; justify-items: center; text-align: center; padding: 16px 18px; border-radius: 16px; background: rgba(20,12,10,.88); color: #fff; box-shadow: 0 0 0 1px rgba(231,184,74,.5); }
.cl-stall b { font-size: 18px; color: #FFE7A8; } .cl-stall span { font-size: 14px; opacity: .9; }
.cl-stall button, .cl-end .btn { margin-top: 6px; font: inherit; font-size: 15px; padding: 8px 18px; border-radius: 999px; border: 0; background: #E3151B; color: #fff; cursor: pointer; text-decoration: none; }
.cl-end { position: absolute; z-index: 5; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; background: rgba(10,6,5,.78); color: #fff; padding: 16px; }
.cl-end span { color: #FFE7A8; font-size: 14px; } .cl-end b { font-size: clamp(16px, 2vw, 22px); max-width: 90%; }
.cl-chap.empty { pointer-events: none; }
.cl-end[hidden], .cl-stall[hidden], .cl-menu[hidden] { display: none !important; }
.cl-exam a, .cl-sub2 a, .cl-subj a { text-decoration: none; }
/* ลายน้ำอ่านออกทั้งบนกระดานขาวและพื้นเข้ม: ป้ายดำโปร่ง + ตัวขาว */
.cl-wm { color: rgba(255,255,255,.88); background: rgba(20,12,10,.34); text-shadow: none; font-family: system-ui, sans-serif; font-weight: 600; letter-spacing: .02em; }
/* แถบเลื่อนความเร็ว (แบบเดียวกับแถบในเมนูจานสี) */
.cl-spd { position: absolute; right: 12px; bottom: 58px; width: min(260px, 70%); padding: 12px 14px 4px; border-radius: 14px; background: rgba(20,12,10,.92); color: #fff; box-shadow: 0 0 0 1px rgba(231,184,74,.45); }
.cl-spd .menu-h { display: flex; gap: 8px; align-items: baseline; font-size: 15px; margin-bottom: 6px; } .cl-spd .menu-h b { color: #FFE7A8; }
.cl-spd .patint { margin: 0 0 8px; }
/* ลายน้ำแบบ A ไม่มีกรอบ (โก้เลือก 3 ธ.ค.): ตัวเทาโปร่ง อ่านออกทั้งกระดานขาวและพื้นเข้ม */
.cl-wm { background: none; padding: 0; color: rgba(128,128,128,.42); text-shadow: 0 0 1px rgba(255,255,255,.18); font-size: clamp(12px, 1.4vw, 17px); }
.cl-spd .menu-h { color: #fff; }
/* หลังบ้าน: สิทธิ์การเห็น */
.vis-pick { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 10px 0; } .vis-pick label { display: grid; gap: 4px; font-size: 15px; } .vis-pick select { min-width: 240px; }
.vis-who { margin: 6px 0 10px; }
.vis-q { width: 100%; max-width: 420px; margin: 10px 0; }
.vis-tree { display: grid; gap: 4px; }
.vis-f > summary, .vis-leaf { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.vis-f > summary { list-style: none; } .vis-f > summary::-webkit-details-marker { display: none; }
.vis-f > summary::before { content: '›'; color: var(--muted); transition: transform .2s; } .vis-f[open] > summary::before { transform: rotate(90deg); }
.vis-leaf { cursor: default; margin-left: 14px; }
.vis-k { display: grid; gap: 4px; margin: 4px 0 4px 22px; padding-left: 8px; border-left: 2px dashed var(--line); }
.vis-n { flex: 1 1 220px; } .vis-n small { color: var(--muted); }
.vis-on, .vis-off { font-size: 13px; padding: 1px 8px; border-radius: 99px; } .vis-on { background: #E5F6EA; color: #1C7A3A; } .vis-off { background: #FCE8E8; color: #B3261E; }
.vis-src { font-size: 12px; padding: 1px 7px; border-radius: 99px; background: var(--soft); color: var(--muted); } .vis-src.c { background: #FFF1CC; color: #8A5A00; } .vis-src.u { background: #E9E2FF; color: #4B2DB3; }
.vis-sel { font: inherit; font-size: 14px; padding: 4px 8px; border-radius: 8px; }
.vis-f[hidden] { display: none; }
/* ลายน้ำใช้ฟอนต์เว็บ (โก้ 3 ธ.ค.) */
.cl-wm { font-family: 'BoonJot', system-ui, sans-serif; font-weight: 400; letter-spacing: 0; font-size: clamp(13px, 1.6vw, 19px); }
.vis .vis-sel { width: auto; flex: none; max-width: 100%; }
.vis-h { margin: 14px 0 4px; font-size: 18px; }
.vis-tabs { display: flex; gap: 8px; margin: 6px 0; } .vis-tabs a { text-decoration: none; padding: 7px 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); } .vis-tabs a.on { background: var(--crimson); border-color: var(--crimson); color: #fff; }

/* ═════ คลิปย้อนหลัง: ปกบท + เรียนต่อ ธีมเดียวกับหน้าแรก (3 ธ.ค. · เสนอ 3 แบบ ?cv=a|b|c) ═════ */
.cl-top { display: grid; gap: 4px 20px; align-items: center; margin-bottom: 8px; }
@media (min-width: 820px) { .cl-top.has-res { grid-template-columns: minmax(0, 1fr) minmax(300px, 42%); } .cl-top .cl-resume { margin: 0; } }
.cl-top-l .sec-head { margin-bottom: 10px; } .cl-top-l .cl-head { margin-bottom: 6px; }
/* เรียนต่อ = สีบัตรสมาชิกของคอร์ส */
.cl-resume[class*="c-"] { background: radial-gradient(130% 160% at 0% 0%, var(--c1) 0%, var(--c2) 62%), var(--c2); border: 0; box-shadow: 0 0 0 1px rgba(247,186,0,.55), 0 16px 34px -18px var(--glow); }
.cl-resume .cl-eyebrow { color: #FFE08A; }
/* ชิปวิชา: สีประจำวิชาเมื่อเลือก */
.cl-subj a { display: inline-flex; align-items: center; gap: 6px; }
.cl-subj a.on { box-shadow: 0 0 0 2px rgba(247,186,0,.75), 0 8px 18px -8px rgba(0,0,0,.4); }
.cl-practice-subj { background: linear-gradient(135deg, #E5323E, #C4161F) !important; box-shadow: 0 0 0 1px rgba(247,186,0,.6), 0 12px 24px -14px #000; }

/* การ์ดบท — โครงร่วม */
.cl-grid.cv-a, .cl-grid.cv-b, .cl-grid.cv-c { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1399px) { .cl-grid.cv-a, .cl-grid.cv-b, .cl-grid.cv-c { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .cl-grid.cv-a, .cl-grid.cv-b, .cl-grid.cv-c { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.cl-grid[class*="cv-"] .cl-chap { padding: 0; gap: 0; overflow: hidden; border-radius: 18px; text-decoration: none; color: #fff; }
.cl-grid[class*="cv-"] .cl-chap::before { display: none; }
.cl-cv { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 112px; padding: 12px 12px 10px; }
.cl-cv-art { position: absolute; right: 10px; top: 10px; width: 50px; height: 50px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 27px; box-shadow: 0 6px 14px -6px rgba(0,0,0,.45); }
.cl-cv-t { position: relative; display: flex; flex-direction: column; gap: 0; padding-right: 4px; }
.cl-no { font-size: clamp(21px, 1.7vw, 26px); line-height: 1.1; letter-spacing: .01em; }
.cl-ttl { font-size: 14px; line-height: 1.3; opacity: .95; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cl-cv-b { display: grid; gap: 4px; padding: 8px 12px 10px; }
.cl-grid[class*="cv-"] .cl-chap-m { font-size: 13px; }
.cl-grid[class*="cv-"] .cl-chap-p { font-size: 12px; gap: 6px; }
.cl-grid[class*="cv-"] .cl-chap .cl-new { position: absolute; left: 10px; top: 10px; right: auto; font-size: 12px; padding: 0 8px; background: #FFD84D; color: #3B2600; border: 0; }
.cl-grid[class*="cv-"] .cl-chap.empty { opacity: 1; filter: none; } /* บทที่ยังไม่เปิด: สีเต็มเหมือนเดิม ไม่ซีด · ต่างด้วยป้ายเหลือง "เร็ว ๆ นี้" (โก้ 4 ธ.ค.) */
.cl-grid[class*="cv-"] .cl-chap.empty .cl-chap-m { justify-self: start; font-size: 12px; padding: 1px 10px; border-radius: 999px; background: #FFD84D; color: #3B2600; }
.cl-grid[class*="cv-"] .cl-chap:hover { transform: translateY(-3px); }

/* A — ไทล์สีเต็มใบแบบหน้าแรก + ขอบกระดาษฉีก */
.cv-a .cl-chap { background: linear-gradient(135deg, var(--s2) 0%, var(--s1) 100%); border-style: solid; border-color: transparent; border-image: url(/img/torn-frame.webp) 96 / 34px / 17px round; box-shadow: 0 12px 24px -16px rgba(0,0,0,.6); }
.cv-a .cl-cv::after { content: ''; position: absolute; right: -36px; top: -36px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.14); }
.cv-a .cl-cv-art { z-index: 1; }
.cv-a .cl-cv-b { padding-top: 0; }
.cv-a .cl-chap-m, .cv-a .cl-chap-p { color: rgba(255,255,255,.9); }
.cv-a .cl-bar { background: rgba(255,255,255,.28); } .cv-a .cl-bar i { background: #FFE08A; }

/* B — ปกสี + ฐานดำทอง (ChatGPT แนะนำ) */
.cv-b .cl-chap { background: #1A1311; border: 0; box-shadow: 0 0 0 1px rgba(247,186,0,.45), 0 14px 26px -16px rgba(0,0,0,.7); }
.cv-b .cl-cv { background: linear-gradient(135deg, var(--s2), var(--s1)); }
.cv-b .cl-cv::after { content: ''; position: absolute; left: 0; right: 0; bottom: -7px; height: 14px; background: #1A1311; -webkit-mask: radial-gradient(7px at 7px 0, #0000 98%, #000) -7px 7px / 14px 14px repeat-x; mask: radial-gradient(7px at 7px 0, #0000 98%, #000) -7px 7px / 14px 14px repeat-x; }
.cv-b .cl-chap-m { color: #D9C7A4; } .cv-b .cl-chap-p { color: #BFAE8C; }
.cv-b .cl-bar { background: rgba(255,255,255,.12); } .cv-b .cl-bar i { background: var(--foil); }

/* C — ดำทองหรูหรา สีวิชาเฉพาะวงภาพ */
.cv-c .cl-chap { background: radial-gradient(120% 120% at 100% 0%, #2B1E18, #120D0B 70%); border: 0; box-shadow: inset 0 0 0 1px rgba(247,186,0,.55), 0 14px 26px -16px rgba(0,0,0,.7); }
.cv-c .cl-cv-art { background: linear-gradient(135deg, var(--s2), var(--s1)); box-shadow: 0 0 0 2px #E7B84A, 0 6px 14px -6px rgba(0,0,0,.6); }
.cv-c .cl-no { background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cv-c .cl-ttl { color: #EFE3CC; }
.cv-c .cl-cv-b { border-top: 1px dashed rgba(247,186,0,.3); }
.cv-c .cl-chap-m { color: #CDBB9F; } .cv-c .cl-chap-p { color: #A9987A; }
.cv-c .cl-bar { background: rgba(255,255,255,.1); } .cv-c .cl-bar i { background: linear-gradient(90deg, var(--s2), var(--s1)); }
/* หน้าดูคลิป: กล่องข้างพื้นขาวแบบเดิม (โก้ 3 ธ.ค.) · หัวกล่อง = ปกบทสีของบทนั้น */
.cl-side.th .cl-sidecv { padding: 0; overflow: hidden; }
.cl-side.th .cl-sidecv .cl-cv { background: linear-gradient(135deg, var(--s2), var(--s1)); color: #fff; min-height: 96px; padding: 14px 16px 12px; }
.cl-side.th .cl-sidecv .cl-no { font-size: 26px; } .cl-side.th .cl-sidecv .cl-ttl { font-size: 15px; -webkit-line-clamp: 3; }
.cl-side.th .cl-sidecv > :not(.cl-cv) { margin-left: 14px; margin-right: 14px; }
.cl-side.th .cl-sidecv .cl-prog { margin-top: 12px; }
.cl-side.th .cl-sidecv > :last-child { margin-bottom: 14px; }
.cl-side.th .cl-list li.cur > a { background: color-mix(in srgb, var(--s1) 12%, var(--surface)); box-shadow: inset 3px 0 0 var(--s1); }
.cl-side.th .cl-list li.cur .cl-st { background: var(--s1); border-color: var(--s1); color: #fff; }
.cl-side.th .cl-list li.cur .cl-li-t b { color: var(--s1); }
.cl-side.th .cl-st { font-size: 12px; font-family: system-ui, sans-serif; }
/* เรียนต่อ: กดได้ทั้งการ์ด ไม่มีปุ่มซ้ำ · กะทัดรัด */
.cl-top .cl-resume { padding: 12px 16px; gap: 12px; grid-template-columns: auto 1fr auto; }
.cl-top .cl-resume-play { width: 48px; height: 48px; }
.cl-top .cl-resume-txt b { font-size: 19px; }
.cl-top .cl-resume-go { padding: 0; background: none; font-size: 30px; color: #FFE08A; }
@media (max-width: 760px) { .cl-top .cl-resume { grid-template-columns: auto 1fr auto; } .cl-top .cl-resume-go { grid-column: auto; } .cl-top .cl-resume-txt b { white-space: nowrap; } }
.cv-a .cl-cv-t, .cv-a .cl-chap-m { text-shadow: 0 1px 2px rgba(0,0,0,.28); }
/* ภาพประกอบปกบท (สติกเกอร์) */
.cl-cv-art.img { width: 66px; height: 66px; right: 8px; top: 8px; padding: 3px; overflow: hidden; }
.cl-cv-art.img img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.cl-cv:has(.cl-cv-art.img) { min-height: 124px; }

/* ═════ ตะลุยโจทย์ ธีมเดียวกับปกบท (3 ธ.ค.) ═════ */
.cl-exam a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: 16px; background: #1A1311; color: #F3E4C4; border: 0; box-shadow: 0 0 0 1px rgba(247,186,0,.35); font-size: 18px; }
.cl-exam a.on { background: linear-gradient(135deg, #F7C948, #D99A0B); color: #2A1A00; box-shadow: 0 0 0 2px #FFE08A, 0 10px 20px -12px rgba(0,0,0,.6); }
.cl-set.th { background: var(--surface); border: 0; border-radius: 18px; overflow: hidden; border-style: solid; border-color: transparent; border-image: url(/img/torn-frame.webp) 96 / 34px / 17px round; box-shadow: 0 12px 24px -16px rgba(0,0,0,.45); }
.cl-set.th summary { background: linear-gradient(135deg, var(--s2), var(--s1)); color: #fff; padding: 14px 18px; gap: 12px; }
.cl-set.th summary::after { color: #fff; font-size: 22px; }
.cl-set-t { display: flex; flex-direction: column; min-width: 0; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.cl-set-t b { font-size: clamp(20px, 1.8vw, 26px); line-height: 1.1; } .cl-set-t span { font-size: 14px; opacity: .95; }
.cl-set.th .cl-set-m { color: rgba(255,255,255,.92); } .cl-set.th .cl-bar { background: rgba(255,255,255,.3); } .cl-set.th .cl-bar i { background: #FFE08A; }
.cl-set.th .cl-qgrid { padding: 14px 16px 16px; }
.cl-set.th .cl-qgrid a { background: var(--surface); }
.cl-set.th .cl-qgrid a:hover { border-color: var(--s1); }
.cl-set.th .cl-qgrid a span { width: 26px; height: 26px; border: 0; background: color-mix(in srgb, var(--s1) 14%, transparent); color: var(--s1); font: 600 12px system-ui, sans-serif; }
.cl-set.th .cl-qgrid a.done span { background: var(--s1); color: #fff; }
.cl-set.th .cl-qgrid a.part span { box-shadow: inset 0 0 0 2px var(--s1); }
/* เรียนต่อ + ชุดตะลุยโจทย์: กรอบรอยหยัก + สีบัตรคอร์ส (โก้ 3 ธ.ค.) */
.cl-top .cl-resume { border-style: solid; border-color: transparent; border-image: url(/img/torn-frame.webp) 96 / 34px / 17px round; background-clip: padding-box; }
.cl-set.th summary { background: radial-gradient(130% 220% at 0% 0%, var(--c1) 0%, var(--c2) 62%), var(--c2); box-shadow: inset 0 -1px 0 rgba(247,186,0,.45); }
.cl-set.th .cl-set-t b { color: #FFE08A; } .cl-set.th .cl-set-t span { color: #F3E4C4; }
.cl-set.th .cl-bar i { background: var(--foil); }
.cl-set.th .cl-qgrid a:hover { border-color: #E7B84A; }
.cl-set.th .cl-qgrid a span { background: color-mix(in srgb, #E7B84A 22%, transparent); color: #8A5A00; }
.cl-set.th .cl-qgrid a.done span { background: linear-gradient(135deg, #F7C948, #D99A0B); color: #2A1A00; }
.cl-set.th .cl-qgrid a.part span { box-shadow: inset 0 0 0 2px #D99A0B; }
/* หลังบ้าน 🎨 ภาพปก */
.art-sum { margin: 8px 0 14px; font-size: 17px; } .art-sum b.warn { color: #B3261E; }
#art-prompt { width: 100%; font: 14px/1.5 system-ui, sans-serif; margin-bottom: 8px; }
.art-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.art-cell { display: grid; gap: 6px; } .art-cell img { width: 100%; aspect-ratio: 1; border-radius: 14px; border: 1px solid var(--line); background: #fff; } .art-cell select { font-size: 13px; }
.art-list { display: grid; gap: 6px; }
.art-row { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.art-row.miss { border-color: #F2B8B5; background: #FFF6F5; }
.art-th { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #fff; overflow: hidden; } .art-th img { width: 100%; height: 100%; object-fit: contain; }
.art-t { flex: 1; display: grid; } .art-t small { color: var(--muted); } .art-s { font-size: 13px; white-space: nowrap; }
/* ปกบทกะทัดรัด (โก้ 3 ธ.ค.): เลขบทชิดซ้ายบน · ภาพมุมขวาบน · ลดที่ว่าง */
.cl-grid[class*="cv-"] .cl-cv, .cl-cv:has(.cl-cv-art.img) { min-height: 0; justify-content: flex-start; padding: 10px 12px 4px; }
.cl-grid[class*="cv-"] .cl-cv-t { padding-right: 60px; min-height: 52px; }
.cl-grid[class*="cv-"] .cl-cv-art.img { width: 54px; height: 54px; top: 8px; right: 8px; padding: 2px; }
.cl-grid[class*="cv-"] .cl-cv-art:not(.img) { width: 44px; height: 44px; font-size: 23px; top: 8px; right: 8px; }
.cl-grid[class*="cv-"] .cl-no { font-size: clamp(19px, 1.5vw, 23px); }
.cl-grid[class*="cv-"] .cl-ttl { font-size: 13px; }
.cl-grid[class*="cv-"] .cl-cv-b { padding: 2px 12px 9px; gap: 2px; }
.cv-a .cl-cv::after { width: 96px; height: 96px; right: -26px; top: -26px; }
.cl-grid[class*="cv-"] .cl-chap .cl-new { left: auto; right: 66px; top: 8px; }
/* เสียง (โก้ 4 ธ.ค.) — หมวดใต้ภาษาในเมนูจานสี · กระชับ: แถบเลื่อนบรรทัดเดียวกับตัวเลข · ปุ่มเตี้ย · ชุดเสียงเป็นชิป */
.ptabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: -4px -4px 12px; border-radius: 14px; background: var(--soft); position: sticky; top: -14px; z-index: 2; }
.ptabs button { min-height: 40px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; }
.ptabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1.5px var(--gold), 0 2px 6px rgba(0,0,0,.12); }
.snd-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; font-size: 15px; }
.tg { position: relative; flex: none; width: 46px; height: 26px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--soft); cursor: pointer; padding: 0; transition: background .2s, border-color .2s; }
.tg::after { content: ''; position: absolute; inset: -9px -4px; } /* พื้นที่แตะ ≥ 44px */
.tg i { position: absolute; top: 2.5px; left: 2.5px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.tg.on { background: linear-gradient(135deg, #F7BA00, #E7B84A); border-color: #C9971C; }
.tg.on i { transform: translateX(20px); }
.snd-sub { padding: 8px 10px; margin: 0 0 6px; border-radius: 12px; background: var(--soft); display: grid; gap: 6px; }
.snd-sub .lg { background: var(--surface); }
.snd-vol { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.snd-vol .patint { flex: 1; margin: 0; height: 22px; }
.snd-vol b { min-width: 3.2em; text-align: right; font-weight: 400; color: var(--text); }
.snd-now { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.snd-now span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snd-now span b { font-weight: 400; }
.snd-next { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid #E7B84A; background: var(--surface); color: var(--text); font-size: 15px; cursor: pointer; }
.snd-list { display: grid; grid-template-columns: 1fr; gap: 4px; max-height: 150px; overflow: auto; }
.snd-list .lg { font-size: 14px; text-align: left; padding: 5px 10px; min-height: 34px; border-radius: 10px; overflow-wrap: anywhere; }
.seg.seg3 { grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0; } .seg.seg3 button { font-size: 12.5px; padding: 5px 2px; min-height: 34px; border-radius: 10px; }
.snd-cat { font-size: 12.5px; color: var(--muted); margin: 4px 2px 0; } .snd-cat:first-child { margin-top: 0; }
#snd-sc { margin: 0; gap: 4px; } #snd-sc button { font-size: 13px; padding: 5px 4px; min-height: 34px; border-radius: 10px; }
.snd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.snd-chips .lg { font-size: 14px; padding: 5px 12px; min-height: 34px; border-radius: 999px; }
.snd-sub .bg-note { margin: 0; }

/* พิชิตบทเรียน: หน้าเลือกบท (การ์ดแบบคลิป · โก้ 4 ธ.ค.) */
.mc-score { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 4px 10px; padding: 14px 20px; margin: 4px 0 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 24px -18px rgba(0,0,0,.35); }
.mc-score span { grid-column: 1 / -1; font-size: 15px; color: var(--muted); }
.mc-score b { font-size: 34px; line-height: 1; color: var(--crimson); }
.mc-score small { font-size: 17px; color: var(--text); }
.mc-score .cl-bar { grid-column: 1 / -1; margin-top: 6px; }
.cl-chap .mc-go { justify-content: flex-end; font-size: 17px; color: #fff; }
/* คะแนนสะสม: สีเดียวกับบัตรสมาชิกของคอร์ส (โก้ 4 ธ.ค.) */
.mc-score[class*="c-"] { position: relative; overflow: hidden; border: 0; color: #fff; background: radial-gradient(130% 160% at 0% 0%, var(--c1) 0%, var(--c2) 62%), var(--c2); box-shadow: 0 0 0 1.5px rgba(247,186,0,.75), 0 16px 34px -18px var(--glow); }
.mc-score[class*="c-"] span { color: #FFE08A; letter-spacing: .02em; }
.mc-score[class*="c-"] b { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.25); }
.mc-score[class*="c-"] small { color: rgba(255,255,255,.85); }
.mc-score[class*="c-"] .cl-bar { background: rgba(255,255,255,.18); }
.mc-score[class*="c-"] .cl-bar i { background: linear-gradient(90deg, #F7BA00, #FFE08A); }
/* โก้ 4 ธ.ค.: ปุ่มโหมด บทเรียน/ตะลุยโจทย์ ข้างช่องค้นหา · ปุ่มวิชาใต้บล็อกเรียนต่อ */
.cl-head { align-items: center; }
.cl-head { flex-wrap: nowrap; gap: 10px; }
.cl-head .cl-search { flex: 1 1 200px; min-width: 0; }
.cl-head .cl-mode { margin-bottom: 0; flex: none; }
.cl-head .cl-mode a { min-height: 38px; padding: 4px 14px; font-size: 16px; white-space: nowrap; }
.cl-top-r { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cl-top-r .cl-subj { margin-bottom: 0; flex-wrap: wrap; overflow: visible; }
.cl-top-r .cl-subj a { padding: 6px 14px; font-size: 16px; }
@media (max-width: 760px) { .cl-head { flex-wrap: wrap; } .cl-head .cl-search { flex: 1 1 100%; } .cl-head .cl-mode { flex: 1 1 100%; } .cl-top-r .cl-subj { flex-wrap: nowrap; overflow-x: auto; } }

/* บัตรกระชับ + แบบย่อ/ขยาย (โก้ 5 ธ.ค. · ความเห็น ChatGPT+Gemini) */
.top-row { align-items: start; }
.card { aspect-ratio: 1.95 / 1; justify-content: flex-start; gap: 4.5cqw; }
.card-mid { flex: 1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4cqw; }
.card-pic { width: 21cqw; height: 21cqw; }
.card-who { min-width: 0; } .card-name, .card-full { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-crs { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 1px; padding-left: 3.5cqw; border-left: 1px solid rgba(247,186,0,.3); max-width: 40cqw; }
.card-crs .card-code { font-size: clamp(18px, 5.2cqw, 26px); line-height: 1.15; }
.card-crs .card-course { font-size: clamp(11px, 2.7cqw, 14px); line-height: 1.35; }
.fold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s cubic-bezier(.22,1,.36,1); }
.fold-in { overflow: hidden; min-height: 0; display: grid; gap: 7px; }
.fold-in > :first-child { margin-top: 7px; }
.open > .fold { grid-template-rows: 1fr; }
.fold-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 8px; padding: 7px 10px; font: inherit; font-size: 14px; color: #FFE9A8; cursor: pointer;
  background: rgba(247,186,0,.08); border: 1px solid rgba(247,186,0,.28); border-radius: 10px; transition: background .2s; }
.fold-btn:hover { background: rgba(247,186,0,.16); } .fold-btn:focus-visible { outline: 2px solid #FFE08A; outline-offset: 2px; }
.fold-btn i { font-style: normal; font-size: 16px; line-height: 1; transition: transform .3s cubic-bezier(.22,1,.36,1); }
.fold-btn .fold-c, .open > .fold-btn .fold-l { display: none; } .open > .fold-btn .fold-c { display: inline; }
.open > .fold-btn i { transform: rotate(180deg); }
.cd > .fold .cd-i { border-bottom: 0; }
.today.open .team-c > .fold { grid-template-rows: 1fr; } .today > .fold-btn .fold-c, .today.open > .fold-btn .fold-l { display: none; } .today.open > .fold-btn .fold-c { display: inline; } .today.open > .fold-btn i { transform: rotate(180deg); }
.team-c .fold-in { gap: 0; } .team-c .fold-in > :first-child { margin-top: 2px; }
.nx .nx-more { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .fold, .fold-btn i { transition: none; } }
@media (max-width: 640px) { .card { aspect-ratio: auto; gap: 14px; } .card-pic { width: 64px; height: 64px; } .card-name { font-size: 28px; } .card-full { font-size: 14px; } }

/* ตารางเรียนกระชับ (โก้ 5 ธ.ค. รอบ 2): เวลาต่อท้ายวิชาบรรทัดเดียว · ปุ่มทั้งสัปดาห์มุมขวาบนระดับเดียวกับป้าย 📅 */
.nx-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nx-top .cd-k { margin-bottom: 0; }
.nx-wk { font: inherit; font-size: 12.5px; line-height: 1.2; color: #FFE9A8; cursor: pointer; white-space: nowrap; padding: 3px 11px; border-radius: 999px;
  background: rgba(247,186,0,.12); border: 1px solid rgba(247,186,0,.4); transition: background .2s; }
.nx-wk:hover { background: rgba(247,186,0,.22); } .nx-wk:focus-visible { outline: 2px solid #FFE08A; outline-offset: 2px; }
.nx-row { grid-template-areas: "sub st" "note cd" "bar bar"; padding: 8px 12px; }
.nx-sub { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; font-size: 21px; }
.nx-sub .nx-time { font-size: 16px; }
.nx-note { grid-area: note; }
.nx-cd { grid-column: 1 / -1; }
@media (max-width: 640px) { .nx-sub { font-size: 19px; } .nx-sub .nx-time { font-size: 15px; } .nx-wk { font-size: 12px; padding: 3px 9px; } }


/* วันนี้ทุกคอร์ส แบบบล็อกตามช่วงเวลา (โก้ 5 ธ.ค.) */
.tb-list { display: grid; gap: 8px; }
.tb { display: block; padding: 9px 11px; border-radius: 13px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.tb-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tb-t { font-size: 20px; font-weight: 400; color: #FFE9A8; font-variant-numeric: tabular-nums; }
.tb-n { font-size: 12.5px; color: #D9C59C; }
.tb .wcls-st { margin-left: auto; grid-column: auto; font-style: normal; font-size: 12.5px; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.1); color: #F3E6C8; white-space: nowrap; }
.tb.s-live { border-color: rgba(227,21,27,.8); background: linear-gradient(100deg, rgba(227,21,27,.3), rgba(255,255,255,.05)); }
.tb.s-live .wcls-st { background: #E3151B; color: #fff; } .tb.s-soon .wcls-st { background: var(--foil); color: var(--ink); }
.tb.s-done { opacity: .55; }
.tb-c { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.tb-p { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; font-size: 13.5px; color: #FFF5E0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); }
.tb-p b { font-weight: 400; font-size: 12.5px; padding: 1px 8px; border-radius: 999px; color: #fff; background: radial-gradient(circle at 30% 25%, var(--glow), var(--c1) 70%); box-shadow: inset 0 0 0 1px rgba(247,186,0,.35); }
.team .fold-in > .tb { margin-top: 8px; }

/* ฝั่งแอดมิน (โก้ 5 ธ.ค.): สนามสอบมาก่อนตารางวันนี้ทุกคอร์ส · จอกลางวางบัตร+สนามสอบซ้อนกันทางซ้าย ตารางยาวทางขวา ไม่เหลือที่ว่าง */
.top-row.top-team { grid-template-columns: minmax(0, 520px) minmax(280px, 1fr) minmax(320px, 1.25fr); grid-template-areas: "card cd sched"; }
.top-team > .card { grid-area: card; grid-column: auto; } .top-team > .cd { grid-area: cd; } .top-team > .sched { grid-area: sched; }
@media (max-width: 1240px) { .top-row.top-team { grid-template-columns: 1fr 1fr; grid-template-areas: "card sched" "cd sched"; } .top-team > .sched { align-self: start; } }
@media (max-width: 640px) { .top-row.top-team { grid-template-columns: 1fr; grid-template-areas: "card" "cd" "sched"; } }

/* แบบทดสอบที่พี่มอบหมาย (โก้ 5 ธ.ค.): หน้าแรก · พิชิตบทเรียน · หน้าวิชา · ChatGPT+Gemini: ซ้ายชื่อบท+กติกา / ขวาสถานะ+ปุ่ม */
.as { margin: 0 0 18px; padding: 14px 16px 12px; border-radius: 18px; color: #FFF5E0; background: radial-gradient(120% 140% at 0% 0%, #4a0f14 0%, #241010 55%, #140a09 100%);
  border: 1px solid rgba(247,186,0,.35); box-shadow: 0 10px 26px rgba(40,6,6,.28), inset 0 1px 0 rgba(255,233,168,.15); }
.as { border-color: transparent; border-image: url(/img/torn-frame.webp) 96 / 48px / 24px round; }
.as-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px; }
.as-k { font-size: 20px; color: #FFE08A; }
.as-h small { font-size: 13px; color: #D9C59C; }
.as-list { display: grid; gap: 8px; }
.as .fold-in > .as-list { margin-top: 8px; }
.as-c { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.as-c.urgent { border-color: rgba(227,21,27,.75); background: linear-gradient(100deg, rgba(227,21,27,.22), rgba(255,255,255,.05)); }
.as-c.done, .as-c.exp { opacity: .78; }
.as-art { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; overflow: hidden; background: linear-gradient(135deg, var(--s1), var(--s2)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.as-art img { width: 46px; height: 46px; object-fit: contain; }
.as-main { min-width: 0; }
.as-t { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.as-t b { font-weight: 400; font-size: 18px; color: #FFF5E0; }
.as-sj { font-size: 12px; padding: 1px 9px; border-radius: 999px; color: #2a1606; background: linear-gradient(90deg, #FFE08A, #F7BA00); }
.as-m { font-size: 13px; color: #E9D6A8; margin-top: 2px; }
.as-bar { height: 5px; border-radius: 999px; background: rgba(255,255,255,.12); margin-top: 7px; overflow: hidden; }
.as-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #F7BA00, #FFE08A); }
.as-c.urgent .as-bar i { background: linear-gradient(90deg, #E3151B, #FF8A5B); }
.as-due { font-size: 12.5px; color: #F3E6C8; margin-top: 4px; }
.as-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.as-go { font-size: 15px; white-space: nowrap; padding: 8px 16px; border-radius: 999px; color: #fff; text-decoration: none; background: linear-gradient(180deg, #E3151B, #A50D12);
  box-shadow: 0 4px 12px rgba(227,21,27,.35), inset 0 1px 0 rgba(255,255,255,.3); border: 1px solid rgba(255,224,138,.55); }
.as-go:hover { filter: brightness(1.1); }
.as-go.ghost { background: rgba(247,186,0,.12); color: #FFE9A8; box-shadow: none; border-color: rgba(247,186,0,.45); }
.as-ok { font-size: 13px; color: #9BE7A5; } .as-sc { font-size: 13px; color: #FFE08A; } .as-x { font-size: 13px; color: #FFB4A8; }
.as-n { font-size: 16px; color: #FFE08A; } .as-n b { font-weight: 400; font-size: 22px; } .as-nl { font-size: 12px; color: #D9C59C; margin-top: -4px; }
.as .fold-btn { margin-top: 8px; }
.cl > .as, .pg-tiles + .as { margin-top: 4px; }
@media (max-width: 640px) {
  .as { padding: 12px 12px 10px; border-radius: 16px; }
  .as-k { font-size: 18px; }
  .as-c { grid-template-columns: 46px 1fr; gap: 10px; }
  .as-art { width: 46px; height: 46px; border-radius: 13px; } .as-art img { width: 38px; height: 38px; }
  .as-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
  .as-side .as-go { flex: 1; text-align: center; }
  .as-t b { font-size: 16px; }
}

/* การ์ดงานมอบหมายในแถวบนของนักเรียน (โก้ 5 ธ.ค.): คอมวางใต้ตาราง+สนามสอบ ข้างบัตร · จอเล็กกว่ากินเต็มแถว */
.top-row > .as { grid-column: 1 / -1; margin: 0; }
@media (min-width: 1280px) { .top-row:has(> .as) { grid-template-columns: minmax(0, 520px) 1fr 1fr; grid-template-areas: "card sched cd" "card as as"; } }
@media (min-width: 1101px) and (max-width: 1279px) { .top-row:has(> .as) { grid-template-columns: minmax(0, 520px) 1fr; grid-template-areas: "card sched" "card as" "cd as"; grid-template-rows: auto auto 1fr; align-items: start; } }
@media (min-width: 1101px) { .top-row:has(> .as) > .card { grid-area: card; } .top-row:has(> .as) > .cd.nx { grid-area: sched; } .top-row:has(> .as) > .cd:not(.nx) { grid-area: cd; } .top-row > .as { grid-area: as; } }

/* การ์ดงานทั้งใบกดได้ ไม่มีปุ่มเริ่มทำ (โก้ 5 ธ.ค.) */
a.as-c { text-decoration: none; color: inherit; cursor: pointer; transition: transform .15s, border-color .2s, background .2s; }
a.as-c:hover { transform: translateY(-1px); border-color: rgba(247,186,0,.7); }
a.as-c:focus-visible { outline: 2px solid #FFE08A; outline-offset: 2px; }
.as-c { grid-template-columns: 56px 1fr auto auto; }
.as-arr { font-size: 28px; line-height: 1; color: #FFE08A; padding-left: 2px; }
div.as-c .as-arr { visibility: hidden; }
@media (max-width: 640px) { .as-c { grid-template-columns: 46px 1fr auto; } .as-side { grid-column: 2 / 3; justify-content: flex-start; } .as-arr { grid-row: 1; grid-column: 3; } }
/* คอม: การ์ดวันเรียน + นับถอยหลังสูงเท่ากัน (โก้ 5 ธ.ค.) */
@media (min-width: 1280px) { .top-row:not(.top-team) > .cd { align-self: stretch; } }
/* ขอบกระดาษฉีกยื่นออก 24px — เว้นช่องให้รอยหยักไม่ทับกัน */
.top-row { gap: 30px; margin-bottom: 30px; }
@media (max-width: 640px) { .top-row { gap: 26px; } }
/* หน้าพิชิตบทเรียน/หน้าวิชา: หัวข้อซ้าย · แบบทดสอบที่มอบหมายขวาบน (คอม/iPad) */
@media (min-width: 1000px) { .hd-as { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 30px; align-items: start; margin-bottom: 24px; } .hd-as > .sec-head { margin: 6px 0 0; } .hd-as > .as { margin: 24px 0 0; } }
/* คะแนนสะสม: ขอบกระดาษฉีกเหมือนการ์ดอื่น · คอม/iPad อยู่ใต้หัวข้อฝั่งซ้ายของกล่องแบบทดสอบ */
.mc-score { border-style: solid; border-color: transparent; border-image: url(/img/torn-frame.webp) 96 / 48px / 24px round; background-clip: padding-box; margin: 8px 0 30px; }
.hd-as > .mc-score { margin: 0 0 24px; }
@media (max-width: 999px) { .hd-as > .mc-score { margin: 8px 0 30px; } }
@media (min-width: 1000px) { .hd-as { grid-template-areas: "hd as" "sc as"; grid-template-rows: auto 1fr; } .hd-as > .sec-head { grid-area: hd; } .hd-as > .as { grid-area: as; } .hd-as > .mc-score { grid-area: sc; align-self: start; margin: 8px 0 0; } }
/* คะแนนสะสมบนปกวิชา (หน้าพิชิตบทเรียน) */
.tile-sc { position: relative; z-index: 2; display: grid; gap: 5px; margin-top: 10px; max-width: 260px; font-size: 14px; }
.tile-sc b { font-size: 22px; line-height: 1; }
.tile-sc > i { display: block; height: 6px; border-radius: 99px; background: rgba(255,255,255,.28); overflow: hidden; }
.tile-sc > i > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #FFE38A, #F7BA00); }
.tile-sc { gap: 3px; max-width: min(260px, calc(100% - 96px)); font-size: 13px; }
.tile-sc-n { white-space: nowrap; font-size: 14px; }
.tile-sc > i { margin-top: 3px; }
/* โก้ 5 ธ.ค.: การ์ดใบสุดท้ายที่เหลือเศษ ไม่ต้องยืดเต็มแถว — ขนาดเท่าใบอื่น (หน้าแรก · พิชิตบทเรียน · เกม) */
.tiles:not(.has-sched) > .tile:last-child:nth-child(odd), .pg-tiles > .tile:last-child:nth-child(odd) { grid-column: auto; }
/* โก้ 5 ธ.ค.: หัวข้อ "บทเรียนวิชา…" ขึ้นไปอยู่ใต้คะแนนสะสมฝั่งซ้าย ไม่เว้นช่องว่าง */
@media (min-width: 1000px) { .hd-as { grid-template-areas: "hd as" "sc as" "sec as"; grid-template-rows: auto auto 1fr; margin-bottom: 14px; } .hd-as > .cl-sec { grid-area: sec; align-self: end; margin: 0; } }
/* แอดมิน: ปุ่มแก้ไข/ยกเลิกใต้การ์ดงาน */
.as-w { display: grid; gap: 6px; }
.as-act { display: flex; justify-content: flex-end; gap: 8px; }
.as-act form { margin: 0; }
.as-ed, .as-cx { font: inherit; font-size: 13.5px; padding: 5px 14px; border-radius: 999px; cursor: pointer; text-decoration: none; line-height: 1.4; }
.as-ed { color: #FFE9A8; background: rgba(247,186,0,.12); border: 1px solid rgba(247,186,0,.5); }
.as-cx { color: #FFD2CC; background: rgba(227,21,27,.18); border: 1px solid rgba(227,21,27,.6); }
.as-ed:hover, .as-cx:hover { filter: brightness(1.15); }
.as-rs { font: inherit; font-size: 13.5px; padding: 5px 14px; border-radius: 999px; text-decoration: none; line-height: 1.4; color: #1a0f00; background: linear-gradient(90deg, #FFE08A, #F7BA00); border: 1px solid #F7BA00; margin-right: auto; }
.as-rs:hover { filter: brightness(1.08); }
/* หน้าเล่นปลั๊กอิน (5 ธ.ค.): ห้ามหน้าแม่เลื่อน · หัวเว็บไม่ sticky — ถ้า iPad เลื่อนหน้าแม่ตอนแป้นพิมพ์ขึ้น กรอบเกมจะไม่มุดใต้หัวเว็บ (แถบเครื่องมือ fixed top:0 ในเกมไม่ถูกทับ) */
html:has(body.is-play) { overflow: hidden; overscroll-behavior: none; }
body.is-play { overflow: hidden; overscroll-behavior: none; }
/* โก้ 5 ธ.ค.: ปุ่ม ดูผลสอบ / แก้ไข / ยกเลิก หน้าตาเหมือนกันทั้ง 3 ปุ่ม (ขอบทอง พื้นทองจาง) · ชิดขวาเรียงกัน */
.as-act .as-rs, .as-act .as-ed, .as-act .as-cx { margin: 0; color: #FFE9A8; background: rgba(247,186,0,.12); border: 1px solid rgba(247,186,0,.5); font-size: 13.5px; padding: 5px 14px; border-radius: 999px; font-weight: 400; }
/* โก้ 5 ธ.ค.: การ์ดงานฝั่งแอดมินกระชับ — จำนวนคนทำแล้วอยู่ในบรรทัดสรุป · 3 ปุ่มอยู่ในการ์ดด้านขวา (คอม/iPad) */
.as-cnt { color: #9BE7A5; } .as-cnt b { font-weight: 400; color: #FFE08A; }
.as-w { position: relative; gap: 0; }
@media (min-width: 641px) {
  .as-w > .as-c.adm { grid-template-columns: 56px 1fr; padding-right: 300px; }
  .as-w > .as-c.adm .as-arr { display: none; }
  .as-w > .as-act { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
}
@media (max-width: 640px) { .as-w { gap: 6px; } }
/* 5 ธ.ค. (คลิป iPad 04:55): หัวเว็บกลับเป็น sticky ในหน้าเล่น (Safari ใช้สีหัวเว็บย้อมแถบสถานะ iOS ให้ดำเหมือนหน้าอื่น) · หน้าแม่ยังล็อกไม่เลื่อน
   กันแตะสองครั้งแล้ว Safari ซูมทั้งหน้า: ปุ่ม/ลิงก์/หัวเว็บ = touch-action: manipulation */
a, button, input, select, label, summary, .top, .viewbar, .ibtn { touch-action: manipulation; }
html:has(body.is-play) { background: #1C1210; }
.cl-rnote { margin: 6px 2px 0; font-size: 12px; color: #FFE9A8; opacity: .8; }
/* กระดิ่งแจ้งเตือน (โก้ 5 ธ.ค.) */
.ibtn.bell { position: relative; }
.bell-n { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #E0242C; color: #fff; font: 700 11px/18px system-ui, sans-serif; font-style: normal; text-align: center; box-shadow: 0 0 0 2px #1C1210; pointer-events: none; }
.bell-n[hidden] { display: none; }
.bell-menu { right: 12px; width: min(380px, calc(100vw - 24px)); max-height: min(62vh, 560px); overflow: auto; padding: 6px 0 0; }
.bell-menu .menu-h { padding: 8px 14px; }
.bl-row { display: grid; gap: 2px; padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.08); color: inherit; text-decoration: none; }
.bl-row:hover { background: rgba(247,186,0,.08); }
.bl-row b { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.bl-row span { font-size: 13px; opacity: .8; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bl-row small { font-size: 11.5px; opacity: .6; }
.bl-row.new { background: linear-gradient(90deg, rgba(247,186,0,.14), transparent 70%); box-shadow: inset 3px 0 0 #F7BA00; }
.bl-empty { padding: 14px; opacity: .7; margin: 0; }
.bl-all { display: block; position: sticky; bottom: 0; padding: 11px 14px; text-align: center; color: #FFE9A8; background: #2A1A16; border-top: 1px solid rgba(247,186,0,.35); text-decoration: none; font-weight: 600; }
.up-wrap { max-width: 820px; margin: 0 auto 40px; }
.up-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.up-chips a { padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(247,186,0,.5); color: #FFE9A8; background: rgba(28,18,16,.75); text-decoration: none; font-size: 14px; }
.up-chips a.on { background: #F7BA00; color: #1C1210; font-weight: 700; }
.up-day { background: rgba(28,18,16,.86); border: 1px solid rgba(247,186,0,.35); border-radius: 16px; margin: 0 0 16px; overflow: hidden; color: #FBEFD9; }
.up-day h2 { margin: 0; padding: 10px 16px; font-size: 15px; color: #FFE08A; background: rgba(247,186,0,.1); border-bottom: 1px solid rgba(247,186,0,.25); }
.up-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.07); color: inherit; text-decoration: none; }
.up-day h2 + .up-row { border-top: 0; }
a.up-row:hover { background: rgba(247,186,0,.07); }
.up-row > span { grid-column: 1; }
.up-row em { grid-column: 2; grid-row: 1 / span 3; align-self: center; font-style: normal; color: #F7BA00; font-size: 20px; }
.up-t { font-weight: 600; font-size: 15.5px; }
.up-b { font-size: 14px; opacity: .82; line-height: 1.45; }
.up-m { font-size: 12px; opacity: .6; }
.up-who { font-style: normal; color: #9BE7A5; }
.up-empty { text-align: center; padding: 30px; background: rgba(28,18,16,.8); border-radius: 16px; color: #FBEFD9; }
.up-more { display: block; width: max-content; margin: 0 auto; }
.bell-menu { z-index: 45; }
@media (max-width: 440px) {
  .top .tools { gap: 5px; } .top .ibtn { width: 34px; height: 34px; border-radius: 11px; } .top .online { padding: 4px 8px; gap: 4px; } .top .online span { display: none; }
  .top .brand span { display: none; } .top .me img, .top .me .ph { width: 34px; height: 34px; }
}
/* ออนไลน์เรียลไทม์: ตัวเลขเด้งเบา ๆ เมื่อเปลี่ยน */
#online-n.bump { animation: olbump .5s ease; display: inline-block; }
@keyframes olbump { 0% { transform: scale(1); } 35% { transform: scale(1.35); color: #9BE7A5; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { #online-n.bump { animation: none; } }
/* ───── สอนสด YouTube (โก้ 5 ธ.ค.) ───── */
.live-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: linear-gradient(180deg, #E3151B, #A8000C); color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; box-shadow: 0 0 0 1px rgba(247,186,0,.55), 0 6px 18px -6px rgba(227,21,27,.8); white-space: nowrap; }
.live-btn[hidden] { display: none; }
.live-btn i, .live-banner i, .lv-tag i { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.3); animation: blink 1.4s infinite; flex: none; }
.live-btn:hover { filter: brightness(1.08); }
@media (max-width: 440px) { .top .live-btn { width: 34px; height: 34px; padding: 0; justify-content: center; } .top .live-btn span { display: none; } }
.live-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 14px 16px; border-radius: var(--r); text-decoration: none; color: #fff; background: linear-gradient(100deg, #1C1210 0%, #5A0A0E 55%, #C4000F 100%); box-shadow: inset 0 0 0 1px rgba(247,186,0,.5), var(--shadow); }
.live-banner span { display: grid; flex: 1; min-width: 0; } .live-banner b { font-size: 18px; } .live-banner small { color: #FFE9A8; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-banner em { font-style: normal; font-weight: 700; padding: 8px 14px; border-radius: 999px; background: var(--foil); color: var(--ink); white-space: nowrap; }
.lv { max-width: 1100px; margin: 0 auto; }
.lv-h { margin: 4px 0 12px; } .lv-h h1 { margin: 6px 0 2px; font-size: clamp(22px, 3vw, 30px); } .lv-when { margin: 0; color: var(--muted); }
.lv-tag { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .03em; background: var(--ink); color: #FFE9A8; box-shadow: inset 0 0 0 1px rgba(247,186,0,.5); }
.lv.is-on .lv-tag, .lv-act .lv-tag { background: #E3151B; color: #fff; box-shadow: none; }
.lv:not(.is-on) .lv-tag i { display: none; }
.lv-box { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #000; box-shadow: 0 0 0 1px rgba(247,186,0,.45), var(--shadow); }
.lv-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lv-box .cl-wm { position: absolute; z-index: 3; transition: left 1.2s ease, top 1.2s ease; }
.lv-end { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); }
.lv-tip { margin: 10px 2px 0; } .lv-adm { margin-top: 12px; }
@media (max-width: 640px) { .lv-box { border-radius: 12px; margin: 0 -6px; } }
/* ตารางเรียน: คาบที่มีไลฟ์/ย้อนหลัง */
a.has-rp { text-decoration: none; cursor: pointer; } .nx-row.has-rp { opacity: 1; }
.rp-tag { grid-column: 1 / -1; justify-self: start; margin-top: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--ink); color: #FFE9A8; box-shadow: inset 0 0 0 1px rgba(247,186,0,.55); white-space: nowrap; }
.wcls.has-rp { opacity: 1; } .wcls .rp-tag { font-size: 11px; padding: 1px 7px; }
.rp-on .rp-tag { background: #E3151B; color: #fff; box-shadow: none; }
.rp-leave .rp-tag { background: var(--foil); color: var(--ink); box-shadow: none; }
a.has-rp:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 65%, transparent); }
.today-h { position: relative; } .today-h .live-go { position: absolute; right: 0; bottom: 12px; background: #E3151B; color: #fff; border: 0; }
/* หลังบ้าน: สอนสด */
.lv-form { display: grid; gap: 14px; } .lv-form label { display: grid; gap: 6px; font-weight: 600; }
.lv-picks { display: grid; gap: 10px; }
.lv-grp { border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px 10px; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lv-grp.on { border-color: rgba(227,21,27,.6); background: color-mix(in srgb, #E3151B 6%, transparent); }
.lv-grp legend { padding: 0 6px; font-weight: 700; } .lv-now { font-style: normal; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: #E3151B; color: #fff; margin-left: 4px; }
.lv-pk { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; min-height: 44px; border-radius: 12px; background: var(--soft); cursor: pointer; font-weight: 400 !important; }
.lv-pk b { font-size: 13px; padding: 1px 7px; border-radius: 7px; background: var(--ink); color: #FFE9A8; }
.lv-act { display: grid; gap: 10px; } .lv-act + .lv-act { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.lv-act-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lv-cls { display: flex; flex-wrap: wrap; gap: 6px; }
.lv-c { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-radius: 10px; background: var(--soft); font-size: 14px; }
.lv-c .inl, .lv-row .inl { display: inline; margin: 0; } .lv-c .x { border: 0; background: none; color: var(--muted); cursor: pointer; width: 30px; height: 30px; border-radius: 8px; } .lv-c .x:hover { background: var(--line); color: var(--text); }
.lv-stop { justify-self: start; }
.lv-more summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.lv-link { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.lv-past { border-top: 1px solid var(--line); padding: 10px 0; } .lv-past summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.lv-past > div, .lv-past > details, .lv-past > p { margin-top: 8px; } .lv-row { display: flex; flex-wrap: wrap; gap: 8px; }
.lv-h { background: var(--surface); color: var(--text); padding: 14px 18px; border-radius: var(--r); box-shadow: var(--shadow); }
.live-btn { flex: none; }
@media (max-width: 440px) { .top .live-btn { min-width: 34px; } }
@media (max-width: 640px) { .live-banner { flex-wrap: wrap; } .live-banner span { flex-basis: calc(100% - 90px); } .live-banner em { flex-basis: 100%; text-align: center; } }
/* เว็บทดลอง */
.stagebar { position: sticky; top: 0; z-index: 31; text-align: center; padding: 6px 12px; font-size: 14px; font-weight: 700; color: #fff; background: repeating-linear-gradient(135deg, #1E6FD8 0 14px, #1758AE 14px 28px); }
.stagebar a { color: #fff; text-decoration: underline; }

/* ── ระบบวัดผล (โก้ 5 ธ.ค.): /progress พัฒนาการของฉัน · /admin/progress ผลการเรียน ── */
.pr-go { display: flex; width: fit-content; margin: 0 auto 18px; }
.pr { max-width: 980px; margin: 0 auto; }
.pr-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 16px; }
.pr-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.pr-stat::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--foil); }
.pr-stat small { color: var(--muted); font-size: 14px; }
.pr-stat b { font-size: 34px; line-height: 1.1; }
.pr-stat b em { font-style: normal; font-size: 18px; color: var(--muted); }
.pr-stat span { font-size: 14px; color: var(--muted); }
.pr-sec h2 { margin: 0 0 2px; }
.pr-sec > p.muted { margin: 0 0 12px; }
.pr-empty { color: var(--muted); text-align: center; padding: 18px 8px; margin: 0; }
.pr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pr-as { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--soft); }
.pr-as-t { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; min-width: 0; }
.pr-as-t .muted { flex-basis: 100%; }
.pr-as .pr-bar { grid-column: 1 / -1; }
.pr-sc { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.pr-sc b { font-size: 22px; }
.pr-rank { font-size: 14px; color: var(--text); font-weight: 600; white-space: nowrap; }
.pr-rank.top { color: var(--gold-d); font-weight: 700; }
.pr-miss { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.pr-bar { position: relative; display: block; height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--text) 9%, transparent); }
.pr-bar > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--muted); transition: width .5s; }
.pr-bar > i.hi { background: linear-gradient(90deg, #1E9E62, #3CCB7F); }
.pr-bar > i.mid { background: linear-gradient(90deg, #E6A100, #F7BA00); }
.pr-bar > i.lo { background: linear-gradient(90deg, #C4000F, #E3151B); }
.pr-avg { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--gold-d); box-shadow: 0 0 0 1.5px var(--surface); }
.pr-trend { width: 100%; height: auto; display: block; }
.pr-trend .pr-grid { stroke: var(--line); stroke-dasharray: 3 4; }
.pr-trend .pr-ax { fill: var(--muted); font-size: 12px; font-family: system-ui, sans-serif; }
.pr-trend .pr-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.pr-trend .pr-area { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.pr-dot { stroke: var(--surface); stroke-width: 2; fill: var(--muted); }
.pr-dot.hi { fill: #1E9E62; } .pr-dot.mid { fill: #E6A100; } .pr-dot.lo { fill: #C4000F; }
.pr-subj { border-top: 1px solid var(--line); padding: 8px 0; }
.pr-subj:first-of-type { border-top: 0; }
.pr-subj summary { display: flex; justify-content: space-between; align-items: baseline; cursor: pointer; padding: 4px 0; list-style: none; }
.pr-subj summary::-webkit-details-marker { display: none; }
.pr-chs { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.pr-chs a { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(90px, 32%) 46px; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 12px; color: inherit; text-decoration: none; }
.pr-chs a:hover { background: var(--soft); }
.pr-ch-n { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pr-ch-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.pr-ch-p { text-align: right; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.pr-ch-p.hi { color: #1E9E62; } .pr-ch-p.mid { color: var(--gold-d); } .pr-ch-p.lo { color: var(--accent); } .pr-ch-p.na { color: var(--muted); font-weight: 400; }
/* หลังบ้าน */
.pr-chips { margin-bottom: 8px; }
.pr-ahead { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.pr-ahead p { margin: 0; }
.pr-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 14px; }
.pr-tbl { border-collapse: separate; border-spacing: 0; font-size: 15px; min-width: 100%; font-family: system-ui, 'Sarabun', sans-serif; }
.pr-tbl th, .pr-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.pr-tbl thead th { position: sticky; top: 0; z-index: 2; background: var(--soft); font-weight: 600; vertical-align: bottom; }
.pr-tbl thead th small, .pr-tbl td small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.pr-tbl tfoot th, .pr-tbl tfoot td { position: sticky; bottom: 0; background: var(--soft); font-size: 13px; }
.pr-tbl th[scope="row"], .pr-tbl thead th:first-child, .pr-tbl tfoot th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; }
.pr-tbl thead th:first-child { z-index: 3; background: var(--soft); }
.pr-th { font-size: 13px; line-height: 1.25; }
.pr-who { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.pr-who img, .pr-who i { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--soft); flex: none; }
.pr-tbl td.c b { font-variant-numeric: tabular-nums; }
.pr-tbl td.hi { background: color-mix(in srgb, #1E9E62 16%, transparent); }
.pr-tbl td.mid { background: color-mix(in srgb, #F7BA00 20%, transparent); }
.pr-tbl td.lo { background: color-mix(in srgb, #E3151B 14%, transparent); }
.pr-tbl td.miss { color: var(--accent); font-size: 13px; }
.pr-tbl td.wait { color: var(--muted); font-size: 13px; }
.pr-tbl td.avg { font-weight: 700; }
@media (max-width: 640px) {
  .pr-stats { grid-template-columns: 1fr 1fr; }
  .pr-stats .pr-stat:first-child { grid-column: 1 / -1; }
  .pr-stat b { font-size: 28px; }
  .pr-chs a { grid-template-columns: 26px minmax(0, 1fr) 42px; }
  .pr-chs a .pr-bar { grid-column: 2 / 4; grid-row: 2; }
  .pr-chs a .pr-ch-p { grid-row: 1; grid-column: 3; }
}
