/* Regent Mock Test · หน้าตาชุดเดียวกับ Regent DB (เมนูน้ำเงินเข้ม #28285E · การ์ดขาวขอบมน · ปุ่มฟ้า #2F7CF6 · ฟอนต์ Google Sans) */
@font-face { font-family: 'Google Sans'; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url(assets/fonts/google-sans-thai-wght-normal.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Google Sans'; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url(assets/fonts/google-sans-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Google Sans'; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url(assets/fonts/google-sans-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #F2F4F7; --card: #FFFFFF; --ink: #111827; --muted: #6B7280; --faint: #9CA3AF; --line: #E5E7EB; --line-soft: #F0F2F5;
  --nav: #28285E; --nav-2: #34347A; --nav-text: #CACBE8;
  --pri: #2F7CF6; --pri-2: #1F63D4; --pri-soft: #EAF2FF;
  --ok: #16A34A; --ok-soft: #E7F6EC; --warn: #C2700A; --warn-soft: #FEF3E2; --bad: #DC3E42; --bad-soft: #FDECEC;
  --font: "Google Sans", "Leelawadee UI", "Segoe UI", Tahoma, sans-serif;
  --r: 16px; --r-ctl: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-user-select: none; user-select: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: var(--r-ctl); padding: 9px 16px; font-weight: 600; }
button:hover { background: var(--bg); }
button:disabled { opacity: .5; cursor: default; }
button.pri { background: var(--pri); border-color: var(--pri); color: #fff; }
button.pri:hover { background: var(--pri-2); border-color: var(--pri-2); }
button.bad { color: var(--bad); border-color: transparent; background: transparent; }
button.bad:hover { background: var(--bad-soft); }
button.link { border: 0; background: none; color: var(--pri); padding: 4px 6px; font-weight: 600; }
button.link:hover { text-decoration: underline; background: none; }
button.big { padding: 14px 44px; font-size: 18px; border-radius: 12px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=url] { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 0 12px; background: #fff; -webkit-user-select: text; user-select: text; }
input:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-soft); }
:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }
label.f { display: block; margin: 12px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 14px; }
.grow { flex: 1; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 8px; }

/* โลโก้ (กล่องขาวแบบเมนู Regent DB) */
.logo { background: #fff; border-radius: 12px; padding: 7px 12px; display: inline-flex; align-items: center; flex: none; }
.logo img { display: block; height: 30px; width: auto; }
.logo.text { font-weight: 800; color: var(--nav); letter-spacing: .3px; }
.logo.center { display: flex; width: max-content; margin: 0 auto 18px; padding: 10px 16px; box-shadow: var(--shadow); }
.logo.center img { height: 44px; }
.logo.sm { padding: 5px 9px; border-radius: 10px; }
.logo.sm img { height: 24px; }

/* ส่วนหัว */
.page { min-height: 100vh; }
.hdr { display: flex; align-items: center; gap: 14px; padding: 12px 24px; background: var(--nav); color: #fff; position: sticky; top: 0; z-index: 5; }
.hdr-title { display: flex; flex-direction: column; line-height: 1.25; }
.hdr-title b { font-size: 18px; }
.hdr-title span { font-size: 12px; color: var(--nav-text); }
.hdr-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; color: var(--nav-text); line-height: 1.35; }
.hdr-meta .pc { color: #fff; font-weight: 600; }
.hbtn { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.hbtn:hover { background: rgba(255, 255, 255, .2); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 24px 48px; }
.wrap.narrow { max-width: 720px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px; }

/* รายการวันนี้ */
.sum { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sum h2 { margin: 0 8px 0 0; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #E9ECF1; color: #475467; white-space: nowrap; }
.pill.new { background: #E9ECF1; color: #475467; }
.pill.run { background: var(--warn-soft); color: var(--warn); }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.ev { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 4px; border-top: 4px solid #D5DAE1; }
.ev.st-run { border-top-color: #F5A524; }
.ev.st-done { border-top-color: var(--ok); }
.ev.st-bad { border-top-color: var(--bad); }
.ev.st-new { border-top-color: var(--pri); }
.ev-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ev-time { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.ev-who { font-size: 22px; font-weight: 700; margin-top: 6px; }
.ev-sub { font-size: 14px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--pri-soft); color: var(--pri-2); font-weight: 600; }
.ev-foot { display: flex; justify-content: flex-end; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.ev-foot button { min-width: 120px; }
.banner { border-radius: 14px; padding: 14px 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; box-shadow: var(--shadow); }
.banner.warn { background: var(--warn-soft); border-left: 4px solid var(--warn); }
.banner.info { background: var(--pri-soft); border-left: 4px solid var(--pri); }
.empty { text-align: center; padding: 56px 16px; color: var(--muted); background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.empty-ic { font-size: 34px; margin-bottom: 6px; }

/* หน้าต่างย่อย */
.ov { position: fixed; inset: 0; background: rgba(40, 40, 94, .45); display: flex; align-items: center; justify-content: center; z-index: 75; }
.dlg { background: var(--card); border-radius: var(--r); width: min(560px, 94vw); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 48px rgba(16, 24, 40, .2); }
.dlg.wide { width: min(980px, 96vw); }
.dlg .hd { padding: 20px 22px 6px; font-weight: 700; font-size: 17px; }
.dlg .bd { padding: 6px 22px 12px; overflow: auto; }
.dlg .ft { padding: 10px 22px 20px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.opt { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.opt:hover { border-color: var(--pri); }
.opt input { margin-top: 4px; accent-color: var(--pri); }
.opt.on { border-color: var(--pri); background: var(--pri-soft); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 600; width: 120px; }

/* หน้าเต็มจอ: ตั้งค่า / พร้อมสอบ / ส่งแล้ว (พื้นน้ำเงินเข้มแบบหน้าเข้าสู่ระบบ Regent DB) */
.splash { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px; background: var(--nav); }
.splash-card { background: var(--card); border-radius: 20px; padding: 34px 44px 30px; width: min(660px, 96vw); text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.splash-card h1 { margin: 0 0 6px; font-size: 24px; }
.splash-card h2 { margin: 6px 0 8px; font-size: 21px; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--pri); }
.cand { font-size: 30px; font-weight: 800; color: var(--nav); margin: 14px 0 2px; }
.splash-card ul { text-align: left; margin: 20px auto 24px; max-width: 480px; padding: 16px 18px 16px 36px; background: var(--bg); border-radius: 12px; color: #374151; }
.splash-card li { margin: 5px 0; }
.ic { font-size: 50px; line-height: 1; margin-bottom: 8px; }
.staffnote { margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); }

/* หน้าสอบ */
.exam { height: 100vh; display: grid; grid-template-rows: auto auto 1fr; }
.ebar { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--nav); color: #fff; }
.ebar .nm { font-weight: 700; font-size: 17px; }
.ebar .meta { color: var(--nav-text); font-size: 13px; }
.timer { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 3px 16px; border-radius: 10px; background: rgba(255, 255, 255, .12); min-width: 104px; text-align: center; }
.timer.low { background: var(--bad); }
.sv { font-size: 12px; color: var(--nav-text); min-width: 150px; text-align: right; }
.sv.off { color: #FFB4A8; }
.ebar button { background: var(--pri); border-color: var(--pri); color: #fff; padding: 9px 22px; }
.ebar button:hover { background: var(--pri-2); }
.ebar button.ghost { background: transparent; border-color: transparent; color: #8F90C4; font-weight: 400; font-size: 12px; padding: 4px 8px; }
.etabs { display: flex; gap: 6px; padding: 10px 20px 0; background: var(--bg); }
.etabs button { border: 0; border-radius: 12px 12px 0 0; background: #E3E7ED; padding: 9px 22px; color: var(--muted); }
.etabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 -1px 4px rgba(16, 24, 40, .05); }
.etabs .wc { font-size: 12px; color: var(--muted); margin-left: 8px; font-weight: 400; }
.split { display: grid; grid-template-columns: minmax(320px, 44%) 1fr; min-height: 0; background: var(--card); }
.prompt { overflow: auto; padding: 24px 28px; border-right: 1px solid var(--line); }
.prompt h3 { margin: 0 0 12px; font-size: 19px; }
.prompt p { margin: 0 0 10px; }
.prompt p.lead { color: var(--muted); font-style: italic; }
.prompt img { max-width: 100%; display: block; margin: 14px 0; border: 1px solid var(--line); border-radius: 8px; -webkit-user-drag: none; pointer-events: none; }
.answer { display: grid; grid-template-rows: 1fr auto; min-height: 0; padding: 16px 20px 12px; background: var(--bg); }
.answer textarea { width: 100%; height: 100%; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; font: 16px/1.75 Arial, var(--font); -webkit-user-select: text; user-select: text; background: #fff; box-shadow: var(--shadow); }
.answer textarea:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-soft); }
.wcbar { display: flex; justify-content: space-between; padding-top: 10px; font-size: 14px; color: var(--muted); }
.wcbar b.under { color: var(--warn); }
.wcbar b.okw { color: var(--ok); }
.alert { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(220, 62, 66, .16); z-index: 60; }
.alert div { background: #fff; border-radius: 16px; border-top: 5px solid var(--bad); padding: 24px 34px; font-size: 19px; font-weight: 700; color: var(--bad); text-align: center; box-shadow: 0 24px 48px rgba(16, 24, 40, .2); }

#toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
#toast div { background: #111827; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; max-width: 420px; box-shadow: 0 8px 24px rgba(16, 24, 40, .2); }
#toast div.warn { background: var(--warn); }
#toast div.bad { background: var(--bad); }
.exam ~ #toast, body:has(.exam) #toast { left: 50%; right: auto; transform: translateX(-50%); align-items: center; }

/* ===== PIN · ปุ่มเฟือง · หยุดเวลา · ภาษา ===== */
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.danger:hover { background: #B91C1C; border-color: #B91C1C; }
.hbtn.gear, .ebar button.gear { font-size: 20px; line-height: 1; padding: 7px 11px; }
.ebar button.gear { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; font-weight: 400; }
.ebar button.gear:hover { background: rgba(255, 255, 255, .2); }
.ebar button.submit:disabled { opacity: .45; }
.dlg.pin, .dlg.confirm { width: min(380px, 92vw); }
.dlg.pin input { text-align: center; font-size: 22px; letter-spacing: 6px; height: 50px; }
.dlg.confirm .bd { display: none; }
.dlg.confirm .hd { padding-bottom: 14px; line-height: 1.45; }
.dlg.staff { width: min(400px, 92vw); }
.dlg.staff input { text-align: center; font-size: 22px; letter-spacing: 6px; height: 50px; }
.dlg.staff .ft { flex-direction: column; align-items: stretch; gap: 8px; }
.dlg.staff .ft button { padding: 11px 16px; }
.splash-card.lock { width: min(420px, 94vw); }
.splash-card.lock h1 { font-size: 20px; margin-bottom: 14px; }
.lock-row { display: flex; gap: 8px; }
.lock-row input { text-align: center; font-size: 24px; letter-spacing: 8px; height: 52px; }
.lock-row button { min-width: 90px; }
.lock-extra { display: flex; gap: 12px; justify-content: center; margin-top: 6px; }
.done-acts { justify-content: center; margin-top: 22px; }
.done-acts button { min-width: 150px; }
.seg { display: inline-flex; background: var(--bg); border-radius: var(--r-ctl); padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 7px 20px; color: var(--muted); }
.seg button[aria-pressed=true] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.split { position: relative; }
.pausebox { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; background: rgba(242, 244, 247, .96); }
.pausebox[hidden] { display: none; }
.pausebox > div { background: var(--card); border-radius: 20px; box-shadow: 0 24px 48px rgba(16, 24, 40, .15); padding: 34px 54px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pausebox b { font-size: 22px; }
.pausebox span { color: var(--muted); }
.timer.paused { background: var(--warn); }

/* ===== หน้า PIN: ปุ่มใต้ช่อง + หัวการ์ด ===== */
.lock-head { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: -4px 0 18px; }
.lock-head b { font-size: 19px; color: var(--nav); }
.lock-head span { font-size: 14px; font-weight: 600; color: var(--pri); letter-spacing: .4px; }
.lock-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.splash-card.lock > input { text-align: center; font-size: 24px; letter-spacing: 8px; height: 52px; }
.lock-btn { width: 100%; margin-top: 10px; padding: 12px 16px; font-size: 16px; }

/* ===== หน้าสอบ: Highlight & Notes · เมนูคลิกขวา ===== */
.prompt p { -webkit-user-select: text; user-select: text; cursor: text; }
.prompt p::selection, .prompt mark::selection { background: #BBD6FF; }
/* ไฮไลต์ / โน้ต: ไม่เพิ่มความกว้าง (ตัวหนังสือไม่ขยับ) · ขอบเหลืองใช้ box-shadow · เครื่องหมายโน้ตลอยอยู่ด้านบน */
mark.hl { background: #FFE45C; color: inherit; border-radius: 2px; padding: 0; margin: 0; box-shadow: 0 0 0 1px #FFE45C; }
mark.hl.note { position: relative; cursor: pointer; text-decoration: underline dotted var(--warn) 2px; text-underline-offset: 3px; }
mark.hl.note::after { content: '✎'; position: absolute; right: -4px; top: -9px; font-size: 10px; line-height: 1; color: var(--warn); pointer-events: none; }
.selbar { position: fixed; z-index: 90; display: flex; gap: 4px; padding: 5px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 24px rgba(16, 24, 40, .18); }
.selbar .sb-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: none; border-radius: 9px; color: #344054; padding: 0; cursor: pointer; }
.selbar .sb-btn:hover:not(:disabled) { background: var(--pri-soft); }
.selbar .sb-btn.on { background: #28285E; color: #fff; }
.selbar .sb-btn:disabled { opacity: .35; cursor: default; }
.ctx { position: fixed; z-index: 90; min-width: 170px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 28px rgba(16, 24, 40, .18); padding: 5px; display: flex; flex-direction: column; }
.ctx button { border: 0; background: none; text-align: left; padding: 8px 12px; border-radius: 7px; font-weight: 500; }
.ctx button:hover:not(:disabled) { background: var(--pri-soft); }
.ctx button:disabled { color: var(--faint); opacity: 1; }
.note-pop { position: fixed; z-index: 91; width: 300px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid #FFE45C; border-radius: 12px; box-shadow: 0 16px 36px rgba(16, 24, 40, .2); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.note-pop textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: 14px/1.5 var(--font); -webkit-user-select: text; user-select: text; }
.note-pop textarea:focus { outline: none; border-color: var(--pri); }
.note-pop .row.end { margin-top: 0; }
.note-pop .row button { padding: 6px 12px; }

/* หน้าส่งแล้ว: สถานะการส่ง (ตัวเล็ก) */
.send-row { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 16px; min-height: 22px; }
.send-st { font-size: 12px; color: var(--faint); }
.send-st.sent { color: var(--ok); }
.send-st.fail { color: var(--warn); font-weight: 600; }
.send-row .link { font-size: 12px; }
.ev-foot { gap: 8px; }
.ev-foot button.bad { min-width: 90px; }

/* ===================================================================
   หน้าเว็บ (mocktest.regentenglishschool.com): ส่วนที่เพิ่มจากโปรแกรม
   =================================================================== */
input[type=tel], input[type=email] { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 0 12px; background: #fff; -webkit-user-select: text; user-select: text; }
input, textarea { -webkit-user-select: text; user-select: text; }
.logo.center img { height: 52px; max-width: 260px; object-fit: contain; }
.logo.sm img { height: 26px; }
/* ปุ่มเปลี่ยนภาษา TH / EN */
.lang { position: fixed; top: 14px; right: 16px; z-index: 20; }
.seg.dark { background: rgba(255, 255, 255, .12); }
.seg.dark button { color: #CACBE8; padding: 5px 12px; font-size: 13px; }
.seg.dark button[aria-pressed=true] { background: #fff; color: var(--nav); }
.ebar .seg.dark button { background: transparent; border: 0; color: #CACBE8; padding: 5px 10px; font-size: 12px; }
.ebar .seg.dark button[aria-pressed=true] { background: #fff; color: var(--nav); }
.ebar .seg.dark button:hover { background: rgba(255, 255, 255, .2); }
/* ฟอร์มลงชื่อ */
.splash-card.reg { width: min(520px, 96vw); text-align: left; }
.splash-card.reg .lock-head { margin-bottom: 14px; }
.evtag { display: block; width: max-content; margin: -6px auto 14px; font-size: 12px; font-weight: 600; color: var(--pri-2); background: var(--pri-soft); border-radius: 999px; padding: 3px 12px; }
.facts { display: grid; gap: 6px; padding: 12px 16px; background: var(--bg); border-radius: 12px; font-size: 14px; color: #374151; margin-bottom: 6px; }
.facts div { display: flex; gap: 10px; }
.facts b { min-width: 54px; color: var(--ink); }
label.f .opt-t { color: var(--faint); font-weight: 400; }
.agree { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; font-size: 13px; color: var(--muted); cursor: pointer; }
.agree input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--pri); flex: none; }
.reg-btn { width: 100%; margin-top: 16px; padding: 12px 16px; font-size: 16px; }
.back-row { margin-top: 14px; text-align: center; }
select.set-sel { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 0 12px; font: inherit; font-weight: 600; margin-bottom: 10px; }
select.set-sel:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-soft); }
/* ออกจากโหมดเต็มจอระหว่างสอบ: บังข้อสอบจนกดกลับเข้าเต็มจอ */
.fsguard { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(40, 40, 94, .97); padding: 20px; }
.fsg-card { background: var(--card); border-radius: 20px; box-shadow: 0 24px 48px rgba(0, 0, 0, .3); padding: 34px 40px; max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.fsg-card .ic { font-size: 38px; line-height: 1; }
.fsg-card b { font-size: 21px; }
.fsg-card span { color: var(--muted); }
.fsg-card .big { margin-top: 8px; }
.fsg-gear { margin-top: 6px; font-size: 13px; }
.splash-card .lock-head span { text-transform: none; }

@media (max-width: 820px) {
  .splash { padding: 64px 12px 24px; align-items: flex-start; }
  .splash-card { padding: 26px 20px 24px; border-radius: 18px; }
  .cand { font-size: 24px; }
  .splash-card ul { padding: 14px 14px 14px 30px; font-size: 14px; }
  button.big { padding: 13px 30px; font-size: 17px; }
  .exam { height: auto; min-height: 100vh; min-height: 100dvh; grid-template-rows: auto auto auto; }
  .ebar { position: sticky; top: 0; z-index: 6; gap: 8px; padding: 8px 10px; }
  .ebar .logo.sm, .ebar .meta, .ebar .sv { display: none; }
  .ebar .nm { font-size: 15px; max-width: 34vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .timer { font-size: 19px; min-width: 78px; padding: 2px 8px; }
  .ebar button.submit { padding: 8px 12px; }
  .etabs { padding: 8px 10px 0; }
  .etabs button { padding: 8px 14px; }
  .split { grid-template-columns: 1fr; }
  .prompt { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px 16px 10px; }
  .answer { padding: 12px 10px 16px; }
  .answer textarea { min-height: 55vh; }
  .wcbar { flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
  .lang { top: 12px; right: 12px; }
}

/* เลือกโหมด: School / Online */
.splash-card.mode { width: min(520px, 96vw); }
.mode-q { font-weight: 700; margin: 4px 0 12px; color: var(--ink); }
.mode-opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px 18px; margin-bottom: 10px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; font: inherit; color: inherit; }
.mode-opt:hover:not(:disabled) { border-color: var(--pri); background: var(--pri-soft); }
.mode-opt:disabled { opacity: .55; cursor: default; }
.mode-ic { font-size: 30px; line-height: 1; flex: none; }
.mode-tx { display: flex; flex-direction: column; gap: 2px; }
.mode-tx b { font-size: 18px; }
.mode-tx span { font-size: 13px; color: var(--muted); }
.logo.sm.wide img { height: 24px; max-width: 140px; object-fit: contain; }

/* ===================================================================
   Full Mock Test: Listening + Reading + Writing
   =================================================================== */
/* การ์ดในรายการวันนี้: สถานะแต่ละส่วน */
.ev .parts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.part { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #E9ECF1; color: #475467; }
.part.p-submitted { background: var(--ok-soft); color: var(--ok); }
.part.p-started, .part.p-paused { background: var(--warn-soft); color: var(--warn); }
.ev-foot { flex-wrap: wrap; }
.ev.full .ev-foot button { min-width: 0; }
/* หน้าเลือกส่วน (นักเรียน) */
.splash-card.fm { width: min(620px, 96vw); }
.fm-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 4px; text-align: left; }
.fm-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.fm-row.done { background: var(--ok-soft); border-color: transparent; }
.fm-row b { font-size: 17px; }
.fm-row > button { min-width: 130px; }
.fm-ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; color: #fff; background: var(--pri); }
.fm-L { background: #7C5CFC; }
.fm-R { background: #0E9F9E; }
.fm-W { background: var(--pri); }
.fm-done { display: flex; flex-direction: column; align-items: flex-end; color: var(--ok); font-weight: 700; min-width: 130px; }
.fm-done .link { font-size: 12px; color: var(--muted); padding: 0; }

/* หน้าสอบ Listening / Reading */
.exam.rl { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.rl-audio { display: flex; align-items: center; gap: 12px; padding: 8px 20px; background: #EEF0FF; border-bottom: 1px solid #DADDF5; font-size: 14px; color: #344054; }
.rl-aic { font-size: 18px; }
.rl-ast.on { color: var(--ok); font-weight: 600; }
.rl-ast.end { color: var(--pri-2); font-weight: 700; }
.rl-ast.bad { color: var(--bad); font-weight: 700; }
.rl-tap { padding: 6px 14px; }
.rl-vol { display: flex; align-items: center; gap: 8px; }
.rl-vol input { width: 140px; accent-color: var(--nav); }
.rl-main { flex: 1; min-height: 0; position: relative; background: var(--card); }
.rl-body { height: 100%; }
.rl-body.paused { visibility: hidden; }
.rl-body.read { display: grid; grid-template-columns: 1fr 1fr; }
.rl-body.listen { overflow: auto; background: #FAFBFC; }
.rl-body.listen .rl-qs { max-width: 920px; margin: 0 auto; overflow: visible; }
.rl-ps { overflow: auto; padding: 22px 30px 40px; border-right: 1px solid var(--line); }
.rl-qs { overflow: auto; padding: 18px 26px 48px; }
.rl-body.read .rl-qs { background: #FAFBFC; }
.rl-ph { display: flex; align-items: baseline; gap: 12px; padding: 10px 14px; background: var(--pri-soft); border-radius: 10px; margin-bottom: 16px; }
.rl-ph b { font-size: 16px; color: var(--nav); }
.rl-ph span { color: var(--muted); font-size: 13px; }
/* บทความ */
.ps-k { font-size: 12px; font-weight: 700; color: var(--pri); text-transform: uppercase; letter-spacing: .5px; }
.ps h2 { font-size: 22px; margin: 4px 0 6px; }
.ps-sub { font-style: italic; color: #475467; margin: 0 0 16px; }
.ps-p { display: flex; gap: 10px; }
.ps-p p { margin: 0 0 13px; line-height: 1.75; font-size: 15.5px; -webkit-user-select: text; user-select: text; cursor: text; }
.ps-p p::selection, .ps-p mark::selection { background: #BBD6FF; }
.ps-l { flex: none; width: 22px; font-weight: 800; color: var(--nav); line-height: 1.75; }
/* แถบเลือกข้อด้านล่าง */
.rl-nav { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -2px 8px rgba(16, 24, 40, .05); overflow-x: auto; }
.rl-np { display: flex; align-items: center; gap: 8px; border-radius: 12px; padding: 4px; flex: none; }
.rl-np.on { background: var(--bg); flex: 1 1 auto; }
.rl-pt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; padding: 6px 12px; border: 0; background: var(--bg); white-space: nowrap; }
.rl-np.on .rl-pt { background: transparent; }
.rl-pt b { font-size: 14px; }
.rl-pt span { font-size: 11px; color: var(--muted); font-weight: 500; }
.rl-nums { display: flex; gap: 4px; flex-wrap: wrap; }
.rl-qn { width: 34px; height: 34px; padding: 0; border-radius: 8px; font-size: 13px; font-weight: 600; }
.rl-qn.done { background: var(--nav); border-color: var(--nav); color: #fff; }
.rl-qn.done:hover { background: var(--nav-2); }
.rl-arrows { display: flex; gap: 6px; margin-left: auto; align-items: center; flex: none; }
.rl-arrows button { width: 46px; padding: 8px 0; font-size: 17px; }

/* คำถาม (ielts.js) */
.ql-g { margin: 0 0 28px; }
.ql-head h4 { margin: 0 0 4px; font-size: 16px; }
.ql-head p { margin: 0 0 4px; color: #374151; }
.ql-head p.ql-fmt { font-style: italic; color: #475467; }
.ql-legend { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 8px 0 12px; font-size: 14px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.ql-legend div { display: contents; }
.ql-title { font-weight: 700; text-align: center; margin: 12px 0 10px; font-size: 16px; }
.ql-sub { font-weight: 700; margin: 14px 0 4px; }
.ql-q { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.ql-q.row-q { align-items: center; }
.ql-n { flex: none; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; border: 2px solid var(--nav); color: var(--nav); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.ql-n.wide { min-width: 58px; }
.ql-body { flex: 1; min-width: 0; }
.ql-body p { margin: 3px 0 8px; }
.ql-ch { display: flex; gap: 8px; flex-wrap: wrap; border-radius: 10px; }
.ql-ch button { padding: 6px 14px; font-weight: 600; border-radius: 8px; }
.ql-ch button[aria-checked=true] { background: var(--nav); border-color: var(--nav); color: #fff; }
.ql-ch.list { flex-direction: column; gap: 6px; }
.ql-ch.list button { display: flex; gap: 12px; text-align: left; font-weight: 400; padding: 8px 12px; align-items: flex-start; }
.ql-ch.list button b { flex: none; width: 18px; }
.ql-hint { font-size: 13px; color: var(--muted); }
.ql-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 8px 0 12px; background: #fff; }
.ql-box-t { font-weight: 700; margin-bottom: 6px; }
.ql-box-r { display: flex; gap: 12px; padding: 2px 0; }
.ql-box-r b { width: 32px; flex: none; }
.ql-sel { height: 34px; border: 1.5px solid #CBD2DC; border-radius: 8px; padding: 0 8px; min-width: 78px; background: #fff; font: inherit; font-weight: 700; color: var(--nav); }
.ql-sel:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-soft); }
input.ql-gap { width: 160px; height: 30px; padding: 0 8px; margin: 0 4px; border-radius: 6px; border: 1.5px solid #CBD2DC; display: inline-block; vertical-align: baseline; text-align: center; font-weight: 600; background: #fff; }
input.ql-gap::placeholder { color: var(--nav); font-weight: 800; opacity: .75; }
.ql-notes { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; background: #fff; line-height: 2.2; }
.ql-notes-t { font-weight: 700; text-align: center; font-size: 16px; margin-bottom: 6px; line-height: 1.5; }
.ql-nh { font-weight: 700; margin-top: 6px; line-height: 1.8; }
.ql-ni { position: relative; }
.ql-notes.bul .ql-ni { padding-left: 18px; }
.ql-notes.bul .ql-ni::before { content: '•'; position: absolute; left: 4px; }
.ql-notes .lv1 { margin-left: 22px; }
.ql-notes .lv2 { margin-left: 44px; }
.ql-notes .lv3 { margin-left: 66px; }
.ql-np { line-height: 2.3; margin: 6px 0; }
.ql-tw { overflow-x: auto; }
.ql-table { border-collapse: collapse; width: 100%; background: #fff; font-size: 14px; line-height: 2.1; }
.ql-table th, .ql-table td { border: 1px solid #CBD2DC; padding: 6px 10px; vertical-align: top; text-align: left; }
.ql-table thead th { background: #EEF1F5; line-height: 1.5; }
.ql-flowbox { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ql-step { border: 1px solid #CBD2DC; border-radius: 8px; padding: 8px 14px; background: #fff; width: min(580px, 100%); text-align: center; line-height: 2.2; }
.ql-arrow { color: var(--muted); font-weight: 700; }
.ql-map { max-width: 100%; display: block; margin: 8px auto 14px; border: 1px solid var(--line); border-radius: 8px; -webkit-user-drag: none; }
.ql-anchor { display: none; }
.ql-ok { box-shadow: 0 0 0 2px var(--ok) !important; }
.ql-bad { box-shadow: 0 0 0 2px var(--bad) !important; }
.ql-multi-mark { font-size: 12px; padding: 2px 8px; border-radius: 6px; }

@media (max-width: 820px) {
  .exam.rl { height: auto; min-height: 100dvh; }
  .rl-body.read { grid-template-columns: 1fr; }
  .rl-ps { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .rl-qs { padding: 14px 12px 30px; }
  .rl-nav { position: sticky; bottom: 0; }
  .rl-audio { padding: 8px 10px; flex-wrap: wrap; }
  .rl-vol input { width: 90px; }
  .fm-row { flex-wrap: wrap; }
}
/* ดูผล: เฉลยต่อท้ายช่องคำตอบ */
.ql-key { display: inline-block; margin: 0 6px; padding: 1px 8px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); font-size: 13px; font-weight: 700; vertical-align: baseline; line-height: 1.6; }
.ql-key.ok { background: var(--ok-soft); color: var(--ok); }
.ql-multi-res { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

/* ===================================================================
   Regent Portal (portal.regentenglishschool.com)
   =================================================================== */
body { -webkit-user-select: auto; user-select: auto; }
.exam { -webkit-user-select: none; user-select: none; }
.pt-login label.f { text-align: left; }
.pt-login > input { margin-bottom: 2px; }
.pt-help { margin: 14px 0 0; }
.pt-hdr { gap: 18px; flex-wrap: wrap; }
.pt-tabs { display: flex; gap: 4px; margin-left: 10px; flex-wrap: wrap; }
.pt-tabs a { color: var(--nav-text); text-decoration: none; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.pt-tabs a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.pt-tabs a.on { background: #fff; color: var(--nav); }
.pt-user { display: flex; align-items: center; gap: 10px; }
.pt-hdr .seg.dark button { padding: 5px 10px; font-size: 12px; }
.pt-intro { margin: -4px 0 16px; }
.pt-book h3 { margin: 22px 0 10px; font-size: 17px; color: var(--nav); }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pt-test { padding: 16px 18px; margin: 0; display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--pri); }
.pt-test.off { border-top-color: var(--bad); opacity: .85; }
.pt-tname { display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
.pt-kind { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.pt-kind button { min-width: 96px; }
.pt-kic { width: 36px; height: 36px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; }
.pt-L { background: #7C5CFC; }
.pt-R { background: #0E9F9E; }
.pt-search { width: min(320px, 100%); }
.pt-search input { height: 38px; }
.sum .seg { margin-left: 6px; }
.pt-tw { overflow-x: auto; }
table.pt-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.pt-tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pt-tbl td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.pt-tbl tr.click { cursor: pointer; }
.pt-tbl tr.click:hover td { background: var(--pri-soft); }
.pt-go { color: var(--pri); font-weight: 600; white-space: nowrap; font-size: 13px; }
.pt-back { margin: -6px 0 12px; }
.pt-back a, .pt-back .link { color: var(--pri); font-weight: 600; text-decoration: none; padding: 0; }
.pt-person { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pt-person h2 { margin: 0 0 4px; font-size: 21px; }
.pt-kpis { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.pt-kpi { background: var(--bg); border-radius: 12px; padding: 8px 16px; display: flex; flex-direction: column; min-width: 110px; }
.pt-kpi span { font-size: 12px; color: var(--muted); }
.pt-kpi b { font-size: 22px; color: var(--nav); font-variant-numeric: tabular-nums; }
.pt-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pt-ans td { padding: 7px 10px; }
.pt-ans tr.ok td.mk { color: var(--ok); font-weight: 800; }
.pt-ans tr.bad td.mk { color: var(--bad); font-weight: 800; }
.pt-ans tr.bad td:nth-child(2) { color: var(--bad); }
.pt-review { display: flex; flex-direction: column; gap: 18px; }
.pt-player { width: 100%; }
.pt-rpart { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pt-rpart.read { display: grid; grid-template-columns: 1fr 1fr; max-height: 80vh; }
.pt-rpart.read .rl-ps, .pt-rpart.read .rl-qs { overflow: auto; }
.pt-rpart .rl-qs { background: #FAFBFC; }
.pt-form label.f:first-child { margin-top: 0; }
.dlg.pt-dlg { width: min(520px, 94vw); }
.pt-cred { width: 100%; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 15px/1.6 var(--font); background: var(--bg); }
.pt-switch { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; }
.pt-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.pt-switch span { position: absolute; inset: 0; background: #D0D5DD; border-radius: 999px; transition: background .15s; }
.pt-switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.pt-switch input:checked + span { background: var(--ok); }
.pt-switch input:checked + span::after { transform: translateX(20px); }
.pt-switch input:focus-visible + span { outline: 2px solid var(--pri); outline-offset: 2px; }
/* หน้าทำแบบฝึกหัด */
.ebar button.ghost-light { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; font-weight: 600; }
.ebar button.ghost-light:hover { background: rgba(255, 255, 255, .2); }
.pt-audio .rl-play { width: 44px; height: 36px; padding: 0; font-size: 15px; }
.pt-audio .rl-tm { font-variant-numeric: tabular-nums; min-width: 92px; color: #344054; font-weight: 600; }
.pt-audio .rl-seek { flex: 1; accent-color: var(--nav); min-width: 120px; }
.pt-result { text-align: center; }
.pt-score { display: flex; justify-content: center; gap: 16px; margin: 18px 0 10px; }
.pt-score div { background: var(--bg); border-radius: 16px; padding: 14px 28px; display: flex; flex-direction: column; min-width: 140px; }
.pt-score span { font-size: 13px; color: var(--muted); font-weight: 600; }
.pt-score b { font-size: 34px; color: var(--nav); font-variant-numeric: tabular-nums; }
@media (max-width: 820px) {
  .pt-hdr { padding: 10px 12px; }
  .pt-tabs { order: 5; width: 100%; margin: 0; overflow-x: auto; flex-wrap: nowrap; }
  .pt-user .hdr-meta { display: none; }
  .pt-sheet, .pt-rpart.read { grid-template-columns: 1fr; }
  .wrap { padding: 16px 12px 40px; }
}
[hidden] { display: none !important; }
.pt-review button:disabled, .pt-review select:disabled, .pt-review input:disabled { opacity: 1; cursor: default; }
.pt-review input.ql-gap:disabled { background: #fff; color: var(--ink); }
