/* SABAii.com 0.4 — ธีมสว่างอย่างเดียว (เจ้าของสั่ง 17 พ.ย. 69) · สีตามโลโก้ Student OS: กรมท่า #0B1B4D (ตัวหนังสือ/ปุ่มเข้ม) + ฟ้าสด #0A6CF1 (ปุ่มลงมือ/จุดเด่น)
   ชื่อตัวแปร --green ยังใช้เป็น "สีปุ่มลงมือ" เพื่อให้ย้ายกลับไปแอปหลักได้ง่าย */
:root {
  --blue: #0A6CF1; --blue-deep: #0B1B4D; --blue-light: #E7F0FE;
  --bg: #FFFFFF; --surface: #F1F4FA; --surface-2: #E4EAF5; --border: #E1E7F2;
  --text: #0B1B4D; --text-2: #5E6B85; --ink: #0B1B4D;
  --green: #0A6CF1; --green-press: #0656C7; --warn: #F4A340; --error: #D9443A; --error-light: #FDECEE;
  --sheet-bg: #FFFFFF; --stage: #EDF1F8; --scrim: rgba(15, 26, 48, .38);
  --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --shadow: 0 6px 24px rgba(21, 35, 61, .12);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --sheet-vis: 600px; --low: 300px;
  --hand: "Mali", "Noto Sans Thai Looped", cursive;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: "Inter", "Noto Sans Thai Looped", "Thonburi", "Leelawadee UI", Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased; background: var(--stage); color: var(--text);
  font-size: 16px; line-height: 1.5; overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a { cursor: pointer; border: 0; background: none; text-decoration: none; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--text-2); font-size: 14px; }
.i { width: 22px; height: 22px; flex: none; }
.fab { width: 44px; height: 44px; border-radius: 50%; background: var(--sheet-bg); box-shadow: 0 3px 12px rgba(0,0,0,.14); display: grid; place-items: center; }
.fab:active { transform: scale(.95); }
.badge { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }

/* ================= ชั้นหลัง: โน้ตหน้างาน ================= */
#stage { position: fixed; inset: 0; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; }
#stage::-webkit-scrollbar { display: none; }
#stage.free { scroll-snap-type: none; }
.npage { height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; position: relative; overflow: hidden; }
.npage .wash { position: absolute; inset: 0; opacity: .5; background: linear-gradient(180deg, var(--tint, transparent), transparent 70%); }
.npage .wm { display: none; }
.nrow {
  position: absolute; left: 0; right: 0; top: calc(64px + env(safe-area-inset-top, 0px)); bottom: calc(var(--rowlow, var(--low)) + 50px);
  /* การ์ดอยู่กลางคอลัมน์พอดี: ช่องซ้าย = ช่องขวา (คอลัมน์กว้างสุด 560 · การ์ดกว้าง 80% สูงสุด 420) */
  --card-w: min(80vw, 420px); --side: calc((min(100vw, 560px) - var(--card-w)) / 2);
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 12px var(--side); scroll-padding: 0 var(--side); scrollbar-width: none;
}
.nrow::-webkit-scrollbar { display: none; }
.nitem { flex: none; width: var(--card-w, min(80vw, 420px)); height: 100%; scroll-snap-align: center; position: relative; border-radius: 10px; overflow: hidden; box-shadow: 0 12px 28px rgba(0,0,0,.16), 0 1px 3px rgba(0,0,0,.1); }
/* การ์ดโน้ตตั้งตรง ไม่เอียง (เจ้าของบอกว่าดูเบี้ยว) */
.ntag { position: absolute; left: 12px; bottom: 12px; font-size: 11px; background: rgba(22,24,29,.72); color: #fff; border-radius: 8px; padding: 3px 9px; display: flex; gap: 5px; align-items: center; }
.ntag svg { width: 12px; height: 12px; }
.nitem.board { background: radial-gradient(120% 90% at 40% 30%, #3d5a48, #23362b); color: #F1F3EE; }
.nitem.board::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,.025) 0 2px, transparent 2px 9px); }
.nitem.board .txt { position: relative; padding: 34px 26px; font-family: var(--hand); font-size: 21px; line-height: 1.6; white-space: pre-line; transform: rotate(-2deg); }
.nitem.board .txt em { font-style: normal; color: #FFD36E; }
.nitem.sheet { background: #fff; color: #2b3240; padding: 18px 20px; }
.nitem.sheet h4 { font-size: 13px; border-bottom: 2px solid #16181d; padding-bottom: 6px; margin-bottom: 8px; }
.nitem.sheet .txt { font-size: 13px; line-height: 2; white-space: pre-line; background-image: repeating-linear-gradient(transparent 0 25px, #d6e4f5 25px 26px); }
.nitem.sheet mark { background: #FFF2A8; }
.nitem.sticky { background: #FFE98A; color: #20304f; font-family: var(--hand); font-size: 20px; line-height: 1.55; padding: 26px 22px; white-space: pre-line; }
.nitem.photo { background: #1b1f2a; }
.nitem.photo::before { content: ""; position: absolute; inset: -20px; background: var(--src) center / cover; filter: blur(18px) brightness(.75); }
.nitem.photo .zoom { position: absolute; inset: 0; display: block; cursor: zoom-in; }
.nitem.photo img { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; } /* เต็มกรอบ (26 พ.ย.) · แตะดูทั้งใบ */
.nexp { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: rgba(11,20,48,.42); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); pointer-events: none; }
.nexp svg { width: 15px; height: 15px; }
.mini-in .nexp { display: none; }
.ntag .ncount { font-weight: 700; margin-left: 4px; opacity: .8; }
.viewer { position: fixed; inset: 0; z-index: 70; background: rgba(5,10,30,.94); display: grid; place-items: center; cursor: zoom-in; touch-action: none; overflow: hidden; overscroll-behavior: contain; -webkit-user-select: none; user-select: none; }
.viewer.zoomed { cursor: grab; }
.viewer img { max-width: 100vw; max-height: 100dvh; object-fit: contain; transform-origin: center; will-change: transform; -webkit-user-drag: none; pointer-events: none; }
.viewer .fab { position: fixed; right: 16px; top: calc(12px + env(safe-area-inset-top, 0px)); }
.nitem.empty { background: transparent; box-shadow: none; border: 2px dashed rgba(0,0,0,.18); display: grid; place-items: center; text-align: center; color: var(--text-2); padding: 20px; }
.nitem.empty button { margin-top: 12px; }

#note-ui > * { position: fixed; z-index: 15; transition: opacity .2s, transform .25s; }
body:not(.note-mode) #note-ui > * { opacity: 0; pointer-events: none; }
#note-back { left: 16px; top: calc(12px + env(safe-area-inset-top, 0px)); }
#note-add { right: 16px; bottom: calc(var(--sheet-vis) + 12px); }
.subjchip { left: 70px; top: calc(18px + env(safe-area-inset-top, 0px)); height: 32px; border-radius: 16px; background: var(--sheet-bg); box-shadow: 0 3px 12px rgba(0,0,0,.10); display: flex; align-items: center; gap: 7px; padding: 0 12px 0 4px; font-size: 13px; font-weight: 600; }
.subjchip .badge { width: 24px; height: 24px; border-radius: 8px; font-size: 9.5px; }
.subjchip .sib { background: var(--surface); color: var(--text-2); }
.subjchip .sib svg { width: 15px; height: 15px; }
.subjchip .cn::after { content: "·"; margin-left: 7px; opacity: .45; }
.pager { right: 12px; top: calc(110px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 7px; align-items: center; }
.pager i { width: 7px; height: 7px; border-radius: 4px; background: rgba(0,0,0,.2); transition: height .2s; }
.pager i.on { height: 22px; background: var(--ink); }
.pager small { font-size: 10px; color: var(--text-2); writing-mode: vertical-rl; margin-top: 4px; }
.peek { left: 50%; transform: translateX(-50%); bottom: calc(var(--sheet-vis) - 2px); height: 36px; padding: 0 18px; border-radius: 14px 14px 0 0; background: var(--sheet-bg); display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.peek svg { width: 14px; height: 14px; }

/* ================= แผ่นล่าง ================= */
#sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0 auto; max-width: 560px;
  height: 100vh; background: var(--sheet-bg); border-radius: 24px 24px 0 0;
  box-shadow: 0 -6px 24px rgba(21, 35, 61, .10); overflow: hidden; touch-action: none;
  /* สูงเต็มจอ (JS ใส่ px ตามจอจริง) แล้วเลื่อนลงด้วย transform — ขยับบนการ์ดจอ ไม่ต้องจัดหน้าใหม่ */
  transform: translate3d(0, calc(100vh - var(--sheet-vis)), 0); will-change: transform;
  transition: transform .34s cubic-bezier(.2,.8,.2,1), border-radius .2s;
}
#sheet.dragging { transition: none; }
/* ดันขึ้นสุด = ชิดขอบจอบน มุมเหลี่ยม เว้นที่ให้แถบสถานะของเครื่อง */
#sheet.full { border-radius: 0; box-shadow: none; }
#sheet.full .grab { padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
#sheet.full .pane { top: calc(34px + env(safe-area-inset-top, 0px)); }
.grab { padding: 8px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: grab; touch-action: none; position: relative; z-index: 2; background: var(--sheet-bg); }
.grab i { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-2); }
.grab .hint { font-size: 11.5px; color: var(--text-2); height: 16px; transition: opacity .2s; }
body.note-mode .grab .hint { opacity: 0; }
.pane { position: absolute; left: 0; right: 0; top: 34px; bottom: 0; padding: 4px 20px 0; transition: opacity .2s; }
.pane-home { overflow: hidden; padding-bottom: calc(110px + var(--safe-b)); }
#sheet.full .pane-home { overflow-y: auto; touch-action: pan-y; }
.pane-note { bottom: auto; height: calc(var(--low) - 34px); opacity: 0; pointer-events: none; display: flex; flex-direction: column; padding-bottom: calc(16px + var(--safe-b)); } /* แผ่นสูงเต็มจอ → ให้การ์ดงานสูงเท่าส่วนที่โผล่ตอนดูโน้ต */
body.note-mode .pane-home { opacity: 0; pointer-events: none; }
body.note-mode .pane-note { opacity: 1; pointer-events: auto; }

/* หน้าแรก */
.brandrow { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 4px; }
.brand { font-weight: 800; font-size: 19px; letter-spacing: -.2px; }
.brand b { color: var(--green); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue-light); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
h1.big { font-size: 26px; font-weight: 800; line-height: 1.25; letter-spacing: -.3px; margin-bottom: 14px; }
.sub { color: var(--text-2); font-size: 14px; margin: 2px 0 12px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border-radius: 18px; min-height: 108px; padding: 12px 8px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; }
.tile:active { transform: scale(.98); background: var(--surface-2); }
.tile svg { width: 40px; height: 40px; margin-bottom: 4px; }
.tile b { font-size: 16px; } .tile small { font-size: 12px; color: var(--text-2); }
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 16px; padding: 6px 6px 6px 14px; min-height: 54px; margin-top: 12px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 17px; font-weight: 600; }
.search input::placeholder { color: var(--text); opacity: .85; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--sheet-bg); border-radius: 12px; padding: 8px 12px; font-size: 14px; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.chip svg { width: 16px; height: 16px; }
.sec { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 6px; }
.sec h2 { font-size: 17px; font-weight: 800; } .sec span { font-size: 13px; color: var(--text-2); }
.tlist { list-style: none; }
.trow { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.trow .main { flex: 1; min-width: 0; text-align: left; display: flex; gap: 12px; align-items: center; }
.trow .main > div { min-width: 0; }
.trow b { display: block; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow small { display: block; font-size: 13px; color: var(--text-2); }
.trow small em, .meta em { font-style: normal; color: var(--error); font-weight: 600; }
.go { height: 38px; padding: 0 16px; border-radius: 12px; background: var(--green); color: #fff; font-weight: 700; font-size: 14px; flex: none; }
.go.dark { background: var(--ink); color: var(--bg); }
.go.doing { background: var(--blue-light); color: var(--blue); }
.empty-note { text-align: center; padding: 22px 0; color: var(--text-2); }
.more { width: 100%; padding: 14px 12px; font-weight: 700; color: var(--blue); display: flex; justify-content: center; align-items: center; gap: 4px; background: var(--surface); border-radius: 14px; margin-top: 6px; }
.more svg { width: 16px; height: 16px; }

/* แผ่นล่างตอนดูโน้ต — ฐานร่วม = แบบ 1 "เรียบหรู" · แบบอื่นทับด้วย body.ns-N ท้ายไฟล์ (เนื้อในสร้างใน features/notestyle.js) */
.ntitle { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ntitle > div { min-width: 0; }
.ntitle h2 { font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.4px; margin-top: 6px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nsubj, .ndue { height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.nsubj { color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); }
.ndue { background: var(--surface); color: var(--text-2); }
.ndue.urgent { background: var(--error-light); color: var(--error); }
.ndue.urgent::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(217,68,58,.18); }
.nx { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.meta { font-size: 13.5px; color: var(--text-2); margin-top: 4px; }
.pane-note hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.lbl { font-size: 12px; color: var(--text-2); text-align: center; margin-bottom: 8px; }
.pane-note .lbl { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: #8590A8; margin: 12px 0 8px; }
.pills { display: flex; gap: 8px; }
.pill { flex: 1; height: 46px; border-radius: 23px; background: var(--surface); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 600; }
.pill svg { width: 18px; height: 18px; }
.pane-note .pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pane-note .pill { height: 56px; border-radius: 18px; background: #F5F7FB; border: 1px solid #E7ECF5; flex-direction: column; gap: 2px; font-size: 13px; font-weight: 700; }
.pane-note .pill svg { width: 20px; height: 20px; color: var(--blue); }
.pane-note .pill:active { transform: scale(.97); }
.cta { margin-top: auto; height: 56px; border-radius: 28px; background: var(--green); color: #fff; font-weight: 800; font-size: 17px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; flex: none; }
.cta:active { background: var(--green-press); }
.cta.doing { background: var(--ink); color: var(--bg); }
.pane-note .cta:not(.doing):not(.slide) { border-radius: 20px; font-size: 18px; background: linear-gradient(180deg, #2B82FF, #0A6CF1); box-shadow: 0 12px 22px -10px rgba(10,108,241,.7), inset 0 1px 0 rgba(255,255,255,.25); }
.pane-note .cta:has(.ctai) { padding: 0 7px 0 22px; gap: 10px; }
.pane-note .cta small { font-size: 13px; font-weight: 600; opacity: .75; }
.pane-note .cta .ctai { margin-left: auto; width: 42px; height: 42px; border-radius: 14px; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.pane-note .cta .ctai svg { width: 17px; height: 17px; fill: currentColor; }
.pane-note .cta.doing { border-radius: 20px; }
.pane-note .iconbtn { width: 42px; height: 42px; flex: none; }
.pane-note .iconbtn svg { width: 19px; height: 19px; }
.timer { display: inline-flex; gap: 6px; align-items: center; background: var(--blue-light); color: var(--blue); border-radius: 999px; padding: 2px 10px; font-weight: 700; font-size: 13px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.nchips .timer { margin-left: 0; height: 26px; }
#note-add { display: none; } /* ปุ่ม "รูป" ในแผ่นล่างเลือกถ่ายหรือเลือกจากคลังได้อยู่แล้ว */

/* ================= เมนูล่าง (ลอย · ซ่อนเองเวลาเลื่อน/ดูโน้ต) ================= */
#nav {
  position: fixed; z-index: 30; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%);
  width: min(calc(100vw - 40px), 340px); height: 64px; border-radius: 22px; background: var(--sheet-bg);
  box-shadow: 0 8px 28px rgba(21,35,61,.16); display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px; gap: 4px;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .2s;
}
#nav.away { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
#nav a { border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--text-2); }
#nav a svg { width: 22px; height: 22px; }
#nav a[aria-current="page"] { background: var(--surface); color: var(--text); }

/* ================= หน้า "งาน" / "ฉัน" / วิชา ================= */
#page { position: fixed; inset: 0; z-index: 25; background: var(--bg); overflow-y: auto; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(110px + var(--safe-b)); }
#page > * { max-width: 560px; margin-left: auto; margin-right: auto; }
.phead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.phead h1 { font-size: 30px; font-weight: 800; flex: 1; letter-spacing: -.3px; min-width: 0; }
.monthchip { display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: var(--bg); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; }
.monthchip svg { width: 16px; height: 16px; }
.iconbtn { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; flex: none; }

.cal { background: var(--surface); border-radius: 22px; padding: 12px 10px 4px; }
.cal .nav2 { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 6px; font-weight: 700; }
.cal .nav2 button { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.cal .nav2 button:hover { background: var(--surface-2); }
.dow, .days { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.dow span { font-size: 11px; color: var(--text-2); padding-bottom: 4px; }
.days { gap: 6px 4px; }
.day { aspect-ratio: 1 / 1; max-height: 48px; border-radius: 14px; background: var(--sheet-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; position: relative; }
.day.out { opacity: .35; }
.day.today { background: var(--ink); color: var(--bg); }
.day.sel { box-shadow: 0 0 0 2px var(--blue) inset; background: var(--blue-light); color: var(--text); }
.day .dots { display: flex; gap: 3px; height: 6px; margin-top: 1px; }
.day .dots i { width: 5px; height: 5px; border-radius: 50%; }
.day .dots .ex { background: var(--error); } .day .dots .hw { background: var(--blue); }
.cal .foot { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--text-2); padding: 8px 6px 4px; }
.cal .foot .lg { display: flex; gap: 10px; align-items: center; }
.cal .foot .lg i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
.cal .bar { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--surface-2); margin: 4px auto 6px; }
.daylist { margin-top: 10px; }
.daylist h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }

.filters { display: flex; gap: 8px; overflow-x: auto; margin: 16px 0 12px; scrollbar-width: none; }
.filters button { white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: var(--surface); font-weight: 600; font-size: 14px; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.proj { background: var(--surface); border-radius: 20px; padding: 8px; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.proj:active { transform: scale(.98); }
.cover { height: 140px; border-radius: 14px; position: relative; overflow: hidden; display: grid; place-items: center; }
.cover .mini { position: absolute; top: 50%; left: 50%; box-shadow: 0 6px 14px rgba(11,27,77,.18), 0 1px 2px rgba(11,27,77,.12); }
.cover .mini.solo { transform: translate(-50%, -50%) rotate(-3deg); }
.cover .mini.back { transform: translate(-82%, -52%) rotate(-8deg); }
.cover .mini.front { transform: translate(-22%, -46%) rotate(5deg); }
.cover-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; }
/* ภาพย่อโน้ต: โน้ตจริงขนาดเต็มที่ถูกย่อ */
.mini { border-radius: 8px; overflow: hidden; flex: none; position: relative; background: var(--sheet-bg); }
.mini-in { transform-origin: 0 0; pointer-events: none; }
.mini-in .nitem { width: 100% !important; height: 100% !important; transform: none !important; box-shadow: none !important; border-radius: 0; }
.mini-in .ntag { display: none; }
.proj .ph { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; gap: 6px; }
.proj b { font-size: 16px; font-weight: 800; }
.proj .cnt { font-size: 11.5px; font-weight: 700; border-radius: 8px; padding: 2px 8px; white-space: nowrap; }
.proj small { display: block; padding: 0 6px 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj small em { font-style: normal; color: var(--error); font-weight: 600; }
.proj.new { align-items: center; justify-content: center; min-height: 170px; color: var(--text-2); font-weight: 600; border: 2px dashed var(--border); background: transparent; }

/* หน้าวิชา (โปรเจกต์) */
.board { display: flex; flex-direction: column; gap: 14px; }
.tcard { background: var(--surface); border-radius: 20px; padding: 14px; }
.tcard .top { display: flex; gap: 10px; align-items: flex-start; }
.tcard .top > div { flex: 1; min-width: 0; }
.tcard b { font-weight: 800; font-size: 16px; }
.tcard.done b { text-decoration: line-through; color: var(--text-2); }
.strip { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; scrollbar-width: none; }
.strip > * { flex: none; width: 96px; height: 128px; border-radius: 10px; position: relative; }
.strip .mini { box-shadow: 0 2px 6px rgba(11,27,77,.12); border: 1px solid var(--border); }
.strip .s-add { border: 2px dashed var(--border); display: grid; place-items: center; color: var(--text-2); font-size: 24px; background: transparent; }
.row-actions { display: flex; gap: 8px; margin-top: 10px; }
.row-actions button { flex: 1; height: 40px; border-radius: 12px; background: var(--sheet-bg); font-weight: 600; font-size: 14px; }

/* หน้าฉัน */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.stat { background: var(--surface); border-radius: 18px; padding: 14px 10px; text-align: center; }
.stat b { display: block; font-size: 24px; font-weight: 800; } .stat small { font-size: 12px; color: var(--text-2); }
.list-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 4px; border-bottom: 1px solid var(--border); font-weight: 600; text-align: left; }

/* ================= กล่องล่าง (เพิ่มงาน / โน้ต / แก้ไข) ================= */
.mscrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; opacity: 0; transition: opacity .25s; }
.mscrim.show { opacity: 1; }
.modal { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto; max-height: 92dvh; background: var(--sheet-bg); border-radius: 24px 24px 0 0; display: flex; flex-direction: column; transform: translateY(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.modal.show { transform: none; }
.mhead { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px; }
.mhead h2 { font-size: 19px; font-weight: 800; }
.mbody { padding: 4px 16px 12px; overflow-y: auto; flex: 1; }
.mfoot { padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--border); display: flex; gap: 10px; }
.btn { min-height: 52px; border-radius: 16px; font-weight: 700; font-size: 16px; padding: 0 18px; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--green); color: #fff; } .btn.ghost { background: var(--surface); } .btn.danger { color: var(--error); background: var(--error-light); }
.btn:disabled { opacity: .45; }
textarea.field, input.field, select.field { width: 100%; background: var(--surface); border: 2px solid transparent; border-radius: 14px; padding: 12px 14px; font-size: 16px; outline: none; }
textarea.field { min-height: 130px; resize: vertical; line-height: 1.6; }
.field:focus { border-color: var(--blue); background: var(--sheet-bg); }
.flabel { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 12px 0 4px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.draft { background: var(--surface); border-radius: 16px; padding: 12px; margin-bottom: 10px; }
.draft .field { background: var(--sheet-bg); }
.draft .warn { font-size: 12.5px; color: #8A5A00; margin-top: 6px; }
.preview { width: 100%; max-height: 220px; object-fit: contain; border-radius: 12px; background: var(--surface); }
.mic { width: 84px; height: 84px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin: 10px auto; animation: breathe 1.6s ease-in-out infinite; }
.mic svg { width: 36px; height: 36px; }
@keyframes breathe { 50% { box-shadow: 0 0 0 16px rgba(10,108,241,.15); } }

#toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -160%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 60; transition: transform .25s; max-width: calc(100vw - 32px); display: flex; gap: 12px; align-items: center; }
#toast.show { transform: translate(-50%, 0); }
#toast { pointer-events: none; } /* ไม่บังที่จับแผ่นล่างที่อยู่ใต้ — กดได้เฉพาะปุ่มในแถบ */
#toast button { color: #7FC8FF; font-weight: 700; pointer-events: auto; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ================= เพิ่มเติมของแอปจริง ================= */
.center { text-align: center; } .block { display: block; }
.muted.center { margin: 10px 0; }
.btn.auto { flex: none; min-height: 44px; } .btn.full { width: 100%; margin-top: 14px; }
.iconbtn.sm { width: 36px; height: 36px; } .iconbtn.sm svg { width: 18px; height: 18px; } .iconbtn:disabled { opacity: .35; }
.link { color: var(--blue); font-weight: 600; font-size: 13px; margin-top: 8px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; background: #FFF4D6; color: #8A5A00; border-radius: 6px; padding: 0 6px; margin-left: 6px; }
.pinmark svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; color: var(--blue); }
.preview.small { max-height: 120px; margin-bottom: 10px; }
textarea.field.short { min-height: 80px; } textarea.field.mono { font: 12px/1.5 ui-monospace, monospace; min-height: 220px; }
.draft .frow { margin-top: 8px; }
.pills.col { flex-direction: column; } .pills.col .pill { flex: none; justify-content: flex-start; padding: 0 18px; }
h1.mid { font-size: 24px; }
.proj.new.slim { min-height: 64px; }
.cal .foot i.ex, .cal .foot i.hw { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
.cal .foot i.ex { background: var(--error); } .cal .foot i.hw { background: var(--blue); }
.cal .nav2 b { font-weight: 700; }
.notewrap { position: relative; }
.notewrap .del { position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; border-radius: 50%; background: var(--sheet-bg); box-shadow: 0 2px 6px rgba(0,0,0,.2); display: grid; place-items: center; }
.notewrap .del svg { width: 16px; height: 16px; }
.list-btn .lk { flex: 1; } .list-btn .lk small { display: block; font-size: 12px; color: var(--text-2); font-weight: 500; }
.list-btn .lv { font-size: 13px; color: var(--text-2); font-weight: 500; } .list-btn .chev svg { width: 16px; height: 16px; color: var(--text-2); }
.list-btn svg { width: 20px; height: 20px; }
.mlist { margin-top: 8px; }
.meline { display: flex; gap: 12px; align-items: center; }
.meline > div { flex: 1; min-width: 0; } .meline b { font-size: 18px; }
.avatar.big { width: 56px; height: 56px; font-size: 22px; }
.weekcard { background: var(--surface); border-radius: 20px; padding: 4px 14px 12px; }
.weekcard .sec { margin-top: 10px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 110px; align-items: end; }
.wcol { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; font-size: 11px; color: var(--text-2); }
.wbar { flex: 1; width: 100%; max-width: 26px; position: relative; display: flex; align-items: flex-end; }
.wbar i { display: block; width: 100%; background: var(--blue); border-radius: 6px 6px 3px 3px; }
.wbar em { position: absolute; left: 0; right: 0; top: -2px; text-align: center; font-style: normal; font-weight: 700; color: var(--text); font-size: 11px; }
.wcol.today span { color: var(--text); font-weight: 700; }
.seg { display: flex; background: var(--surface); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; height: 42px; border-radius: 10px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--sheet-bg); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.subjrow { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.subjrow .field { flex: 1; min-width: 0; padding: 10px 12px; }
.subjrow.off .field { opacity: .5; }
.sw { width: 30px; height: 30px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 3px rgba(255,255,255,.5); }
.addrow { display: flex; gap: 8px; margin-top: 12px; }
.confirm { position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: grid; place-items: center; padding: 16px; }
.cbox { background: var(--sheet-bg); border-radius: 22px; padding: 20px; width: min(360px, 100%); }
.cbox h3 { font-size: 18px; font-weight: 800; } .cbox p { color: var(--text-2); margin-top: 6px; font-size: 15px; }
.cbox .row2 { margin-top: 18px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.storage-warn { position: fixed; top: 0; left: 0; right: 0; z-index: 90; background: #FFF4E0; color: #7A4B00; font-size: 13px; padding: 6px 12px; text-align: center; }
.fatal { padding: 40px 20px; text-align: center; }
.empty-note .row2 { max-width: 360px; margin: 14px auto 0; }
input[type=search]::-webkit-search-cancel-button { display: none; }

/* ================= เพิ่มงานแบบเร็ว: พิมพ์ → เห็นผลทันที → แตะชิป → บันทึก ================= */
textarea.field.quick { min-height: 64px; font-size: 18px; font-weight: 600; }
.qpreview { margin-top: 10px; }
.qrow { display: flex; gap: 10px; align-items: center; padding: 8px 2px; }
.qrow > div { min-width: 0; } .qrow b { display: block; font-weight: 700; }
.qrow small { color: var(--text-2); font-size: 13px; }
.qrow .badge { width: 34px; height: 34px; border-radius: 10px; font-size: 11px; }
.qrow > div { flex: 1; } .qrow .qx { margin-left: auto; width: 34px; height: 34px; flex: none; color: var(--text-2); }
.qrow .qx svg { width: 16px; height: 16px; }
.qcount { margin: 2px 2px 0; font-size: 13px; font-weight: 700; color: var(--text-2); }
.qchips { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.qchips::-webkit-scrollbar { display: none; }
.qchip { flex: none; height: 38px; padding: 0 14px; border-radius: 19px; background: var(--surface); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; position: relative; white-space: nowrap; cursor: pointer; }
.qchip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.qchip svg { width: 16px; height: 16px; }
.qpick input.qdate { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.qpick input.qdate::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
details.more-fields { margin-top: 12px; }
details.more-fields summary { cursor: pointer; font-weight: 700; color: var(--blue); padding: 8px 0; }
div.flabel { margin-bottom: 0; }

/* ================= จอกว้าง (คอม/แท็บเล็ต): ทุกอย่างอยู่ในคอลัมน์กลาง 560px ================= */
@media (min-width: 600px) {
  .nrow { left: calc(50% - 280px); right: calc(50% - 280px); }
  #note-back { left: calc(50% - 264px); }
  .subjchip { left: calc(50% - 210px); }
  .pager { right: calc(50% - 268px); }
  #note-add { right: calc(50% - 264px); }
  #sheet { box-shadow: 0 -6px 24px rgba(21, 35, 61, .10), 0 0 0 1px var(--border); }
  #sheet.full { border-radius: 24px 24px 0 0; }
}

/* ================= ปุ่มพูด 2 โหมด (listen.js) ================= */
.lmode { margin-bottom: 4px; }
.lmode button { font-size: 14px; }
.lmode button[aria-pressed="true"] { background: var(--blue); color: #fff; box-shadow: none; }
.lbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 8px; }
.lstatus { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ldot { width: 10px; height: 10px; border-radius: 50%; background: var(--error); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }
.lbtn[hidden] { display: none; }
.lbtn { height: 36px; padding: 0 14px; font-size: 14px; flex: none; }
.lsec { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 12px 0 2px; }
.lrow { cursor: pointer; align-items: flex-start; }
.lrow input { width: 20px; height: 20px; margin-top: 7px; accent-color: var(--blue); flex: none; }
.lrow.off { opacity: .45; }
.lquote { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.45; }
.lnote { font-size: 12px; color: var(--text-2); margin-top: 12px; }
.tag.teach { background: #F1E8FD; color: #6B35C2; }
.tag.new { background: #E7F0FE; color: #0A55C2; } /* 0.22.8 งานที่เพิ่งจด */
.sec.mhead2 { margin-top: 22px; }
.sec.mhead2 + .mlist { margin-top: 0; }
.lstatus.bad { color: var(--error); }

/* ================= หน้าโน้ตงาน (ของเดิม 6 แบบ ns-1 … ns-6 เลิกใช้ใน 0.18 · เหลือกระดาษกราฟ/เทปของธีม "สมุด") · เลือกตอนเข้าแอปครั้งแรก/หน้าฉัน) =================
   ฐานด้านบน = แบบ 1 · ทุกแบบใช้ข้อมูลชุดเดียวกัน ต่างกันที่หน้าตา · ภาพตัวอย่างอยู่ใน assets/note-styles/ */
#sheet { transition: transform .34s cubic-bezier(.2,.8,.2,1), border-radius .2s, left .25s, right .25s, bottom .25s, background-color .25s; }
#stage .nitem:not(.empty) { transition: box-shadow .2s; }

/* ---------- 1 เรียบหรู ---------- */

/* ---------- 2 ภาพเต็มจอ ---------- */
/* รูปเบลอ + เคลือบกรมท่า — รูปโทนอุ่น (เพดานครีม/ผิว) จะไม่กลายเป็นสีน้ำตาลขี้ม้า และฉากเป็นโทนแอปเสมอ */

/* ---------- 3 ใบงาน (ตั๋ว) · 6 การ์ดลอย — แผ่นล่างลอยมีขอบรอบด้าน ---------- */
.tk-a { position: relative; padding: 0 20px; }
.tk-lab { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; color: var(--c); padding-right: 48px; min-height: 22px; }
.tk-lab .timer { margin: 0; }
.tk-a h2 { font-size: 25px; font-weight: 800; letter-spacing: -.4px; line-height: 1.2; padding-right: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-a .nedit { position: absolute; top: -6px; right: 16px; border-radius: 12px; }
.tk-fields { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 10px; }
.tkf { padding-left: 12px; border-left: 1px solid var(--border); min-width: 0; }
.tkf:first-child { padding-left: 0; border-left: 0; }
.tkf small { display: block; font-size: 11px; color: #8590A8; font-weight: 600; }
.tkf b { display: block; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tkf.red b { color: var(--error); }
.tk-cut { margin: auto 14px 0; position: relative; border-top: 2px dashed #D6DEEB; }
.tk-cut::before, .tk-cut::after { content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: #E6EBF4; }
.tk-cut::before { left: -25px; } .tk-cut::after { right: -25px; }
.tk-b { display: flex; gap: 8px; padding: 14px 14px 0; }
.pane-note .pill.sq { flex: none; width: 50px; height: 52px; border-radius: 15px; background: var(--surface); border: 0; font-size: 10px; color: var(--text-2); gap: 1px; }
.pane-note .pill.sq svg { color: var(--ink); }
.tk-b .cta { flex: 1; width: auto; margin-top: 0; height: 52px; font-size: 17px; }
.pane-note .tk-b .cta:not(.doing) { border-radius: 15px; }
.tk-b .cta svg { width: 18px; height: 18px; }

/* ---------- 4 สมุดกราฟ ---------- */
/* แบบ 4 สมุดกราฟ (ยกระดับ 26 พ.ย.): กระดาษกราฟมีเส้นหลักทุก 5 ช่อง + เส้นกั้นหน้าสีแดง · โพลารอยด์กระดาษครีม รูปเต็มกรอบ
   เทปวาชิขอบหยักห้อยเลยขอบการ์ด · คำบรรยายลายมือ + ลำดับโน้ต · แผ่นล่างปุ่มสติกเกอร์ */
body.nt-book .npage .wash { opacity: 1; background-color: #F6F8FC;
  background-image: linear-gradient(90deg, transparent 30px, rgba(229,101,101,.32) 30px 32px, transparent 32px),
    linear-gradient(#CFDBEE 1px, transparent 1px), linear-gradient(90deg, #CFDBEE 1px, transparent 1px),
    linear-gradient(#E2E9F5 1px, transparent 1px), linear-gradient(90deg, #E2E9F5 1px, transparent 1px);
  background-size: 100% 100%, 110px 110px, 110px 110px, 22px 22px, 22px 22px; background-position: 0 0, -1px -1px, -1px -1px, -1px -1px, -1px -1px; }
@media (max-width: 360px) { body.nt-book #stage .nitem .ntag { font-size: 12.5px; gap: 4px; } body.nt-book #stage .nitem .ntag svg { display: none; } }
body.nt-book #stage .nitem:not(.empty)::after { content: ""; position: absolute; top: -11px; left: 50%; width: 108px; height: 28px; margin-left: -54px; z-index: 3; pointer-events: none;
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,.28) 0 5px, transparent 5px 10px), rgba(255,206,84,.82);
  clip-path: polygon(0 10%, 3% 0, 6% 12%, 9% 2%, 91% 2%, 94% 12%, 97% 0, 100% 10%, 98% 50%, 100% 90%, 97% 100%, 94% 88%, 91% 98%, 9% 98%, 6% 88%, 3% 100%, 0 90%, 2% 50%);
  transform: rotate(-3deg); }

/* ---------- 5 สีวิชาเต็มหัว + ปัดเพื่อเริ่ม ---------- */
.n5due { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--text-2); flex-wrap: wrap; }
.n5due.urgent { color: var(--error); }
.n5due > span { display: grid; } .n5due svg { width: 16px; height: 16px; }
.n5due small { color: #8590A8; font-weight: 600; font-size: 13px; }
.n5add { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.n5add > span { flex: 1; font-size: 14px; font-weight: 700; color: var(--text-2); }
.pane-note .pill.round { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--sc) 15%, #fff); }
.pane-note .pill.round svg { color: color-mix(in srgb, var(--sc) 80%, #000); }
.pane-note .pill.round span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cta.slide { position: relative; height: 62px; border-radius: 31px; background: #0B1B4D; color: #fff; font-size: 16px; font-weight: 700; gap: 10px; touch-action: none; -webkit-user-select: none; user-select: none; overflow: hidden; }
.cta.slide:active { background: #0B1B4D; }
.cta.slide .th { position: absolute; left: 5px; top: 5px; width: 52px; height: 52px; border-radius: 50%; background: var(--sc); display: grid; place-items: center; transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: 0 4px 12px color-mix(in srgb, var(--sc) 50%, transparent); }
.cta.slide .th svg { width: 22px; height: 22px; color: #fff; }
.cta.slide .sl, .cta.slide .chev { opacity: calc(1 - var(--p, 0)); padding-left: 30px; }
.cta.slide .chev { padding-left: 0; letter-spacing: -2px; color: rgba(255,255,255,.55); font-weight: 800; }
@media (prefers-reduced-motion: no-preference) { .cta.slide:not(.doing) .th { animation: nudge 2.6s ease-in-out 1s infinite; } }
@keyframes nudge { 0%, 72%, 100% { translate: 0; } 84% { translate: 14px; } }

/* ---------- 6 การ์ดลอย กล่องข้อมูล ---------- */
.b6hd { display: flex; align-items: center; gap: 12px; }
.b6badge { width: 48px; height: 48px; border-radius: 15px; color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; flex: none; }
.b6t { flex: 1; min-width: 0; }
.b6t h2 { font-size: 21px; font-weight: 800; line-height: 1.25; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b6t small { font-size: 13px; color: var(--text-2); font-weight: 600; display: flex; gap: 4px; align-items: center; white-space: nowrap; overflow: hidden; }
.b6bento { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.bx { border-radius: 18px; padding: 9px 12px; min-height: 58px; min-width: 0; background: var(--surface); }
.bx small { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.bx b { display: block; font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bdue.urgent { background: var(--error-light); color: var(--error); } .bdue.urgent small { color: var(--error); }
.bnote { display: flex; gap: 10px; align-items: center; }
.bnote > div { min-width: 0; }
.bnote img { width: 34px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
.pane-note .pills.seg6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 8px; border-radius: 16px; background: var(--surface); }
.seg6 .pill { height: 48px; border: 0; background: none; flex-direction: row; gap: 6px; font-size: 13.5px; border-radius: 16px; position: relative; }
.seg6 .pill + .pill::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: #DCE3EF; }

/* ================= แบบสอบถามก่อนเข้าแอป (features/onboard.js) ================= */
.ob { position: fixed; inset: 0; z-index: 55; background: var(--bg); display: flex; flex-direction: column; max-width: 560px; margin: 0 auto;
  padding: env(safe-area-inset-top, 0px) 0 0; animation: obin .3s ease-out; }
.ob.out { opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .25s; pointer-events: none; }
@keyframes obin { from { opacity: 0; } }
body.ob-open #nav { opacity: 0; pointer-events: none; }
.ob-top { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 12px; flex: none; }
.ob-back { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); flex: none; }
.ob-back[hidden] { display: grid !important; visibility: hidden; }
.ob-prog { flex: 1; display: flex; gap: 6px; }
.ob-prog[hidden] { display: flex !important; visibility: hidden; }
.ob-prog i { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-2); transition: background .3s; }
.ob-prog i.on { background: var(--blue); }
.ob-skip { height: 44px; padding: 0 12px; font-weight: 700; color: var(--text-2); flex: none; }
.ob-skip[hidden] { display: block !important; visibility: hidden; }
.ob-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 24px 24px; overscroll-behavior: contain; }
.ob-view { display: flex; flex-direction: column; gap: 14px; animation: obstep .32s cubic-bezier(.2,.8,.2,1); }
.ob-view.rev { animation-name: obstepr; }
@keyframes obstep { from { opacity: 0; transform: translateX(28px); } }
@keyframes obstepr { from { opacity: 0; transform: translateX(-28px); } }
@media (prefers-reduced-motion: reduce) { .ob, .ob-view { animation: none; } }
.ob-k { font-size: 13px; font-weight: 700; color: var(--blue); letter-spacing: .02em; }
.ob-q { font-size: 28px; font-weight: 800; line-height: 1.25; letter-spacing: -.4px; text-wrap: balance; margin-top: -8px; outline: none; }
.ob-k + .ob-q { margin-top: -10px; }
.ob-sub { color: var(--text-2); font-size: 15.5px; margin-top: -6px; }
.ob-why { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.55; color: var(--text-2); background: var(--surface); border-radius: 14px; padding: 10px 12px; }
.ob-why span { display: grid; flex: none; margin-top: 1px; } .ob-why svg { width: 16px; height: 16px; color: var(--blue); }
.ob-foot { flex: none; padding: 12px 20px calc(16px + var(--safe-b)); background: linear-gradient(180deg, rgba(255,255,255,0), var(--bg) 30%); }
.ob-next { margin-top: 0; }
.ob-next:disabled { background: var(--surface-2); color: var(--text-2); }


.ob-input { font-size: 20px; font-weight: 700; min-height: 58px; }
.ob-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-chip { height: 44px; padding: 0 16px 0 12px; border-radius: 22px; background: var(--surface); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; border: 2px solid transparent; transition: background .15s, border-color .15s; }
.ob-chip i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.ob-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 12%, #fff); border-color: var(--c); }
.ob-chip[aria-pressed="false"] { color: var(--text-2); }
.ob-chip[aria-pressed="false"] i { background: #C3CCDB; box-shadow: none; }
.ob-addrow { display: flex; gap: 8px; }
.ob-addrow .field { flex: 1; min-width: 0; }
.ob-count { font-size: 13px; font-weight: 700; color: var(--text-2); }

.ob-opts { display: flex; flex-direction: column; gap: 10px; }
.ob-opt { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; border-radius: 20px; background: var(--surface); border: 2px solid transparent; transition: border-color .15s, background .15s; }
.ob-opt[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-light); }
.ob-oi { width: 46px; height: 46px; border-radius: 14px; background: var(--bg); display: grid; place-items: center; flex: none; color: var(--blue); }
.ob-oi svg { width: 22px; height: 22px; }
.ob-ot { flex: 1; min-width: 0; } .ob-ot b { display: block; font-size: 16px; } .ob-ot small { display: block; font-size: 13px; color: var(--text-2); line-height: 1.5; margin-top: 2px; }
.ob-ck { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface-2); display: grid; place-items: center; flex: none; color: transparent; background: var(--bg); }
.ob-ck svg { width: 15px; height: 15px; stroke-width: 3; }
[aria-pressed="true"] > .ob-ck, [aria-checked="true"] .ob-ck { background: var(--blue); border-color: var(--blue); color: #fff; }

.ob-styles { --w: clamp(150px, calc((100dvh - 400px) * .462), 220px); display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 -24px; padding: 6px calc(50% - var(--w) / 2) 4px; }
.ob-styles::-webkit-scrollbar { display: none; }
.ob-style { flex: none; width: var(--w); scroll-snap-align: center; text-align: left; display: flex; flex-direction: column; gap: 2px; transition: transform .2s, opacity .2s; opacity: .55; transform: scale(.94); }
.ob-style[aria-checked="true"] { opacity: 1; transform: none; }
.ob-shot { position: relative; display: block; border-radius: 20px; padding: 4px; border: 2.5px solid transparent; margin-bottom: 8px; transition: border-color .2s; }
.ob-style[aria-checked="true"] .ob-shot { border-color: var(--blue); }
.ob-shot img { display: block; width: 100%; height: auto; aspect-ratio: 375 / 812; object-fit: cover; border-radius: 15px; background: var(--surface); box-shadow: 0 10px 24px -12px rgba(11,27,77,.45); }
.ob-shot .ob-ck { position: absolute; right: -6px; top: -6px; }
.ob-style b { font-size: 15.5px; } .ob-style small { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.ob-dots { display: flex; justify-content: center; gap: 6px; margin-top: -4px; }
.ob-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--surface-2); transition: width .2s, background .2s; }
.ob-dots i.on { width: 18px; background: var(--blue); }

.ob-done { width: 76px; height: 76px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; margin: 24px 0 4px; box-shadow: 0 16px 30px -12px rgba(10,108,241,.7); }
.ob-done svg { width: 38px; height: 38px; stroke-width: 3; }
.ob-sums { display: flex; flex-direction: column; border-radius: 20px; background: var(--surface); padding: 4px 16px; }
.ob-sum { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; column-gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); min-height: 52px; }
.ob-sum:last-child { border-bottom: 0; }
.ob-sum span { font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.ob-sum b { font-size: 15px; min-width: 0; }
.ob-sum small { grid-column: 2 / -1; font-size: 12.5px; color: var(--text-2); }
.ob-sum img { width: 30px; height: 64px; object-fit: cover; border-radius: 6px; grid-row: 1; grid-column: 3; }
.stylegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stylepick { display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 13px; }
.stylepick img { width: 100%; height: auto; aspect-ratio: 375 / 812; object-fit: cover; border-radius: 12px; border: 3px solid transparent; background: var(--surface); }
.stylepick[aria-pressed="true"] img { border-color: var(--blue); }
.stylepick[aria-pressed="true"] b { color: var(--blue); }
/* จอเตี้ย/แคบ (เช่น 320×640): ย่อปุ่มในแผ่นโน้ตให้พอดี ชื่องานบรรทัดเดียว */
@media (max-height: 700px), (max-width: 340px) {
  .ntitle h2, .tk-a h2 { -webkit-line-clamp: 1; font-size: 22px; }
  .pane-note .lbl { display: none; }
  .pane-note .pills { margin-top: 10px; }
  .pane-note .pill { height: 48px; }
  .pane-note .cta { height: 50px; }
  .cta.slide { height: 56px; } .cta.slide .th { width: 46px; height: 46px; }
  .b6bento { margin-top: 8px; } .bx { min-height: 52px; padding: 7px 12px; } .seg6 .pill { height: 44px; }
}


/* ================= แบบสอบถาม 0.8.2 — หน้าตาเดียวกับหน้าแนะนำ (แนว fastwork.com) =================
   หนึ่งหน้า = คำถามสั้นบรรทัดเดียว + สิ่งที่แตะได้ภาพใหญ่ตรงกลาง + ปุ่มเม็ดยากรมท่า · ไม่มีคำอธิบายรอง
   คำถามโผล่ทีละคำ (เบลอ → ชัด) · ของในหน้าเข้าฉากทีละชิ้น · เปลี่ยนข้อแบบเลื่อน + เบลอ */
.ob { --disp: "Anuphan", "Noto Sans Thai Looped", sans-serif; --ez: cubic-bezier(.2,.8,.2,1); background: #fff; }
.ob::before { content: ""; position: absolute; inset: 0 0 auto; height: 360px; pointer-events: none; background: radial-gradient(70% 80% at 50% 0%, rgba(10,108,241,.07), transparent 70%); }
.ob-top { position: relative; z-index: 2; height: 60px; padding: 0 12px; gap: 14px; }
.ob-back { width: 40px; height: 40px; background: none; }
.ob-back svg { width: 24px; height: 24px; }
.ob-prog { gap: 4px; }
.ob-prog i { height: 3px; border-radius: 2px; background: #E9EDF4; position: relative; overflow: hidden; }
.ob-prog i::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ez); }
.ob-prog i.on { background: #E9EDF4; } .ob-prog i.on::after { transform: none; }
.ob-skip { font: 500 15px var(--disp); color: #8A94A8; padding: 0 8px; }
.ob-body { position: relative; z-index: 1; padding: 6px 24px 8px; display: flex; flex-direction: column; }
.ob-view { flex: 1; min-height: 100%; display: flex; flex-direction: column; gap: 0; animation: obstep2 .6s var(--ez) both; }
.ob-view.rev { animation-name: obstep2r; }
@keyframes obstep2 { from { opacity: 0; transform: translate3d(40px,0,0); filter: blur(10px); } }
@keyframes obstep2r { from { opacity: 0; transform: translate3d(-40px,0,0); filter: blur(10px); } }
.ob-q { font: 600 34px/1.22 var(--disp); letter-spacing: -.03em; margin: 18px 0 0; outline: none; text-wrap: balance; }
.ob-w { display: inline-block; animation: obword .7s var(--ez) both; animation-delay: calc(.08s + var(--k) * 70ms); }
@keyframes obword { from { opacity: 0; transform: translate3d(0,.35em,0); filter: blur(8px); } }
.ob-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px 0 12px; animation: obstage .8s var(--ez) .18s both; }
@keyframes obstage { from { opacity: 0; transform: translate3d(0,24px,0); } }
.ob-foot { padding: 10px 20px calc(16px + var(--safe-b)); background: linear-gradient(180deg, rgba(255,255,255,0), #fff 30%); }
.ob .ob-next { height: 58px; border-radius: 29px; background: var(--ink); color: #fff; font: 600 17px var(--disp); box-shadow: 0 16px 30px -14px rgba(11,27,77,.7); transition: transform .2s, background .3s, color .3s, box-shadow .3s; }
.ob .ob-next:active { transform: scale(.98); }
.ob .ob-next:disabled { background: #F0F2F7; color: #A3ACBF; box-shadow: none; }
.ob-ck { position: absolute; right: 12px; top: 12px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; transform: scale(0); transition: transform .35s var(--ez); }
.ob-ck svg { width: 15px; height: 15px; stroke-width: 3; }
[aria-pressed="true"] > .ob-ck, [aria-checked="true"] .ob-ck { transform: scale(1); background: var(--ink); border-color: var(--ink); color: #fff; }

/* ต้อนรับ */
.ob[data-step="welcome"] .ob-view { justify-content: center; align-items: center; text-align: center; padding-bottom: 4vh; }
.ob[data-step="welcome"] .ob-q { font-size: 38px; line-height: 1.2; margin: 6px 0 0; }
.ob-ln { display: inline-flex; align-items: baseline; white-space: nowrap; }
.ob-hero { position: relative; align-self: stretch; height: 340px; margin: -10px -24px 0; }
.obf { position: absolute; left: var(--x); top: var(--y); width: var(--w); z-index: var(--z, 1); will-change: transform; }
.obf-fl { animation: obfloat var(--fd, 7s) ease-in-out infinite; animation-delay: calc(var(--i) * -1.6s); }
.obf-c { margin: 0; background: #fff; border-radius: 16px; padding: 5px 5px 0; rotate: var(--r, 0deg); text-align: left;
  box-shadow: 0 0 0 1px rgba(11,27,77,.06), 0 24px 40px -22px rgba(11,27,77,.55); animation: obpop .95s var(--ez) both; animation-delay: calc(.12s + var(--i) * 90ms); }
.obf-c img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 11px; background: var(--surface); }
.obf-c figcaption { display: flex; align-items: center; gap: 7px; padding: 7px 2px 8px; }
.obf-b { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 700 7.5px var(--disp); color: var(--c); background: color-mix(in srgb, var(--c) 15%, #fff); box-shadow: 0 0 0 2px #fff, 0 0 0 3px color-mix(in srgb, var(--c) 30%, #fff); }
.obf-tt { flex: 1; min-width: 0; }
.obf-tt b { display: block; font: 600 11.5px/1.3 var(--disp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obf-tt small { display: block; font: 500 10px/1.3 var(--disp); color: var(--text-2); white-space: nowrap; }
.obf-tt small.red { color: var(--error); }
.o1 { --x: -16px; --y: 22px; --w: 122px; --r: -5deg; }
.o2 { --x: calc(50% - 60px); --y: 0px; --w: 120px; --r: 2deg; --z: 2; --fd: 8s; }
.o3 { --x: calc(100% - 112px); --y: 30px; --w: 126px; --r: 5deg; --fd: 9s; }
.o4 { --x: 9%; --y: 150px; --w: 122px; --r: 3deg; --z: 3; --fd: 7.5s; }
.o5 { --x: calc(91% - 122px); --y: 158px; --w: 122px; --r: -4deg; --z: 3; --fd: 8.5s; }
@keyframes obfloat { 0%, 100% { transform: translate3d(0,0,0); } 40% { transform: translate3d(2px,-9px,0); } 75% { transform: translate3d(-2px,-3px,0); } }
@keyframes obpop { from { opacity: 0; transform: translate3d(0,40px,0) scale(.8); filter: blur(8px); } }
.morph { position: relative; display: inline-flex; justify-content: center; margin: 0 .2em; transition: width .6s var(--ez); }
.mw { display: inline-block; white-space: nowrap; padding: 0 .04em; background: linear-gradient(100deg, var(--c1, #0A6CF1), var(--c2, #7C4DFF)); -webkit-background-clip: text; background-clip: text; color: transparent; transition: opacity .35s, filter .45s, transform .5s var(--ez); }
.mdots { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .16em; pointer-events: none; }
.mdots i { width: .13em; height: .13em; border-radius: 50%; background: var(--c1, var(--blue)); opacity: 0; transform: scale(.2); transition: opacity .25s, transform .35s var(--ez); }
.morph.melt .mw { opacity: 0; filter: blur(14px); transform: scale(.35, .7); }
.morph.melt .mdots i { opacity: 1; transform: scale(1); animation: mdot .6s ease-in-out infinite alternate; }
.morph.melt .mdots i:nth-child(2) { animation-delay: .15s; } .morph.melt .mdots i:nth-child(3) { animation-delay: .3s; }
@keyframes mdot { to { transform: translateY(-.18em) scale(.8); } }
.morph.form .mw { transition: none; opacity: 0; filter: blur(14px); transform: scale(1.35, 1.1); }
.mmeas { position: absolute; left: 0; top: 0; visibility: hidden; white-space: nowrap; padding: 0 .04em; pointer-events: none; }

/* 1 · ชื่อ: "สวัสดี ____" ตัวใหญ่ */
.ob-hello { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-bottom: 8vh; }
.ob-av { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font: 600 34px var(--disp); color: #fff; margin-bottom: 18px;
  background: conic-gradient(from 210deg, #0A6CF1, #7C4DFF, #E0457B, #F08A24, #0A6CF1); box-shadow: 0 18px 34px -16px rgba(124,77,255,.7); transform: scale(.85); opacity: .35; transition: transform .5s var(--ez), opacity .4s; }
.ob-av.on { transform: none; opacity: 1; }
.ob-hi { font: 500 40px/1.15 var(--disp); color: #B4BCCB; letter-spacing: -.03em; }
.ob-namebox { display: block; width: 100%; }
.ob-input { width: 100%; border: 0; outline: none; background: none; padding: 0 0 8px; font: 600 48px/1.2 var(--disp); letter-spacing: -.035em; color: var(--ink); border-bottom: 2.5px solid #E3E8F0; border-radius: 0; transition: border-color .3s; caret-color: var(--blue); }
.ob-input::placeholder { color: #D3D9E3; }
.ob-input:focus { border-bottom-color: var(--ink); }

/* 2 · วิชา: ไทล์ 2 คอลัมน์ */
.ob[data-step="subjects"] .ob-stage { justify-content: flex-start; padding-top: 22px; }
.ob-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ob-tile { position: relative; height: 62px; border-radius: 18px; display: flex; align-items: center; gap: 12px; padding: 0 14px; text-align: left;
  background: #fff; border: 1.5px solid #E6EAF1; font: 600 15.5px/1.25 var(--disp); color: #8A94A8; transition: background .25s, border-color .25s, color .25s, transform .15s;
  animation: obrise .6s var(--ez) both; animation-delay: calc(.2s + var(--k, 0) * 40ms); }
@keyframes obrise { from { opacity: 0; transform: translate3d(0,14px,0) scale(.96); } }
.ob-tile:active { transform: scale(.96); }
.ob-tile > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-tile i { width: 26px; height: 26px; border-radius: 9px; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, #fff); color: transparent; transition: background .25s, color .25s, transform .3s var(--ez); }
.ob-tile i svg { width: 15px; height: 15px; stroke-width: 3; }
.ob-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 9%, #fff); border-color: color-mix(in srgb, var(--c) 55%, #fff); color: var(--ink); }
.ob-tile[aria-pressed="true"] i { background: var(--c); color: #fff; transform: rotate(-6deg); }
.ob-tile.add { padding: 0; border-style: dashed; border-color: #D6DCE6; color: #8A94A8; animation-delay: .5s; }
.ob-addbtn { display: flex; align-items: center; gap: 10px; width: 100%; height: 100%; padding: 0 14px; font: 600 15.5px var(--disp); color: inherit; }
.ob-addbtn svg { width: 22px; height: 22px; }
.ob-addin { display: none; width: 100%; height: 100%; border: 0; outline: none; background: none; padding: 0 14px; font: 600 15.5px var(--disp); color: var(--ink); }
.ob-tile.add.typing { border-style: solid; border-color: var(--ink); }
.ob-tile.add.typing .ob-addbtn { display: none; } .ob-tile.add.typing .ob-addin { display: block; }

/* 3 & 5 · การ์ดภาพใหญ่ */
.ob-pair { display: flex; flex-direction: column; gap: 12px; }
.ob-pair.side { flex-direction: row; }
.ob-pair.side .ob-big { flex: 1; min-width: 0; }
.ob-big { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 14px; border-radius: 26px; text-align: left;
  background: #fff; border: 1.5px solid #E6EAF1; box-shadow: 0 18px 36px -28px rgba(11,27,77,.5); transition: border-color .25s, box-shadow .3s, transform .2s; animation: obrise .7s var(--ez) both; }
.ob-big + .ob-big { animation-delay: .1s; }
.ob-big:active { transform: scale(.98); }
.ob-big[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(11,27,77,.07), 0 24px 40px -26px rgba(11,27,77,.65); }
.ob-big .ob-ot b { display: block; font: 600 17px/1.3 var(--disp); color: var(--ink); padding: 0 4px 2px; }
.ob-big.dark { background: var(--ink); border-color: var(--ink); }
.ob-big.dark .ob-ot b { color: #fff; }
.ob-big.dark[aria-pressed="true"] { box-shadow: 0 0 0 4px rgba(10,108,241,.35), 0 24px 40px -22px rgba(11,27,77,.8); }
.ob-big.dark .ob-ck { background: #fff; color: var(--ink); }
.ob-art { position: relative; height: 112px; border-radius: 18px; overflow: hidden; display: flex; }
.ob-art.talk { align-items: center; gap: 14px; padding: 0 18px; background: radial-gradient(80% 120% at 20% 50%, rgba(10,108,241,.45), transparent 70%), #12245F; }
.ob-mic { width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--blue); color: #fff; box-shadow: 0 0 0 0 rgba(10,108,241,.6); animation: obmic 1.8s infinite; }
.ob-mic svg { width: 24px; height: 24px; }
@keyframes obmic { 70% { box-shadow: 0 0 0 14px rgba(10,108,241,0); } 100% { box-shadow: 0 0 0 0 rgba(10,108,241,0); } }
.ob-bars { flex: 1; display: flex; align-items: center; gap: 4px; height: 56px; }
.ob-bars i { flex: 1; height: 24%; border-radius: 3px; background: #fff; opacity: .9; animation: obbar 1s ease-in-out infinite alternate; animation-delay: calc(var(--k) * -.13s); }
.ob-bars i:nth-child(3n) { animation-duration: .7s; } .ob-bars i:nth-child(4n+1) { animation-duration: 1.3s; }
@keyframes obbar { to { height: 100%; } }
.ob-art.board { flex-direction: column; justify-content: center; gap: 2px; padding: 0 20px; background: linear-gradient(118deg, #fff 30%, #F2F5F9 55%, #fff 70%), #fff; box-shadow: inset 0 0 0 7px #E4E8EE, inset 0 0 0 8px #D2D8E1;
  font: 500 19px/1.35 var(--hand); color: #1D45C8; }
.ob-art.board span:first-child { font-size: 22px; color: #23293A; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.ob-art.board .r { color: #D8342C; }
.ob-art.stack { flex-direction: column; justify-content: center; gap: 8px; padding: 0 14px; background: linear-gradient(135deg, #EEF4FF, #F5F0FF); }
.ob-art.stack i { height: 24px; border-radius: 8px; background: #fff; box-shadow: 0 6px 12px -8px rgba(11,27,77,.4); position: relative; }
.ob-art.stack i::before { content: ""; position: absolute; left: 6px; top: 6px; width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.ob-art.stack i::after { content: ""; position: absolute; left: 26px; top: 9px; height: 6px; width: calc(var(--w) - 30px); border-radius: 3px; background: #DCE2EC; }
.ob-art.empty { align-items: center; justify-content: center; background: #fff; border: 2px dashed #D6DCE6; color: #A3ACBF; }
.ob-art.empty svg { width: 34px; height: 34px; }
.ob-pair.side .ob-art { height: 150px; }

/* 4 · หน้าโน้ต */
.ob-styles { --w: clamp(150px, calc((100dvh - 330px) * .462), 236px); margin: 0 -24px; padding: 6px calc(50% - var(--w) / 2) 4px; }
.ob-style { align-items: center; text-align: center; gap: 0; opacity: .5; transform: scale(.9); transition: transform .45s var(--ez), opacity .35s; }
.ob-style[aria-checked="true"] { opacity: 1; transform: none; }
.ob-shot { border: 0; padding: 0; margin-bottom: 12px; border-radius: 22px; }
.ob-shot img { border-radius: 22px; box-shadow: 0 0 0 1px rgba(11,27,77,.08), 0 26px 44px -24px rgba(11,27,77,.6); }
.ob-style[aria-checked="true"] .ob-shot { border: 0; }
.ob-shot .ob-ck { right: -8px; top: -8px; }
.ob-style b { font: 600 16px var(--disp); }
.ob-style small { display: none; }
.ob-dots { margin-top: 14px; }
.ob-dots i.on { background: var(--ink); }

/* เสร็จ: ภาพจอที่เลือก + ชิปวิชาลอยรอบ ๆ */
.ob[data-step="done"] .ob-view { align-items: center; text-align: center; }
.ob[data-step="done"] .ob-stage { align-self: stretch; }
.ob[data-step="done"] .ob-q { font-size: 38px; }
.ob-final { position: relative; width: 100%; height: min(50dvh, 400px); margin: 0 auto; }
.ob-phone { position: absolute; left: 50%; top: 50%; height: 100%; aspect-ratio: 375 / 812; transform: translate(-50%, -50%) rotate(-4deg); animation: obphone 1s var(--ez) both .15s; }
.ob-phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 26px; border: 5px solid #fff; box-shadow: 0 0 0 1px rgba(11,27,77,.08), 0 40px 60px -30px rgba(11,27,77,.7); }
@keyframes obphone { from { opacity: 0; transform: translate(-50%, -40%) rotate(4deg) scale(.85); filter: blur(8px); } }
.ob-fchip { position: absolute; top: var(--y); z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px 0 10px; border-radius: 17px; background: #fff;
  font: 600 13px var(--disp); white-space: nowrap; box-shadow: 0 0 0 1px rgba(11,27,77,.06), 0 14px 24px -14px rgba(11,27,77,.55); animation: obchip .8s var(--ez) both; animation-delay: calc(.45s + var(--k) * 70ms); }
.ob-fchip.l { left: 0; rotate: -4deg; } .ob-fchip.r { right: 0; rotate: 4deg; }
.ob-fchip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
@keyframes obchip { from { opacity: 0; transform: scale(.4); } }
.ob-done, .ob-sums, .ob-why, .ob-k, .ob-sub, .ob-count { display: none; }

@media (max-height: 720px) {
  .ob-q { font-size: 30px; margin-top: 8px; } .ob[data-step="welcome"] .ob-q { font-size: 32px; }
  .ob-hero { height: 250px; } .o1, .o2, .o3 { --w: 104px; } .o4, .o5 { --y: 116px; --w: 104px; }
  .ob-tile { height: 52px; } .ob-art { height: 84px; } .ob-pair.side .ob-art { height: 110px; }
  .ob-hi { font-size: 32px; } .ob-input { font-size: 38px; } .ob-av { width: 60px; height: 60px; font-size: 26px; margin-bottom: 10px; }
}
@media (max-height: 620px) { .ob-hero { height: 150px; } .o4, .o5 { display: none; } }
@media (max-width: 340px) { .ob-tile { padding: 0 10px; gap: 9px; font-size: 14px; } .ob-tile i { width: 22px; height: 22px; } .ob-q { font-size: 29px; } }
@media (min-width: 480px) { .o1 { --x: 2%; } .o3 { --x: calc(98% - 140px); } }
@media (prefers-reduced-motion: reduce) {
  .ob-view, .ob-w, .ob-stage, .ob-tile, .ob-big, .obf-fl, .obf-c, .ob-phone, .ob-fchip, .ob-mic, .ob-bars i { animation: none !important; }
}

/* มาจากหน้าแนะนำ: ม่านขาวต่อจากวงขาวของหน้าแนะนำ ค้างไว้จนแบบสอบถามขึ้น แล้วจางออก */
html.arrive body::after { content: ""; position: fixed; inset: 0; z-index: 54; background: #fff; pointer-events: none; animation: arrive .5s ease .45s forwards; }
html.arrive .ob { animation: arrive-in .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes arrive { to { opacity: 0; visibility: hidden; } }
@keyframes arrive-in { from { opacity: 0; transform: scale(.985); } }
@media (prefers-reduced-motion: reduce) { html.arrive body::after { animation-duration: .01s; animation-delay: 0s; } }

/* ================= โหมดโบกมือ (features/handsfree.js · gesture/hand.js) ================= */
#note-hand, #note-clock { right: 16px; top: calc(12px + env(safe-area-inset-top, 0px)); }
#note-hand[aria-pressed="true"] { background: var(--blue) !important; color: #fff !important; border-color: var(--blue) !important; }
body.hf-on .pager { top: calc(160px + env(safe-area-inset-top, 0px)); }
.hf { position: fixed; z-index: 16; right: 14px; top: calc(64px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; align-items: center; gap: 6px; animation: hfin .4s cubic-bezier(.2,.8,.2,1) both; }
.hf.out { opacity: 0; transform: scale(.8); transition: opacity .2s, transform .25s; }
@keyframes hfin { from { opacity: 0; transform: translateY(-8px) scale(.85); } }
.hf-cam { position: relative; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; background: #0B1B4D; box-shadow: 0 10px 24px -8px rgba(11,27,77,.5); }
.hf-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.hf[data-state="loading"] .hf-cam::after, .hf:not([data-state]) .hf-cam::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--blue); animation: hfspin .9s linear infinite; }
@keyframes hfspin { to { transform: rotate(360deg); } }
.hf[data-state="ready"] .hf-cam { border-color: var(--blue); }
.hf-st { font-size: 11px; font-weight: 700; background: rgba(11,27,77,.78); color: #fff; border-radius: 999px; padding: 3px 9px; white-space: nowrap; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hf-dot { position: fixed; z-index: 17; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, #fff 0 22%, rgba(10,108,241,.95) 26% 48%, rgba(10,108,241,0) 72%); transition: opacity .2s, transform .09s linear; }
.hf-dot.on { opacity: 1; }
.hf-flash { position: fixed; z-index: 17; left: 50%; top: 38%; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%; pointer-events: none; opacity: 0;
  background: rgba(11,27,77,.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); --tx: 0px; --ty: 0px; --r: -45deg; }
.hf-flash::before { content: ""; position: absolute; inset: 0; margin: auto; width: 24px; height: 24px; border-right: 5px solid #fff; border-bottom: 5px solid #fff; border-radius: 3px; transform: translate(-3px, 0) rotate(var(--r)); }
.hf-flash[data-dir="right"] { --tx: 34px; --r: -45deg; } .hf-flash[data-dir="left"] { --tx: -34px; --r: 135deg; }
.hf-flash[data-dir="up"] { --ty: -34px; --r: -135deg; } .hf-flash[data-dir="down"] { --ty: 34px; --r: 45deg; }
.hf-flash.go { animation: hfflash .55s cubic-bezier(.2,.8,.2,1); }
@keyframes hfflash { 0% { opacity: 0; transform: scale(.7); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(.95); } }
@media (prefers-reduced-motion: reduce) { .hf-flash.go { animation-duration: .3s; } .hf-dot { transition: opacity .2s; } }

/* ================= 0.9 หน้างาน + หน้าฉัน — ชุดเดียวกับหน้าแนะนำ/แบบสอบถาม (Anuphan · กรมท่า · รูปจริง · ข้อความน้อย) ================= */
:root { --disp: "Anuphan", "Noto Sans Thai Looped", sans-serif; }
.phead h1 { font: 600 32px/1.2 var(--disp); letter-spacing: -.03em; }
.monthchip { background: #fff; color: var(--ink); border: 1.5px solid #E3E8F0; padding: 7px 10px 7px 14px; font: 600 14px var(--disp); }
.iconbtn { background: #fff; box-shadow: inset 0 0 0 1.5px #E3E8F0; }
/* ปฏิทิน: แถบสัปดาห์โล่ง ๆ วันนี้เป็นกรมท่า */
.cal { background: none; padding: 4px 0 0; }
.dow span { font: 500 12px var(--disp); }
.days { gap: 4px; }
.day { background: none; border-radius: 16px; font: 600 17px Inter, sans-serif; max-height: 52px; }
.day.today { background: var(--ink); color: #fff; box-shadow: 0 10px 18px -10px rgba(11,27,77,.8); }
.day.sel { background: #fff; box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); }
.day .dots { position: absolute; bottom: 4px; margin: 0; }
.cal .bar { width: 36px; height: 4px; background: #E3E8F0; margin: 6px auto 2px; }
.cal .foot { font-family: var(--disp); }
.filters { margin: 12px 0 4px; }
.filters button { background: #fff; box-shadow: inset 0 0 0 1.5px #E3E8F0; color: var(--text-2); font: 600 14px var(--disp); padding: 8px 15px; }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
/* งานเรียงตามวัน */
.tl, .daylist { margin-top: 6px; }
.daylist h3 { font: 600 14px var(--disp); color: var(--text-2); margin: 12px 0 2px; }
.tl-day { display: flex; align-items: center; gap: 8px; font: 600 13.5px var(--disp); color: var(--text-2); margin: 16px 0 2px; }
.tl-day::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.ti { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 0; text-align: left; }
.ti:active { opacity: .7; }
.ti .th { width: 48px; height: 48px; border-radius: 14px; flex: none; background: center/cover var(--surface); box-shadow: 0 0 0 1px rgba(11,27,77,.06); }
.ti .th.sub { display: grid; place-items: center; font: 700 12px var(--disp); color: var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); box-shadow: none; }
.ti .tx { flex: 1; min-width: 0; }
.ti b { display: block; font: 600 16px/1.3 var(--disp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ti small { display: block; font: 400 13px var(--disp); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ti small em { font-style: normal; color: var(--error); font-weight: 600; }
.ti.done b { text-decoration: line-through; color: var(--text-2); }
.ti.exam { margin: 4px 0; padding: 12px 14px; border-radius: 18px; background: linear-gradient(120deg, #FFF1EF, #FFF8F2); box-shadow: inset 0 0 0 1.5px #FBD3CD; }
.ti.exam .cd { width: 52px; height: 52px; border-radius: 16px; flex: none; background: var(--error); color: #fff; display: grid; place-content: center; text-align: center; font: 600 10.5px/1.1 var(--disp); }
.ti.exam .cd b { font: 700 22px/1 Inter, sans-serif; white-space: normal; overflow: visible; }
.ti.exam .cd b:only-child { font: 600 14px var(--disp); }
/* วิชา: เลื่อนข้าง ปกรูปจริง */
.sec2 { font: 600 15px var(--disp); color: var(--text-2); margin: 26px 0 10px; }
.subrow { display: flex; gap: 10px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.subrow::-webkit-scrollbar { display: none; }
.subrow .proj { position: relative; flex: none; width: 132px; height: 156px; padding: 0; border-radius: 22px; overflow: hidden; display: block; color: #fff; background: center/cover #1A2347; scroll-snap-align: start; text-align: left; }
.subrow .proj::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(5,10,30,.78)); }
.subrow .proj.plain { background: linear-gradient(150deg, color-mix(in srgb, var(--c) 78%, #fff), var(--c)); }
.subrow .proj.plain::after { background: none; }
.subrow .proj .big { position: absolute; left: 10px; top: 6px; right: -40px; font: 700 50px/1 var(--disp); letter-spacing: -.04em; opacity: .24; white-space: nowrap; }
.subrow .proj b, .subrow .proj small { position: absolute; z-index: 1; left: 12px; right: 10px; padding: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subrow .proj b { bottom: 27px; font: 600 16px var(--disp); }
.subrow .proj small { bottom: 10px; font: 500 12px var(--disp); color: rgba(255,255,255,.85); }
.subrow .proj.new { background: #fff; color: var(--text-2); border: 2px dashed #D6DCE6; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font: 600 14px var(--disp); }
.subrow .proj.new::after { display: none; }
.subrow .proj.new svg { width: 26px; height: 26px; }
.empty-note { font-family: var(--disp); }

/* หน้าฉัน */
/* หน้าฉัน (ยกระดับ 26 พ.ย.) — หัววงรุ้ง + ชื่อไล่สีชุดเดียวกับหน้าแรก · ไฟต่อเนื่อง · การ์ดกรมท่า · ไอคอนสีพาสเทล · เร็ว ๆ นี้เป็นการ์ดเล็ก */
.mehero { display: flex; align-items: center; gap: 16px; padding-top: 8px; }
.mavatar { position: relative; flex: none; width: 76px; height: 76px; border-radius: 50%; padding: 3px; background: conic-gradient(from 210deg, #0A6CF1, #7C4DFF, #E0457B, #F08A24, #0A6CF1); box-shadow: 0 12px 24px -12px rgba(124,77,255,.6); }
.mavatar > span { position: relative; overflow: hidden; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; border: 3px solid #fff; background: linear-gradient(140deg, #EEF3FF, #FBEFF6); font: 700 30px/1 var(--disp); color: var(--ink); }
.mavatar > i { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; border: 2.5px solid #fff; }
.mavatar > i svg { width: 12px; height: 12px; }
.mavatar:active { transform: scale(.96); }
.mh-t { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.mh-name { max-width: 100%; text-align: left; font: 700 28px/1.2 var(--disp); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: linear-gradient(100deg, #6F7CF6, #A07BF2 35%, #E58FB4 65%, #F2A97A); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 2px; }
.mh-name.unset { color: var(--text-2); background: none; font-size: 22px; text-decoration: underline dashed #C9D1E0; text-underline-offset: 6px; }
.mh-t > small { font: 500 14px var(--disp); color: var(--text-2); }
.streak { margin-top: 4px; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px 0 8px; border-radius: 14px; font: 700 13px var(--disp); color: #B54708; background: linear-gradient(90deg, #FFF1DC, #FFE6E0); box-shadow: inset 0 0 0 1px rgba(240,138,36,.25); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.streak svg { width: 15px; height: 15px; flex: none; color: #F0702A; fill: #FFB547; }
.streak.zero { color: var(--text-2); background: var(--surface); box-shadow: none; font-weight: 600; }
.streak.zero svg { color: #A3ACBF; fill: none; }

.mecard { position: relative; overflow: hidden; margin-top: 20px; border-radius: 28px; padding: 20px 18px 16px; color: #fff;
  background: radial-gradient(120% 80% at 100% 0%, #1E3FA8 0%, transparent 55%), radial-gradient(90% 70% at 0% 100%, #2A1D6E 0%, transparent 60%), var(--ink);
  box-shadow: 0 22px 40px -22px rgba(11,27,77,.8); }
.mecard::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 1px 0 rgba(255,255,255,.14); pointer-events: none; }
.mc-top { position: relative; display: flex; align-items: center; gap: 16px; }
.mecard .ring { position: relative; width: 84px; height: 84px; flex: none; }
.mecard .ring .rs, .mecard .ring svg { position: absolute; inset: 0; width: 100%; height: 100%; } .mecard .ring svg { transform: rotate(-90deg); fill: none; }
.mecard .ring circle { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 9; }
.mecard .ring circle.on { stroke: url(#me-rg); stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1) .15s; filter: drop-shadow(0 0 6px rgba(127,176,255,.55)); }
.mecard .ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 19px Inter, sans-serif; }
.mc-top small { font: 500 14px var(--disp); color: rgba(255,255,255,.65); }
.mc-top strong { display: block; font: 600 21px/1.3 var(--disp); }
.mc-top .mc-left { color: #9CC3FF; }
.mecard .week { position: relative; display: flex; gap: 8px; height: 104px; margin-top: 18px; }
.mecard .wcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.mecard .wbar { position: relative; flex: 1; width: 100%; max-width: none; display: flex; align-items: flex-end; border-radius: 9px; background: rgba(255,255,255,.06); }
.mecard .wbar i { position: relative; display: block; width: 100%; border-radius: 9px; background: rgba(255,255,255,.3); transform-origin: bottom; animation: mbar .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--k) * 45ms + .1s); }
.mecard .wbar i.none { height: 6px; background: rgba(255,255,255,.14); margin: 0 auto 0; width: 6px; border-radius: 3px; position: absolute; left: calc(50% - 3px); bottom: 6px; animation: none; }
.mecard .wcol.today .wbar { background: rgba(127,176,255,.12); box-shadow: inset 0 0 0 1px rgba(127,176,255,.35); }
.mecard .wcol.today .wbar i { background: linear-gradient(180deg, #9CC3FF, #3D7DFF); box-shadow: 0 6px 18px -4px rgba(76,141,255,.8); }
.mecard .wbar em { position: absolute; left: 0; right: 0; top: 4px; text-align: center; font: 700 11.5px Inter, sans-serif; font-style: normal; color: #fff; }
.mecard .wcol > span { font: 500 11px var(--disp); color: rgba(255,255,255,.5); white-space: nowrap; }
.mecard .wcol.today > span { color: #fff; font-weight: 700; }
@keyframes mbar { from { transform: scaleY(0); } }
.mecard .stats { position: relative; margin: 16px 0 0; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.12); gap: 6px; }
.mecard .stat { background: none; padding: 10px 4px 6px; border-radius: 16px; color: inherit; transition: background .15s; }
.mecard .stat:active { background: rgba(255,255,255,.08); }
.mecard .stat b { font: 700 26px Inter, sans-serif; color: #fff; }
.mecard .stat small { display: block; font: 500 12px/1.35 var(--disp); color: rgba(255,255,255,.6); }
.mecard .stat.r b { color: #FF8A80; }

.msec { font: 700 13px var(--disp); color: #8A94A8; letter-spacing: .02em; margin: 24px 6px 8px; }
.mlist { margin-top: 0; border-radius: 22px; background: #fff; box-shadow: inset 0 0 0 1.5px #EDF0F5; padding: 0 14px; }
.list-btn { padding: 13px 0; font: 600 15.5px var(--disp); border-bottom-color: #EEF1F6; }
.mlist .list-btn:last-child { border-bottom: 0; }
.list-btn .mi { width: 36px; height: 36px; border-radius: 12px; background: var(--mb, var(--surface)); color: var(--mc, currentColor); display: grid; place-items: center; flex: none; }
.list-btn .mi svg { width: 18px; height: 18px; }
.list-btn .lv { font-family: var(--disp); }
.mlist .list-btn:active { background: linear-gradient(90deg, transparent, #F5F7FB 12%, #F5F7FB 88%, transparent); }
#page .mout { margin-top: 24px; }
.mthumb { width: 26px; height: 44px; border-radius: 6px; object-fit: cover; box-shadow: 0 0 0 1px rgba(11,27,77,.1), 0 4px 8px -4px rgba(11,27,77,.35); }
.mrow-seg { cursor: default; }
.mrow-seg .lk { min-width: 0; }
.mseg { display: inline-flex; flex: none; padding: 3px; border-radius: 12px; background: var(--surface); }
.mseg button { height: 32px; padding: 0 12px; border-radius: 9px; font: 600 13.5px var(--disp); color: var(--text-2); transition: background .2s, color .2s, box-shadow .2s; white-space: nowrap; }
.mseg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(11,27,77,.12), 0 0 0 1px rgba(11,27,77,.05); }
.studycard { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-radius: 22px; background: linear-gradient(135deg, #0A6CF1, #3B8BFF); color: #fff; box-shadow: 0 10px 24px -14px rgba(10,108,241,.8); }
.studycard:active { transform: scale(.98); }
.studycard .sc-i { width: 40px; height: 40px; border-radius: 13px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.studycard .sc-i svg { width: 20px; height: 20px; }
.studycard .sc-t { flex: 1; min-width: 0; }
.studycard .sc-t b { display: block; font: 700 15.5px/1.3 var(--disp); }
.studycard .sc-t small { display: block; margin-top: 2px; font: 500 12.5px/1.4 var(--disp); color: rgba(255,255,255,.82); }
.studycard .sc-go { flex: none; padding: 8px 12px; border-radius: 12px; background: #fff; color: #0A6CF1; font: 700 13.5px var(--disp); white-space: nowrap; }
.studycard.done { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px #EDF0F5; }
.studycard.done .sc-i { background: #E3F6EC; color: #1E8A52; }
.studycard.done .sc-t small { color: var(--text-2); }
.studycard.done .sc-go { background: var(--surface); color: var(--ink); }
.studysheet { position: fixed; inset: 0; z-index: 58; display: flex; flex-direction: column; background: #fff; transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.studysheet.show { transform: none; }
.studysheet .ss-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px 18px; border-bottom: 1px solid #EEF1F6; font: 700 16px var(--disp); }
.studysheet iframe { flex: 1; width: 100%; border: 0; }
@media (prefers-reduced-motion: reduce) { .studysheet { transition: none; } }
.study-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; } .study-share > * { flex: 1 1 auto; text-align: center; }
.msoon { color: #A3ACBF; }
.soon-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.soon-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px; min-height: 104px; border-radius: 18px; background: #F7F9FC; border: 1.5px dashed #DCE2EC; }
.soon-tile .si { width: 32px; height: 32px; border-radius: 10px; background: #fff; display: grid; place-items: center; color: #8A94A8; margin-bottom: auto; box-shadow: 0 1px 3px rgba(11,27,77,.08); }
.soon-tile .si svg { width: 16px; height: 16px; }
.soon-tile b { margin-top: 10px; font: 700 13.5px/1.25 var(--disp); color: #5E6B85; }
.soon-tile small { font: 500 11.5px var(--disp); color: #A3ACBF; }
.soon-tile:active { transform: scale(.97); }
#page .mfoot { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; margin-top: 28px; padding: 10px; font: 500 13px var(--disp); color: #8A94A8; }
#page .mfoot b { color: var(--ink); font-weight: 700; }
.mfoot small { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #A3ACBF; }
.mfoot small svg { width: 12px; height: 12px; }
@media (max-width: 360px) {
  .mehero { gap: 12px; } .mavatar { width: 64px; height: 64px; } .mavatar > span { font-size: 26px; } .mh-name { font-size: 24px; }
  .mseg button { padding: 0 9px; font-size: 12.5px; } .mrow-seg .lk { font-size: 14px; }
  .soon-tile { padding: 10px; min-height: 96px; } .soon-tile b { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) { .mecard .wbar i { animation: none; } .mecard .ring circle.on { transition: none; } }

/* ================= 0.9.2 หน้าแรก — โครงเดิม (หัวเรื่อง · เพิ่มงาน 4 แบบ · ค้นหา · รายการ) หน้าตาชุดเดียวกับหน้าแนะนำ ================= */
.pane-home .brandrow { margin: 2px 0 2px; }
.hdate { font: 500 14px var(--disp); color: var(--text-2); }
.avatar.grad { width: 38px; height: 38px; color: #fff; font: 600 16px var(--disp); background: conic-gradient(from 210deg, #0A6CF1, #7C4DFF, #E0457B, #F08A24, #0A6CF1); }
.pane-home h1.big { font: 600 32px/1.2 var(--disp); letter-spacing: -.03em; margin: 6px 0 16px; }
.pane-home h1.big .g { color: #B4BCCB; font-weight: 500; }
/* ปุ่มเพิ่มงาน 4 แบบ: การ์ดสีพาสเทลไล่ (ชุดเดียวกับการ์ดจุดเด่นของหน้าแนะนำ) · ไอคอนในวงขาว */
.tiles { gap: 10px; }
.tile { position: relative; overflow: hidden; min-height: 122px; border-radius: 24px; align-items: flex-start; justify-content: flex-end; text-align: left; padding: 14px 16px; gap: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), 0 14px 26px -22px rgba(11,27,77,.6); transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .2s; }
.tile[data-art="speak"] { background: radial-gradient(90% 90% at 100% 0%, #D9E7FF, transparent 60%), linear-gradient(150deg, #EEF4FF, #E3EDFF); }
.tile[data-art="attach"] { background: radial-gradient(90% 90% at 100% 0%, #EADFFF, transparent 60%), linear-gradient(150deg, #F5F0FF, #EDE5FF); }
.tile[data-art="type"] { background: radial-gradient(90% 90% at 100% 0%, #D8F5E6, transparent 60%), linear-gradient(150deg, #EFFBF4, #E2F6EB); }
.tile[data-art="shoot"] { background: radial-gradient(90% 90% at 100% 0%, #FFE3D1, transparent 60%), linear-gradient(150deg, #FFF4EC, #FFEADB); }
.tile:active { transform: scale(.97); background-color: transparent; }
.tile .ti-ic { position: absolute; left: 14px; top: 14px; width: 48px; height: 48px; border-radius: 16px; background: #fff; display: grid; place-items: center; box-shadow: 0 10px 18px -12px rgba(11,27,77,.45); }
.tile .ti-ic svg { width: 30px; height: 30px; margin: 0; }
.tile b { font: 600 18px/1.2 var(--disp); color: var(--ink); }
.tile small { font: 400 12.5px/1.35 var(--disp); color: var(--text-2); margin-top: 2px; }
.tile::after { content: ""; position: absolute; right: 14px; top: 16px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B1B4D' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center/14px no-repeat; }
/* ค้นหา */
.pane-home .search { margin-top: 12px; min-height: 50px; background: #fff; box-shadow: inset 0 0 0 1.5px #E6EAF1; border-radius: 18px; }
.pane-home .search input { font: 500 16px var(--disp); }
.pane-home .search input::placeholder { color: var(--text-2); opacity: .75; }
.pane-home .search .chip { font-family: var(--disp); }
/* รายการ: การ์ดบาง · รูปย่อจากโน้ตจริง · ปุ่มวงกลมเล็ก */
.pane-home .sec { margin: 20px 0 8px; }
.pane-home .sec h2 { font: 600 17px var(--disp); }
.pane-home .sec span { font-family: var(--disp); }
.pane-home .tlist { display: flex; flex-direction: column; gap: 8px; }
.pane-home .trow { padding: 10px 10px 10px 10px; border-radius: 20px; background: #fff; box-shadow: 0 0 0 1px #EDF0F5, 0 12px 24px -22px rgba(11,27,77,.6); }
.pane-home .trow .badge { width: 50px; height: 50px; border-radius: 15px; font-family: var(--disp); }
.pane-home .thumb { width: 50px; height: 50px; border-radius: 15px; flex: none; background: center/cover var(--surface); box-shadow: 0 0 0 1px rgba(11,27,77,.06); }
img.thumb, img.th { display: block; object-fit: cover; }
.boot-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
html.booting #sheet { height: 100dvh; transition: none; }
html.booting #nav { visibility: hidden; }
.boot-home .boot-bar, .boot-home .avatar, .boot-home .boot-heading,
.boot-home .tile, .boot-home .search, .boot-home .trow { background: var(--surface); }
.boot-home .boot-bar { display: block; width: 88px; height: 14px; border-radius: 8px; }
.boot-home .avatar { display: block; width: 38px; height: 38px; border-radius: 50%; }
.boot-home .boot-heading { width: 64%; height: 38px; border-radius: 12px; margin: 6px 0 16px; }
.boot-home .tile { animation: none; box-shadow: none; }
.boot-home .tile::after { display: none; }
.boot-home .search { display: block; box-shadow: none; }
.boot-home .trow { min-height: 70px; box-shadow: none; }
.lg-card .lg-stack img { background-size: cover; background-position: center; }
.pane-home .trow b { font: 600 16px/1.3 var(--disp); }
.pane-home .trow small { font: 400 13px var(--disp); }
.pane-home .tag { font-family: var(--disp); }
.pane-home .go { width: 40px; height: 40px; padding: 0; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1.5px #DCE2EC; display: grid; place-items: center; }
.pane-home .go i { border-left: 10px solid var(--ink); border-top: 6.5px solid transparent; border-bottom: 6.5px solid transparent; margin-left: 3px; }
.pane-home .go.doing { width: auto; padding: 0 12px; border-radius: 20px; background: var(--blue-light); color: var(--blue); box-shadow: none; font: 600 13px var(--disp); }
.pane-home .empty-note { font-family: var(--disp); }
/* เข้าหน้าแรก: ของในหน้าค่อย ๆ ขึ้นทีละชิ้น */
.pane-home .tile { animation: hrise .7s cubic-bezier(.2,.8,.2,1) both; }
.pane-home .tile:nth-child(2) { animation-delay: .05s; } .pane-home .tile:nth-child(3) { animation-delay: .1s; } .pane-home .tile:nth-child(4) { animation-delay: .15s; }
@keyframes hrise { from { opacity: 0; transform: translate3d(0,14px,0); filter: blur(6px); } }
@media (prefers-reduced-motion: reduce) { .pane-home .tile { animation: none; } }
@media (max-height: 700px) { .tile { min-height: 100px; } .tile .ti-ic { width: 40px; height: 40px; } .tile .ti-ic svg { width: 24px; height: 24px; } .pane-home h1.big { font-size: 28px; margin-bottom: 12px; } }
/* ดึงแผ่นแบบ Bolt — ความลึก: โน้ตด้านหลังย่อ + มืดตอนแผ่นเต็มจอ แล้วขยายเต็มเมื่อดึงลง (--pull: 0 = แผ่นเต็มจอ · 1 = ดึงลงสุด) */
#stage { transform-origin: 50% 32%; transition: transform .34s cubic-bezier(.2,.8,.2,1); will-change: transform; } /* JS ใส่ transform/opacity ตรงที่ชิ้นเอง */
#stage-dim { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: #0B1B4D; opacity: 0; transition: opacity .34s cubic-bezier(.2,.8,.2,1); will-change: opacity; }
#sheet.dragging ~ #stage-dim, body:has(#sheet.dragging) #stage, body:has(#sheet.dragging) #stage-dim { transition: none; }
#sheet .pane { transform: translate3d(0, calc(-1 * var(--over, 0px)), 0); transition: opacity .2s, transform .45s cubic-bezier(.2,.8,.2,1.4); }
#sheet.dragging .pane { transition: opacity .2s; }
.grab .hint { transition: opacity .2s, color .2s; }
#sheet.dragging .grab .hint { color: var(--ink); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { #stage, #stage-dim, #sheet .pane { transition: none; } }

/* ================= 0.9.3 ปุ่มเพิ่มงาน 4 แบบ: ภาพเล่าเรื่องในแต่ละกล่อง ================= */
.tile { min-height: 148px; padding: 0 16px 14px; justify-content: flex-end; }
.tile::after { display: none; }
.tile .ta { position: absolute; left: 0; right: 0; top: 0; height: 84px; pointer-events: none; }
.tile b { position: relative; z-index: 1; }
.tile small { position: relative; z-index: 1; }
/* พูด (0.9.6): เครื่องอัดเสียง — พื้นน้ำเงินแอปเรียบไม่มีแสงเรือง · จุดแดงอัด + เวลาเดิน · คลื่นเส้นบางไหลเข้าหัวอ่าน · ไมค์วงเล็กมุมขวาแบบกล่องถ่ายรูป */
.tile[data-art="speak"] { background: #1450D8; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 16px 26px -18px rgba(20,80,216,.75); }
.tile[data-art="speak"] b { color: #fff; } .tile[data-art="speak"] small { color: rgba(255,255,255,.75); }
.ta-rec { position: absolute; left: 16px; top: 19px; display: flex; align-items: center; gap: 7px; font: 600 12.5px var(--disp); color: rgba(255,255,255,.9); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.ta-rec i { width: 8px; height: 8px; border-radius: 50%; background: #FF4D4D; animation: tarec 1.4s ease-in-out infinite; }
@keyframes tarec { 50% { opacity: .25; } }
.ta-speak .ti-ic { position: absolute; left: auto; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; box-shadow: none; }
.ta-speak .ti-ic svg { width: 18px; height: 18px; }
.ta-wave { position: absolute; left: 0; right: 26%; top: 52px; height: 30px; overflow: hidden;
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 22%); mask: linear-gradient(90deg, transparent 0, #000 22%); }
.ta-strip { position: absolute; right: 3px; top: 0; bottom: 0; display: flex; align-items: center; gap: 3px; animation: tastrip 7s linear infinite; }
.ta-strip i { width: 2px; flex: none; height: calc(8% + var(--a) * 92%); border-radius: 1px; background: rgba(255,255,255,.82); }
@keyframes tastrip { from { transform: translateX(50%); } to { transform: translateX(0); } }
.ta-head { position: absolute; right: calc(26% - 1px); top: 48px; height: 38px; width: 1.5px; background: #FF4D4D; }
.ta-head::before { content: ""; position: absolute; left: 50%; top: -1px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #FF4D4D; }
/* แนบรูป: รูปจริง 3 ใบซ้อนกัน */
.ta-attach i { position: absolute; top: 12px; width: 58px; height: 62px; border-radius: 10px; background: center/cover #ddd; border: 3px solid #fff; box-shadow: 0 10px 18px -10px rgba(11,27,77,.6);
  left: calc(16px + var(--k) * 34px); rotate: calc((var(--k) - 1) * 8deg); z-index: calc(3 - var(--k)); }
.ta-attach i:nth-child(2) { top: 8px; }
/* พิมพ์: ประโยคตัวอย่างพิมพ์เอง */
.ta-type { display: flex; align-items: center; padding: 0 12px; }
.ta-in { display: flex; align-items: center; width: 100%; height: 40px; margin-top: 10px; padding: 0 12px; border-radius: 13px; background: #fff; box-shadow: 0 8px 16px -12px rgba(11,27,77,.5); font: 600 14px var(--disp); color: var(--ink); overflow: hidden; white-space: nowrap; }
.ta-caret { width: 2px; height: 18px; background: var(--blue); margin-left: 1px; flex: none; animation: blink 1s steps(1) infinite; }
/* ถ่ายรูป: ช่องเล็งกล้องบนรูปกระดานจริง */
.tile[data-art="shoot"] { background: #fff; }
.ta-shoot { height: 92px; background: center/cover; border-radius: 24px 24px 0 0; }
.ta-shoot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(11,27,77,.15), rgba(255,255,255,.95) 98%); }
.ta-vf { position: absolute; inset: 14px 22px 22px; border-radius: 6px;
  background: linear-gradient(#fff, #fff) left top / 14px 3px no-repeat, linear-gradient(#fff, #fff) left top / 3px 14px no-repeat,
    linear-gradient(#fff, #fff) right top / 14px 3px no-repeat, linear-gradient(#fff, #fff) right top / 3px 14px no-repeat,
    linear-gradient(#fff, #fff) left bottom / 14px 3px no-repeat, linear-gradient(#fff, #fff) left bottom / 3px 14px no-repeat,
    linear-gradient(#fff, #fff) right bottom / 14px 3px no-repeat, linear-gradient(#fff, #fff) right bottom / 3px 14px no-repeat; }
.ta-shoot .ti-ic { position: absolute; left: auto; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--ink); }
.ta-shoot .ti-ic svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .ta-strip, .ta-rec i, .ta-caret { animation: none; } }
@media (max-height: 700px) { .tile { min-height: 124px; } .tile .ta { height: 66px; } .ta-attach i { width: 46px; height: 50px; } .ta-shoot { height: 74px; } .ta-wave { top: 42px; height: 22px; } .ta-head { top: 39px; height: 28px; } }
/* ดูโน้ตอยู่ / อยู่หน้าอื่น = หยุดภาพเคลื่อนไหวในกล่องหน้าแรก (ประหยัดแบต ไม่แย่งเครื่องตอนเลื่อนโน้ต) */
body.note-mode .pane-home *, body:has(#page:not([hidden])) .pane-home * { animation-play-state: paused !important; }

/* ================= 0.9.5 เมนูล่าง: กระจกฝ้าขาว + เม็ดกรมท่าเลื่อนตามหน้าที่อยู่ (เด้งนิด ๆ) ================= */
#nav { height: 66px; padding: 6px; gap: 0; border-radius: 33px; width: min(calc(100vw - 40px), 340px); bottom: calc(12px + var(--safe-b));
  background: rgba(255,255,255,.72); -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 0 0 1px rgba(11,27,77,.07), 0 22px 44px -18px rgba(11,27,77,.5), 0 2px 6px rgba(11,27,77,.06); }
#nav::before { content: ""; position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 3); border-radius: 27px;
  background: radial-gradient(120% 140% at 30% 0%, #1D3A9A, #0B1B4D 60%); box-shadow: 0 10px 20px -10px rgba(11,27,77,.85), inset 0 1px 0 rgba(255,255,255,.14);
  transform: translateX(calc(var(--ni, 0) * 100%)); transition: transform .55s cubic-bezier(.3,1.35,.45,1); }
#nav:has(a[data-r="tasks"][aria-current]) { --ni: 1; }
#nav:has(a[data-r="me"][aria-current]) { --ni: 2; }
#nav:not(:has(a[aria-current]))::before { opacity: 0; }
#nav a { position: relative; z-index: 1; flex-direction: column; gap: 2px; border-radius: 27px; background: none !important; color: #6B7690; font: 600 12.5px var(--disp); transition: color .3s; }
#nav a svg { width: 22px; height: 22px; transition: transform .45s cubic-bezier(.3,1.35,.45,1); }
#nav a[aria-current="page"] { color: #fff; }
#nav a[aria-current="page"] svg { transform: translateY(-1px) scale(1.06); }
#nav a:active svg { transform: scale(.9); }
@media (prefers-reduced-motion: reduce) { #nav::before, #nav a svg { transition: none; } }
/* ม่านขาวไล่ที่ขอบล่าง: เนื้อหาที่เลื่อนผ่านเมนูจางหาย ไม่โผล่ใต้เมนู */
#page::after, #sheet.full .pane-home::after { content: ""; position: sticky; bottom: calc(-110px - var(--safe-b)); display: block; height: calc(130px + var(--safe-b)); margin: -30px -20px calc(-110px - var(--safe-b));
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.92) 55%, #fff); pointer-events: none; z-index: 2; }
#page { padding-bottom: calc(140px + var(--safe-b)); }
.pane-home { padding-bottom: calc(140px + var(--safe-b)); }
#page::after { margin-left: -16px; margin-right: -16px; }
/* เมนูหลบอยู่ (ดูโน้ต/เลื่อนลง): ปิดกระจกฝ้า ไม่ให้เครื่องคำนวณเบลอทับชั้นโน้ตที่กำลังเลื่อน */
#nav.away { -webkit-backdrop-filter: none; backdrop-filter: none; visibility: hidden; transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .2s, visibility 0s linear .3s; }
/* ลากนิ้วบนเมนู: เม็ดตามนิ้ว (ไม่หน่วง) · ช่องที่นิ้วอยู่เป็นตัวขาว */
#nav { touch-action: none; -webkit-user-select: none; user-select: none; }
#nav.drag::before { transform: translateX(var(--nx, 0px)) scale(1.04); transition: none; }
#nav.drag a[aria-current="page"]:not(.over) { color: #6B7690; }
#nav.drag a[aria-current="page"]:not(.over) svg { transform: none; }
#nav.drag a.over { color: #fff; }

/* ================= 0.9.7 กระจกใส รุ้งจาง ๆ (เจ้าของเลือกแบบ 1) ================= */
/* ชื่อผู้ใช้: ไล่สีม่วงอมฟ้า → ชมพู → ส้มอ่อน (เด่นกว่าสีเทาเดิม แต่ไม่เข้ม) */
.pane-home h1.big .g { background: linear-gradient(100deg, #6F7CF6, #A07BF2 35%, #E58FB4 65%, #F2A97A); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; }
/* เม็ดเมนู: กระจกใสสีขาว แสงสะท้อนด้านบน ขอบเป็นเส้นรุ้งบาง ๆ */
#nav::before {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(240,244,252,.6)) padding-box,
    conic-gradient(from 200deg, rgba(255,140,170,.75), rgba(255,210,130,.75), rgba(140,230,190,.75), rgba(130,180,255,.8), rgba(190,150,255,.8), rgba(255,140,170,.75)) border-box;
  border: 1.5px solid transparent;
  box-shadow: inset 0 1px 1px #fff, inset 0 -6px 12px rgba(160,170,230,.18), 0 8px 18px -10px rgba(90,100,180,.55); }
#nav a[aria-current="page"], #nav.drag a.over { color: var(--ink); }

/* ================= 0.9.8 เมนูล่างกระจกใสทั้งแถบ (มองทะลุเห็นเนื้อหาด้านหลัง) ================= */
#nav { background: rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(10px) saturate(1.9) brightness(1.06); backdrop-filter: blur(10px) saturate(1.9) brightness(1.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 0 0 1px rgba(255,255,255,.55), inset 0 -10px 18px -10px rgba(255,255,255,.55),
    0 0 0 1px rgba(11,27,77,.06), 0 16px 34px -16px rgba(11,27,77,.38); }
#nav a { color: #3D4A6B; text-shadow: 0 1px 1px rgba(255,255,255,.8); }
#nav a svg { filter: drop-shadow(0 1px 0 rgba(255,255,255,.75)); }
/* เม็ดในแถบ: กระจกใสกว่าเดิม ขอบรุ้งบางลง */
#nav::before {
  background: linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,.22)) padding-box,
    conic-gradient(from 200deg, rgba(255,140,170,.6), rgba(255,210,130,.6), rgba(140,230,190,.6), rgba(130,180,255,.65), rgba(190,150,255,.65), rgba(255,140,170,.6)) border-box;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.95), 0 6px 14px -8px rgba(90,100,180,.45); }
/* ม่านขาวล่างจอ: บางลง ให้เห็นเนื้อหาผ่านกระจก แต่ยังไม่โผล่ใต้แถบโฮมของ iPhone */
#page::after, #sheet.full .pane-home::after { background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,.85) 80%, #fff); }
/* เห็นเนื้อหาผ่านกระจกทุกหน้า (แบบหน้างานที่เจ้าของชอบ): ม่านขาวเหลือแค่ใต้แถบเมนู ตรงแถบโฮมของ iPhone */
#page::after, #sheet.full .pane-home::after { background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) calc(100% - 22px - var(--safe-b)), rgba(255,255,255,.9) calc(100% - 10px - var(--safe-b)), #fff); }

/* ================= 0.9.9 แท็บ "สมุด" + เมนูล่าง 4 ช่อง + ไอคอนวิชา (เจ้าของเลือกแบบ B) ================= */
#nav { width: min(calc(100vw - 32px), 380px); grid-template-columns: repeat(4, 1fr); }
#nav::before { width: calc((100% - 12px) / 4); }
#nav:has(a[data-r="room"][aria-current]) { --ni: 2; }
#nav:has(a[data-r="me"][aria-current]) { --ni: 3; }
#nav a { font-size: 12px; }
.si { width: 22px; height: 22px; flex: none; }
.ti .th.sub { color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); }
.ti .th.sub .si { width: 24px; height: 24px; }
.si-box { width: 42px; height: 42px; border-radius: 14px; flex: none; display: grid; place-items: center; color: var(--c, #69778F); background: color-mix(in srgb, var(--c, #69778F) 13%, #fff); }
.nb-search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border-radius: 18px; background: var(--surface); margin: 4px 0 6px; }
.nb-search span { display: grid; color: var(--text); }
.nb-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: 500 16px var(--disp); color: var(--text); }
.nb-search:focus-within { background: #fff; box-shadow: 0 0 0 2px var(--blue), 0 0 0 6px var(--blue-light); }
.nb-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 340px) { .nb-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nb-card { position: relative; min-height: 124px; border-radius: 20px; background: #fff; padding: 11px; display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  box-shadow: 0 0 0 1px #EBEEF5, 0 10px 20px -16px rgba(11,27,77,.5); }
.nb-card:active { transform: scale(.97); }
.nb-card .si-box { color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); }
.nb-card b { margin-top: auto; padding-top: 10px; font: 700 16px/1.25 var(--disp); color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-card small { font: 400 12px var(--disp); color: var(--text-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.nb-rs { margin-top: 14px; }
.nb-hit { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; margin-bottom: 8px; border-radius: 18px; background: #fff; text-align: left;
  box-shadow: 0 0 0 1px #EBEEF5, 0 8px 18px -14px rgba(11,27,77,.45); }
.nb-hit .si-box { color: var(--c); }
.nb-hit .tx { flex: 1; min-width: 0; }
.nb-hit b { display: block; font: 600 15px/1.35 var(--disp); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-hit small { display: block; font: 400 12.5px var(--disp); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= 0.10 สมุดจด — ชั้นสมุด · หน้า "ทุกหน้า" · หน้าเขียน (features/sketch.js) ================= */
.sec2 small { font: 500 13px var(--disp); color: #A3ACBF; }
/* ชั้นสมุด: ปกผ้า สันเข้ม ยางรัด ป้ายขาว + ภาพย่อหน้าที่เขียนล่าสุด */
.bk-shelf { display: flex; gap: 16px; overflow-x: auto; margin: 0 -16px; padding: 4px 22px 16px 16px; scrollbar-width: none; scroll-snap-type: x proximity; }
.bk-shelf::-webkit-scrollbar { display: none; }
.bk-new, .bk-cover { flex: none; width: 112px; height: 152px; scroll-snap-align: start; }
.bk-new { border-radius: 8px 16px 16px 8px; border: 2px dashed #CBD3E1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; background: #FAFBFD; }
.bk-new i { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; margin-bottom: 8px;
  background: radial-gradient(120% 140% at 30% 0%, #1D3A9A, #0B1B4D 60%); box-shadow: 0 10px 18px -10px rgba(11,27,77,.85); }
.bk-new b { font: 700 14.5px var(--disp); }
.bk-new small { font: 500 11.5px var(--disp); color: var(--text-2); }
.bk-new:active, .bk-cover:active { transform: scale(.96); }
.bk-cover { position: relative; display: block; text-align: left; border-radius: 5px 15px 15px 5px; transition: transform .2s;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c) 78%, #fff) 0%, var(--c) 48%, color-mix(in srgb, var(--c) 78%, #000) 100%);
  box-shadow: 3px 2px 0 -1px #fff, 3px 2px 0 0 #DCE2EC, 6px 4px 0 -1px #fff, 6px 4px 0 0 #DCE2EC, 0 16px 26px -14px color-mix(in srgb, var(--c) 70%, #0B1B4D), inset 0 1px 0 rgba(255,255,255,.25); }
.bk-cover::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 13px; border-radius: 5px 0 0 5px;
  background: linear-gradient(90deg, rgba(0,0,0,.26), rgba(0,0,0,.06) 70%, rgba(255,255,255,.22) 92%, rgba(0,0,0,.08)); }
.bk-cover::after { content: ""; position: absolute; right: 15px; top: 0; bottom: 0; width: 6px; background: linear-gradient(90deg, rgba(0,0,0,.3), rgba(0,0,0,.16) 60%, rgba(255,255,255,.18)); }
.bk-label { position: absolute; left: 20px; right: 28px; top: 16px; padding: 6px 8px 5px; border-radius: 7px; background: #FFFFFF; color: var(--ink); box-shadow: 0 2px 4px rgba(0,0,0,.12); }
.bk-label b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 700 13px/1.25 var(--disp); word-break: break-word; }
.bk-label small { display: block; font: 500 10.5px var(--disp); color: var(--text-2); margin-top: 1px; }
.bk-peek { position: absolute; left: 22px; bottom: 13px; width: 44px; rotate: -5deg; border: 2.5px solid #fff; border-radius: 3px; box-shadow: 0 4px 10px rgba(0,0,0,.25); background: #FFFFFF; line-height: 0; }
.bk-peek canvas { width: 100%; height: auto; border-radius: 1px; }
.bk-cover.preview { width: 104px; height: 140px; }
.bk-cover.preview:active { transform: none; }

/* หน้า "ทุกหน้า" */
.bk-head h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-meta { display: flex; align-items: center; gap: 8px; margin: -4px 0 16px; font: 500 13.5px var(--disp); color: var(--text-2); }
.bk-meta i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.bk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; }
@media (max-width: 340px) { .bk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 520px) { .bk-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bk-thumb { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.bk-grid.anim .bk-thumb { animation: bkin .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(min(var(--n, 0), 12) * 28ms); }
.bk-thumb canvas, .bk-add i { width: 100%; height: auto; aspect-ratio: 1000 / 1414; border-radius: 6px; background: #FFFFFF; transition: transform .2s, box-shadow .2s;
  box-shadow: 0 0 0 1px rgba(11,27,77,.06), 0 1px 2px rgba(11,27,77,.08), 0 12px 22px -14px rgba(11,27,77,.5); }
.bk-thumb span { font: 600 12.5px Inter, sans-serif; color: var(--text-2); }
.bk-thumb.last canvas { box-shadow: 0 0 0 2.5px var(--ink), 0 12px 22px -12px rgba(11,27,77,.55); }
.bk-thumb.last span { color: var(--ink); }
.bk-thumb:active canvas { transform: scale(.96); }
.bk-thumb.landing canvas { opacity: 0; }
.bk-add i { display: grid; place-items: center; background: #FAFBFD; box-shadow: none; border: 2px dashed #CBD3E1; color: #8A94A8; }
.bk-add i svg { width: 28px; height: 28px; }
@keyframes bkin { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.bk-go { position: fixed; z-index: 3; bottom: calc(92px + var(--safe-b)); right: max(20px, calc(50vw - 260px)); height: 52px; padding: 0 22px 0 18px; border-radius: 26px; display: flex; align-items: center; gap: 8px;
  color: #fff; font: 600 15.5px var(--disp); background: radial-gradient(120% 140% at 30% 0%, #1D3A9A, #0B1B4D 60%); box-shadow: 0 16px 28px -12px rgba(11,27,77,.8), inset 0 1px 0 rgba(255,255,255,.16); }
.bk-go:active { transform: scale(.96); }
.bk-go svg { width: 20px; height: 20px; }
@media (prefers-reduced-motion: reduce) { .bk-thumb { animation: none; } }

/* กล่องสร้าง/แก้สมุด */
.bk-form .bk-pv { display: flex; justify-content: center; padding: 6px 0 18px; }
.bk-in { width: 100%; height: 52px; border: 0; border-radius: 16px; background: var(--surface); padding: 0 16px; font: 600 17px var(--disp); outline: none; }
.bk-in:focus { background: #fff; box-shadow: 0 0 0 2px var(--blue), 0 0 0 6px var(--blue-light); }
.bk-lb { font: 600 13.5px var(--disp); color: var(--text-2); margin: 16px 0 8px; }
.bk-subs { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-subs button { padding: 7px 13px; border-radius: 999px; font: 600 13.5px var(--disp); color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.bk-colors { display: flex; flex-wrap: wrap; gap: 12px; }
.bk-colors button, .sk-colors button { width: 32px; height: 32px; border-radius: 50%; background: var(--sw); flex: none; transition: transform .15s, box-shadow .15s; }
.bk-colors button[aria-pressed="true"], .sk-colors button[aria-pressed="true"] { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sw); transform: scale(.92); }
.btn.wide { width: 100%; }
/* แบบกระดาษ (ใช้ทั้งกล่องสร้างสมุดและเมนูในหน้าเขียน) */
.sk-papers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sk-papers button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 4px 6px; border-radius: 14px; font: 600 12px var(--disp); color: var(--text-2); }
.sk-papers button[aria-pressed="true"] { background: var(--blue-light); color: var(--blue); }
.sk-papers button span { white-space: nowrap; font-size: 11.5px; letter-spacing: -.01em; }
.pp { width: 40px; height: 56px; border-radius: 4px; background-color: #FFFFFF; box-shadow: 0 0 0 1px #E1E7F2, 0 3px 6px rgba(11,27,77,.08); }
.pp-lined { background-image: linear-gradient(90deg, transparent 7px, rgba(228,84,101,.5) 7px 8px, transparent 8px), repeating-linear-gradient(transparent 0 6px, rgba(10,108,241,.32) 6px 7px); background-position: 0 0, 0 8px; }
.pp-grid { background-image: linear-gradient(rgba(10,108,241,.22) 1px, transparent 1px), linear-gradient(90deg, rgba(10,108,241,.22) 1px, transparent 1px); background-size: 6px 6px; }
.pp-dots { background-image: radial-gradient(circle, rgba(11,27,77,.38) 1px, transparent 1.3px); background-size: 6px 6px; }

/* ---------- หน้าเขียน ---------- */
.sk { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; font-family: var(--disp); --skbg: #E9EDF4; user-select: none; -webkit-user-select: none; }
.sk::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(120% 70% at 50% 0%, #F4F6FA, transparent 70%), radial-gradient(circle, rgba(11,27,77,.07) 1px, transparent 1.4px) 0 0 / 18px 18px, var(--skbg); }
.sk.in::before { opacity: 1; }
.sk.out::before { opacity: 0; transition-duration: .4s; }
.sk > .sk-top, .sk > .sk-pager, .sk > .sk-bottom { transition: opacity .28s, transform .35s cubic-bezier(.2,.8,.2,1); }
.sk:not(.in) > .sk-top, .sk.out > .sk-top { opacity: 0; transform: translateY(-14px); }
.sk:not(.in) > .sk-bottom, .sk:not(.in) > .sk-pager, .sk.out > .sk-bottom, .sk.out > .sk-pager { opacity: 0; transform: translateY(18px); }
.sk:not(.in):not(.zoom) .sk-stage { opacity: 0; transform: scale(.96); }
.sk .sk-stage { transition: opacity .3s, transform .35s cubic-bezier(.2,.8,.2,1); }
.sk-top { display: flex; align-items: center; gap: 6px; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 4px; }
.sk-ib { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--ink);
  background: rgba(255,255,255,.8); box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 0 0 1px rgba(11,27,77,.06), 0 6px 14px -8px rgba(11,27,77,.35); }
.sk-ib:disabled { opacity: .35; }
.sk-ib:active:not(:disabled) { transform: scale(.92); }
.sk-ib svg { width: 20px; height: 20px; }
.sk-close { background: var(--ink); color: #fff; box-shadow: 0 8px 16px -8px rgba(11,27,77,.8); }
.sk-name { flex: 1; min-width: 0; padding: 2px 6px; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; border-radius: 12px; }
.sk-name:active { background: rgba(11,27,77,.06); }
.sk-name > span { display: flex; align-items: center; gap: 2px; }
.sk-name > span svg { width: 15px; height: 15px; color: var(--text-2); transition: transform .25s; }
.sk.strip-on .sk-name > span svg { transform: rotate(180deg); }
.sk-name b { font: 700 16px var(--disp); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-name small { font: 600 12px Inter, var(--disp); color: var(--text-2); }
.sk-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; perspective: 2200px; }
.sk-paper { position: relative; border-radius: 4px 8px 8px 4px; background: #FFFFFF; transform-origin: 0 0; translate: var(--drag, 0) 0; transition: translate .2s;
  box-shadow: 0 0 0 1px rgba(11,27,77,.05), 0 2px 4px rgba(11,27,77,.06), 0 28px 50px -26px rgba(11,27,77,.55), 4px 3px 0 -1px #FFFFFF, 4px 3px 0 0 rgba(11,27,77,.08), 8px 6px 0 -1px #FFFFFF, 8px 6px 0 0 rgba(11,27,77,.06); }
.sk-paper::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 12px; pointer-events: none; z-index: 2; border-radius: 4px 0 0 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 40%, rgba(11,27,77,.25)), transparent); opacity: .45; }
.sk-paper canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: inherit; touch-action: none; }
.sk-paper { touch-action: none; }
.sk-flip { z-index: 3; transform-origin: 0 50%; backface-visibility: hidden; box-shadow: 0 10px 30px rgba(11,27,77,.25); pointer-events: none; }
.sk-shade { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; border-radius: inherit; background: linear-gradient(90deg, rgba(11,27,77,.35), rgba(11,27,77,.05) 60%, transparent); }
.sk-selbox { position: absolute; z-index: 3; pointer-events: none; border: 1.5px dashed var(--blue); border-radius: 8px; background: rgba(10,108,241,.05); }
.sk-handle { position: absolute; right: -10px; bottom: -10px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2.5px solid var(--blue); box-shadow: 0 2px 6px rgba(10,108,241,.4); }
.sk-selbar { position: absolute; z-index: 6; display: flex; gap: 2px; padding: 4px; border-radius: 16px; background: var(--ink); box-shadow: 0 12px 24px -10px rgba(11,27,77,.8); animation: skpop .2s cubic-bezier(.3,1.4,.5,1); }
.sk-selbar button { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; color: #fff; font: 600 13.5px var(--disp); white-space: nowrap; }
.sk-selbar button:active { background: rgba(255,255,255,.14); }
.sk-selbar svg { width: 17px; height: 17px; }
@keyframes skpop { from { opacity: 0; transform: translateY(6px) scale(.9); } }
.sk-ta { position: absolute; z-index: 4; margin: 0; padding: 0; border: 0; resize: none; overflow: hidden; background: rgba(10,108,241,.05); outline: 1.5px dashed rgba(10,108,241,.7); outline-offset: 4px; border-radius: 2px;
  font-family: var(--disp); font-weight: 500; line-height: 1.45; user-select: text; -webkit-user-select: text; touch-action: auto; }
.sk-pager { display: flex; align-items: center; justify-content: center; gap: 14px; height: 46px; }
.sk-turn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: rgba(255,255,255,.85); box-shadow: 0 0 0 1px rgba(11,27,77,.06), 0 6px 14px -8px rgba(11,27,77,.35); }
.sk-turn:disabled { opacity: .3; }
.sk-turn:active:not(:disabled) { transform: scale(.9); }
.sk-turn svg { width: 19px; height: 19px; }
.sk-turn.add { background: var(--c, var(--ink)); color: #fff; box-shadow: 0 8px 16px -8px color-mix(in srgb, var(--c) 80%, #000); }
.sk-dots { display: flex; align-items: center; gap: 6px; min-width: 60px; justify-content: center; }
.sk-dots button { width: 7px; height: 7px; border-radius: 4px; background: rgba(11,27,77,.2); padding: 0; transition: width .3s cubic-bezier(.3,1.4,.5,1), background .3s; position: relative; }
.sk-dots button::before { content: ""; position: absolute; inset: -10px -4px; }
.sk-dots button.on { width: 20px; background: var(--ink); }
.sk-bottom { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 2px 10px calc(10px + var(--safe-b)); }
.sk-opts { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; min-height: 46px; max-width: 100%; padding: 6px 12px; border-radius: 23px;
  background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 0 0 1px rgba(11,27,77,.06), 0 10px 24px -16px rgba(11,27,77,.45); }
.sk-opts::-webkit-scrollbar { display: none; }
.sk-opts:empty { visibility: hidden; }
.sk-colors { display: flex; gap: 6px; }
.sk-colors button { width: 26px; height: 26px; }
.sk-colors button[aria-pressed="true"] { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px var(--sw); }
.sk-sizes, .sk-seg { display: flex; gap: 2px; padding-left: 10px; border-left: 1px solid #E3E8F0; }
.sk-seg { padding: 0; border: 0; }
.sk-opts[data-tool="shape"] .sk-colors { order: 3; }
.sk-opts[data-tool="eraser"] .sk-sizes { border: 0; padding: 0; }
.sk-sizes button, .sk-seg button { width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; color: var(--text-2); }
.sk-sizes button[aria-pressed="true"], .sk-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); }
.sk-sizes i { width: var(--d); height: var(--d); border-radius: 50%; background: var(--sw); box-shadow: 0 0 0 1px rgba(11,27,77,.15); }
.sk-seg svg { width: 19px; height: 19px; }
.sk-hint { font: 500 13px var(--disp); color: var(--text-2); white-space: nowrap; }
.sk-hint.sm { padding-left: 10px; border-left: 1px solid #E3E8F0; }
.sk-tools { display: flex; gap: 2px; padding: 6px; border-radius: 28px; max-width: 100%;
  background: rgba(255,255,255,.78); -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 0 0 1px rgba(11,27,77,.07), 0 22px 44px -18px rgba(11,27,77,.5); }
.sk-tool { position: relative; width: 46px; height: 46px; border-radius: 22px; display: grid; place-items: center; color: #5E6B85; transition: background .25s, color .25s, transform .2s; }
@media (max-width: 360px) { .sk-tool { width: 40px; } }
.sk-tool svg { width: 22px; height: 22px; transition: transform .35s cubic-bezier(.3,1.4,.5,1); }
.sk-tool[aria-pressed="true"] { color: #fff; background: radial-gradient(120% 140% at 30% 0%, #1D3A9A, #0B1B4D 60%); box-shadow: 0 10px 18px -10px rgba(11,27,77,.85), inset 0 1px 0 rgba(255,255,255,.14); }
.sk-tool[aria-pressed="true"] svg { transform: translateY(-2px) rotate(-8deg); }
.sk-tool::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 12px; height: 3px; margin-left: -6px; border-radius: 2px; background: var(--tc, transparent); opacity: 0; transition: opacity .2s; }
.sk-tool[data-tool="pen"]::after { --tc: var(--pen); } .sk-tool[data-tool="hl"]::after { --tc: var(--hl); }
.sk-tool[data-tool="pen"][aria-pressed="true"]::after, .sk-tool[data-tool="hl"][aria-pressed="true"]::after { opacity: 1; box-shadow: 0 0 0 1px rgba(255,255,255,.6); }
.sk-tool:active { transform: scale(.9); }
.sk-menu { position: absolute; z-index: 8; top: calc(58px + env(safe-area-inset-top, 0px)); right: 10px; width: min(290px, calc(100vw - 20px)); padding: 12px; border-radius: 20px; background: #fff;
  box-shadow: 0 0 0 1px rgba(11,27,77,.06), 0 24px 48px -20px rgba(11,27,77,.5); animation: skpop .22s cubic-bezier(.3,1.3,.5,1); transform-origin: top right; }
.sk-mh { font: 600 13px var(--disp); color: var(--text-2); margin: 0 4px 6px; }
.sk-menu .sk-papers { margin-bottom: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.sk-mi { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; border-radius: 12px; font: 600 15px var(--disp); text-align: left; }
.sk-mi:active { background: var(--surface); }
.sk-mi svg { width: 20px; height: 20px; color: var(--text-2); }
.sk-mi.danger, .sk-mi.danger svg { color: var(--error); }
body.sk-on #toast { z-index: 60; }
.sk [hidden] { display: none !important; }

/* ---------- 0.10.1 ยกระดับสมุดจด ---------- */
.pp-cornell { background-image: linear-gradient(90deg, transparent 12px, rgba(11,27,77,.4) 12px 13px, transparent 13px), linear-gradient(rgba(11,27,77,.4) 1px, transparent 1px), linear-gradient(rgba(11,27,77,.4) 1px, transparent 1px), repeating-linear-gradient(transparent 0 5px, rgba(10,108,241,.28) 5px 6px);
  background-size: 100% 41px, 100% 100%, 100% 100%, 100% 100%; background-position: 0 6px, 0 6px, 0 46px, 0 0; background-repeat: no-repeat, no-repeat, no-repeat, repeat; }
.pp-todo { background-image: linear-gradient(90deg, transparent 4px, rgba(11,27,77,.38) 4px 8px, transparent 8px), repeating-linear-gradient(transparent 0 7px, rgba(10,108,241,.3) 7px 8px); background-size: 100% 8px, 100% 100%;
  background-position: 0 2px, 0 0; background-repeat: repeat-y, repeat; -webkit-mask: none; }
.pp-board { background: radial-gradient(70% 60% at 50% 40%, #33584D, #1F3B33); box-shadow: 0 0 0 2px #B58A5A, 0 3px 6px rgba(11,27,77,.15); }
/* ชื่อหน้า → แถบภาพย่อทุกหน้า (ลอยเหนือแถบเครื่องมือ ไม่ดันหน้ากระดาษ) */
.sk-bottom { position: relative; }
.sk-strip { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 10px); z-index: 7; display: flex; gap: 10px; overflow-x: auto; padding: 10px 12px; border-radius: 22px; scrollbar-width: none;
  background: rgba(255,255,255,.86); -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 0 0 1px rgba(11,27,77,.07), 0 22px 44px -18px rgba(11,27,77,.5); animation: skpop .25s cubic-bezier(.3,1.3,.5,1); }
.sk-strip::-webkit-scrollbar { display: none; }
.sk-film { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font: 600 11px Inter, sans-serif; color: var(--text-2); }
.sk-film canvas, .sk-film i { width: 54px; height: auto; aspect-ratio: 1000 / 1414; border-radius: 4px; box-shadow: 0 0 0 1px rgba(11,27,77,.08), 0 6px 12px -8px rgba(11,27,77,.5); }
.sk-film.on canvas { box-shadow: 0 0 0 2.5px var(--ink), 0 6px 12px -6px rgba(11,27,77,.6); }
.sk-film.on { color: var(--ink); }
.sk-film i { display: grid; place-items: center; border: 2px dashed #CBD3E1; box-shadow: none; color: #8A94A8; }
.sk-film:active canvas { transform: scale(.94); }
/* ซูม */
.sk-zoom { position: absolute; top: 4px; right: 12px; z-index: 7; display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px 0 10px; border-radius: 17px;
  background: var(--ink); color: #fff; font: 600 13px Inter, sans-serif; box-shadow: 0 8px 18px -8px rgba(11,27,77,.8); animation: skpop .2s cubic-bezier(.3,1.4,.5,1); }
.sk-zoom svg { width: 16px; height: 16px; }
.sk-paper.zoomed { transition: none; }
.sk-stage { overflow: hidden; }
/* ค้างแล้วกลายเป็นรูปทรง: วาบฟ้าสั้น ๆ */
.sk-paper.snap .sk-ink { animation: sksnap .45s ease-out; }
@keyframes sksnap { 0% { filter: drop-shadow(0 0 0 rgba(10,108,241,0)); } 30% { filter: drop-shadow(0 0 5px rgba(10,108,241,.9)); } 100% { filter: drop-shadow(0 0 0 rgba(10,108,241,0)); } }
/* สีเลือกเอง */
.sk-own { position: relative; width: 26px; height: 26px; border-radius: 50%; flex: none; cursor: pointer; overflow: hidden;
  background: conic-gradient(#E45465, #F4A340, #FFE066, #16B76A, #0EA5B7, #0A6CF1, #8B5CF6, #D9468F, #E45465); box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.sk-own.on { background: var(--sw); box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px var(--sw); overflow: visible; }
.sk-own.on::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; background: conic-gradient(#E45465, #FFE066, #16B76A, #0A6CF1, #8B5CF6, #E45465); box-shadow: 0 0 0 1.5px #fff; }
.sk-own input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.sk-hint.tip { display: none; }
@media (min-width: 560px) { .sk-hint.tip { display: block; padding-left: 10px; border-left: 1px solid #E3E8F0; } }
/* กระดานดำ */
.sk.dark-paper .sk-paper { background: #23443A; box-shadow: 0 0 0 5px #B58A5A, 0 0 0 6px rgba(0,0,0,.12), 0 30px 50px -24px rgba(11,27,77,.7); border-radius: 3px; }
.sk.dark-paper .sk-paper::after { display: none; }
.sk.dark-paper .sk-ta { outline-color: rgba(255,255,255,.6); background: rgba(255,255,255,.06); }
/* แตะปก: ปกพลิกเปิด หน้าลอยขึ้น */
.bk-fly-dim { position: fixed; inset: 0; z-index: 48; background: rgba(233,237,244,.92); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); pointer-events: none; }
.bk-fly { position: fixed; z-index: 49; perspective: 1400px; transform-origin: 0 0; pointer-events: none; }
.bk-fly-page { position: absolute; inset: 0; border-radius: 3px 8px 8px 3px; overflow: hidden; background: #FFFFFF; box-shadow: 0 30px 60px -28px rgba(11,27,77,.6), 0 0 0 1px rgba(11,27,77,.06); }
.bk-fly-page canvas { width: 100%; height: 100%; display: block; }
.bk-fly .bk-fly-cover { position: absolute; inset: 0; width: 100%; height: 100%; transform-origin: 0 50%; backface-visibility: hidden; transform-style: preserve-3d; }
.bk-fly .bk-label { left: 18%; right: 25%; top: 10%; }

/* ---------- 0.10.2 หน้าเขียนเต็มจอ: กระดาษขอบชนขอบ แถบปุ่มลอยเป็นกระจกบนกระดาษ ---------- */
.sk::before { background: #E4E9F1; }
.sk-stage { position: absolute; inset: 0; display: block; overflow: hidden; touch-action: none; background: #E4E9F1; perspective: 2400px; translate: var(--drag, 0) 0; transition: translate .2s; }
.sk-stage > canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; touch-action: none; }
.sk-layer { position: absolute; left: 0; top: 0; width: 1000px; transform-origin: 0 0; pointer-events: none; }

.sk-layer .sk-handle { width: calc(22px * var(--inv, 1)); height: calc(22px * var(--inv, 1)); right: calc(-11px * var(--inv, 1)); bottom: calc(-11px * var(--inv, 1)); border-width: calc(2.5px * var(--inv, 1)); }
.sk-layer .sk-ta { pointer-events: auto; outline-width: calc(1.5px * var(--inv, 1)); outline-offset: calc(4px * var(--inv, 1)); }
.sk-stage .sk-flip { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; transform-origin: 0 50%; backface-visibility: hidden; box-shadow: 0 0 40px rgba(11,27,77,.3); pointer-events: none; }
.sk-stage .sk-shade { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; background: linear-gradient(90deg, rgba(11,27,77,.4), rgba(11,27,77,.06) 60%, transparent); }
.sk-stage.snap .sk-ink { animation: sksnap .45s ease-out; }
.sk-sbar { position: absolute; z-index: 4; right: 3px; top: 0; width: 4px; border-radius: 2px; background: rgba(11,27,77,.38); opacity: 0; transition: opacity .3s; pointer-events: none; }
.sk-sbar.show { opacity: 1; transition-duration: .1s; }
.sk.dark-paper .sk-sbar { background: rgba(255,255,255,.5); }
.sk-top { position: absolute; z-index: 6; left: 0; right: 0; top: 0; padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 0; gap: 6px; pointer-events: none; }
.sk-top > * { pointer-events: auto; }
.sk-gap { flex: 1; pointer-events: none !important; }
.sk-pages { display: flex; align-items: center; gap: 0; height: 42px; padding: 3px; border-radius: 21px;
  background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 0 0 1px rgba(11,27,77,.07), 0 8px 18px -10px rgba(11,27,77,.4); }
.sk-pg { width: 36px; height: 36px; border-radius: 18px; display: grid; place-items: center; color: var(--ink); }
.sk-pg svg { width: 19px; height: 19px; }
.sk-pg:disabled { opacity: .3; }
.sk-pg:active:not(:disabled) { background: rgba(11,27,77,.07); }
.sk-pg.add { background: var(--c, var(--ink)); color: #fff; box-shadow: 0 6px 12px -6px color-mix(in srgb, var(--c) 80%, #000); }
.sk-pages .sk-name { flex: none; flex-direction: row; align-items: center; gap: 1px; padding: 0 6px 0 8px; height: 36px; border-radius: 18px; }
.sk-pages .sk-name b { font: 700 14.5px Inter, var(--disp); letter-spacing: -.01em; white-space: nowrap; }
.sk-pages .sk-name i { display: grid; }
.sk-pages .sk-name svg { width: 15px; height: 15px; color: var(--text-2); transition: transform .25s; }
.sk.strip-on .sk-pages .sk-name svg { transform: rotate(180deg); }
.sk-bottom { position: absolute; z-index: 6; left: 0; right: 0; bottom: 0; pointer-events: none; }
.sk-bottom > * { pointer-events: auto; }
.sk > .sk-selbar { z-index: 7; }
.sk > .sk-zoom { position: absolute; top: calc(62px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 7; }
.sk:not(.in):not(.zoom) .sk-stage { opacity: 0; transform: scale(.98); }
@media (max-width: 360px) { .sk-top .sk-ib { width: 38px; height: 38px; } .sk-pg { width: 32px; } }

/* ================= 0.11 วิชา = สมุด (แบบ ข) · โปรเจกต์ · หน้าปก+สารบัญ — เรียบ ๆ เส้นบาง สีเดียว ไม่มีไล่สี ================= */
.nb-card { overflow: hidden; }
.nb-card > .si-box, .nb-card > b, .nb-card > small { position: relative; z-index: 1; }
.nb-peek { position: absolute; z-index: 0; top: 12px; right: -8px; width: 44px; rotate: 5deg; line-height: 0; border-radius: 3px; background: #FFFFFF; box-shadow: 0 0 0 1px rgba(11,27,77,.08), 0 6px 12px -6px rgba(11,27,77,.35); }
.nb-peek.back { right: 8px; top: 18px; rotate: -6deg; }
.nb-peek canvas { width: 100%; height: auto; border-radius: 3px; }
.nb-card small.ex { color: var(--error); font-weight: 600; }
.nb-add { min-height: 124px; border-radius: 20px; border: 1.5px dashed #CBD3E1; background: #FAFBFD; padding: 11px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; color: var(--text); }
.nb-add span { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: #fff; box-shadow: inset 0 0 0 1.5px #E3E8F0; color: var(--ink); }
.nb-add b { margin-top: auto; padding-top: 10px; font: 700 16px/1.25 var(--disp); }
.nb-add small { font: 400 12px var(--disp); color: var(--text-2); }
.nb-add:active { transform: scale(.97); }
.nb-proj { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px 12px 12px; margin-bottom: 10px; border-radius: 20px; background: #fff; text-align: left;
  box-shadow: 0 0 0 1px #EDF0F6, 0 10px 20px -16px rgba(11,27,77,.4); }
.nb-proj:active { transform: scale(.985); }
.nb-proj .tx { flex: 1; min-width: 0; }
.nb-proj b { display: block; font: 700 16px/1.3 var(--disp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-proj small { display: block; font: 400 12.5px var(--disp); color: var(--text-2); }
.nb-proj > i { display: grid; color: #A3ACBF; } .nb-proj > i svg { width: 18px; height: 18px; }
.nb-proj.empty { background: #FAFBFD; box-shadow: none; border: 1.5px dashed #CBD3E1; }
/* ปกสมุดแบบเรียบ: สีเดียว สันเข้มนิด ป้ายขาว */
.nb-book { position: relative; flex: none; width: 40px; height: 52px; border-radius: 3px 8px 8px 3px; background: var(--c, #0B1B4D); box-shadow: inset 5px 0 0 rgba(0,0,0,.16), 0 6px 12px -8px rgba(11,27,77,.6); }
.nb-book::after { content: ""; position: absolute; left: 12px; right: 7px; top: 10px; height: 9px; border-radius: 2px; background: rgba(255,255,255,.92); }
.nb-book.ghost { background: #E9EDF4; box-shadow: inset 5px 0 0 rgba(11,27,77,.06); }
.nb-book.big { width: 108px; height: 144px; border-radius: 4px 14px 14px 4px; box-shadow: inset 9px 0 0 rgba(0,0,0,.16), 3px 2px 0 -1px #fff, 3px 2px 0 0 #DCE2EC, 0 18px 26px -16px rgba(11,27,77,.6); padding: 16px 12px 12px 20px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }
.nb-book.big::after { left: 20px; right: 14px; top: 18px; height: 14px; }
.nb-book.big b { font: 700 15px/1.2 var(--disp); word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nb-book.big small { font: 500 11px var(--disp); opacity: .85; margin-top: 2px; }
/* กล่องเล่มใหม่ */
.nb-seg { display: flex; padding: 4px; border-radius: 14px; background: var(--surface); margin-bottom: 4px; }
.nb-seg button { flex: 1; height: 38px; border-radius: 11px; font: 600 14.5px var(--disp); color: var(--text-2); }
.nb-seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(11,27,77,.12); }
.nb-firsts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nb-firsts button { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 16px; text-align: left; box-shadow: inset 0 0 0 1.5px #E3E8F0; }
.nb-firsts button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); background: #F7F9FC; }
.nb-firsts b { display: block; font: 700 13.5px/1.25 var(--disp); } .nb-firsts small { display: block; font: 400 11.5px/1.3 var(--disp); color: var(--text-2); }
.nb-firsts i { flex: none; width: 36px; height: 50px; border-radius: 3px; background: #FFFFFF; box-shadow: 0 0 0 1px #E1E7F2; position: relative; }
.pf-cover::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); border-radius: 3px 0 0 3px; }
.pf-cover::after { content: ""; position: absolute; left: 9px; right: 6px; top: 10px; height: 5px; background: #0B1B4D; border-radius: 1px; box-shadow: 0 9px 0 -1.5px #CBD3E1, 0 15px 0 -1.5px #CBD3E1, 0 21px 0 -1.5px #CBD3E1; }
.pf-plain { background-image: repeating-linear-gradient(transparent 0 6px, rgba(10,108,241,.22) 6px 7px) !important; }
/* หน้าวิชา / หน้าโปรเจกต์ */
.sv-hero { display: flex; align-items: center; gap: 14px; margin: 2px 0 14px; }
.sv-hero h1 { font: 700 30px/1.15 var(--disp); letter-spacing: -.02em; }
.sv-hero small { display: block; font: 600 12.5px var(--disp); color: var(--text-2); }
.sv-hero p { font: 500 13.5px var(--disp); color: var(--text-2); margin-top: 2px; }
.si-box.lg { width: 56px; height: 56px; border-radius: 18px; }
.si-box.lg svg { width: 28px; height: 28px; }
.sv-book { flex: none; width: 46px; height: 60px; border-radius: 3px 9px 9px 3px; background: var(--c); box-shadow: inset 6px 0 0 rgba(0,0,0,.16), 0 8px 14px -8px rgba(11,27,77,.6); position: relative; }
.sv-book::after { content: ""; position: absolute; left: 14px; right: 8px; top: 11px; height: 10px; border-radius: 2px; background: rgba(255,255,255,.92); }
.sv-stats { display: flex; gap: 8px; margin-bottom: 16px; }
.sv-stats span { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1.5px #EDF0F6; font: 500 12px var(--disp); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-stats b { display: block; font: 700 22px/1.15 Inter, var(--disp); color: var(--ink); }
.sv-stats .ex { flex: 1.4; box-shadow: inset 0 0 0 1.5px #FBD3CD; background: #FFF6F4; }
.sv-stats .ex b { color: var(--error); }
.sv-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 16px; background: var(--surface); margin-bottom: 16px; }
.sv-tabs button { flex: 1; height: 40px; border-radius: 12px; font: 600 15px var(--disp); color: var(--text-2); }
.sv-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(11,27,77,.12); }
.sv-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 16px 30px; border-radius: 22px; background: #FAFBFD; box-shadow: inset 0 0 0 1.5px #EDF0F6; }
.sv-empty > b { font: 700 18px var(--disp); margin-top: 18px; }
.sv-empty > p { font: 500 14px var(--disp); color: var(--text-2); margin: 4px 0 16px; }
.sv-stack { position: relative; width: 92px; height: 120px; }
.sv-stack i { position: absolute; inset: 0; border-radius: 3px 10px 10px 3px; background: #FFFFFF; box-shadow: 0 0 0 1px #E1E7F2; }
.sv-stack i:nth-child(1) { rotate: -8deg; translate: -10px 4px; }
.sv-stack i:nth-child(2) { rotate: 5deg; translate: 8px 2px; }
.sv-stack i:nth-child(3) { background: var(--c); box-shadow: inset 8px 0 0 rgba(0,0,0,.16), 0 14px 22px -12px rgba(11,27,77,.6); display: flex; align-items: flex-end; padding: 0 10px 12px 18px; }
.sv-stack i:nth-child(3)::after { content: ""; position: absolute; left: 18px; right: 10px; top: 14px; height: 12px; border-radius: 2px; background: rgba(255,255,255,.92); }
.sv-stack b { font: 700 12.5px/1.2 var(--disp); color: #fff; text-align: left; }
.bk-thumb > span { display: flex; flex-direction: column; align-items: center; max-width: 100%; line-height: 1.25; }
.bk-thumb > span b { font: 600 12.5px Inter, sans-serif; color: var(--text-2); }
.bk-thumb > span small { font: 500 11.5px var(--disp); color: var(--text); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-thumb.last > span b { color: var(--ink); }
/* สารบัญบนหน้าปก: แถวแตะได้ (หน่วยหน้า) */
.sk-toc a { position: absolute; left: 80px; width: 840px; height: 72px; border-radius: 14px; pointer-events: auto; }
.sk-toc a:active { background: rgba(10,108,241,.08); }

/* ================= 0.11.1 หน้าในสมุด ↔ โน้ตของงาน ================= */
.nitem.page { background: #FFFFFF; }
.nitem.page .zoom { position: absolute; inset: 0; display: block; cursor: pointer; }
.nitem.page canvas { width: 100%; height: 100%; display: block; object-fit: cover; object-position: top center; }
.nitem.page .ntag svg { width: 15px; height: 15px; }
/* เลือกหน้าจากสมุด */
.pk-book h3 { display: flex; align-items: center; gap: 8px; font: 700 15px var(--disp); margin: 14px 0 10px; }
.pk-book h3 i { width: 10px; height: 14px; border-radius: 2px 4px 4px 2px; }
.pk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.pk-page { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.pk-page canvas { width: 100%; height: auto; border-radius: 5px; box-shadow: 0 0 0 1px rgba(11,27,77,.07), 0 8px 16px -10px rgba(11,27,77,.5); }
.pk-page span { font: 500 12px var(--disp); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-page:active canvas { transform: scale(.96); }
.pk-page.on { opacity: .45; }
/* ส่งไปโน้ตของงาน (ในเมนูหน้าเขียน) */
.sk-task { gap: 10px; padding: 10px; }
.sk-task i { flex: none; width: 8px; height: 30px; border-radius: 4px; }
.sk-task span { flex: 1; min-width: 0; }
.sk-task b { display: block; font: 600 14.5px/1.3 var(--disp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-task small { display: block; font: 500 12px var(--disp); color: var(--text-2); }
.sk-task em { font: 700 12px var(--disp); font-style: normal; color: #16B76A; }
.sk-empty { font: 500 14px var(--disp); color: var(--text-2); padding: 12px 10px; }
.sk-menu { max-height: calc(100dvh - 160px); overflow-y: auto; }
/* ปุ่มเพิ่มโน้ตมี 4 อัน (รูป · ข้อความ · เสียง · สมุด) — อยู่แถวเดียวทุกแบบ */
.pane-note .pills { grid-template-columns: repeat(4, 1fr); }
.pane-note .pills.seg6 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 380px) { .pane-note .pill.sq { width: 42px; } .pane-note .tk-b { gap: 6px; }  }

/* 0.12 บัญชี (เข้าสู่ระบบด้วย Google) และซิงก์ */
.gbtn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 52px; margin: 14px 0 4px; padding: 0 18px;
  border: 1.5px solid #DADCE0; border-radius: 999px; background: #fff; color: #1F1F1F; font: 600 16px var(--disp); }
.gbtn span { display: grid; width: 22px; height: 22px; } .gbtn svg { width: 22px; height: 22px; }
.gbtn:active { background: #F6F8FC; } .gbtn:disabled { opacity: .6; }
.accnote { margin-top: 12px; font-size: 13px; }
.ferr { color: var(--error); font-size: 14px; margin: 6px 0 0; }
.ferr:empty { display: none; }
.accuser { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.accuser b { display: block; word-break: break-all; } .accuser small { display: block; color: var(--text-2); font-size: 13px; word-break: break-all; }
.avatar { position: relative; overflow: hidden; }
.avatar img, .accpic img, .mavatar > span > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.mi.accpic { position: relative; overflow: hidden; border-radius: 50%; background: var(--blue-light); color: var(--blue); font-weight: 700; display: grid; place-items: center; }
.accsync { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; font-weight: 600; }
.accsync small { flex-basis: 100%; color: var(--text-2); font-weight: 500; font-size: 13px; }
.accsync .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-2); }
.accsync .dot.ok { background: #16B76A; } .accsync .dot.busy { background: var(--blue); animation: accpulse 1s infinite alternate; } .accsync .dot.warn { background: #F4A340; }
@keyframes accpulse { to { opacity: .3; } }
.btn span svg { width: 18px; height: 18px; vertical-align: -3px; }
.list-btn.dangertext .lk { color: var(--error); }

/* 0.13.2 หน้าเข้าสู่ระบบ (แบบ D + ปุ่มกรมท่าแบบ B) — พื้นเทาอ่อน · กล่องขาวกลางจอ · รูปงาน 3 ใบเหนือกล่อง */
html.gated #nav, html.gated #sheet, html.gated #stage, html.gated #note-ui, html.gated #page { visibility: hidden; }
#login { --ui: "Inter", "Noto Sans Thai Looped", "Thonburi", "Leelawadee UI", Tahoma, sans-serif; --ez: cubic-bezier(.2,.8,.2,1);
  position: fixed; inset: 0; z-index: 1000; overflow-y: auto; display: flex; flex-direction: column; align-items: center;
  padding: max(26px, env(safe-area-inset-top)) 18px max(22px, var(--safe-b)); background: #F4F5F8; color: var(--ink); font-family: var(--ui); }
.lg-top { display: flex; align-items: center; gap: 8px; margin-bottom: 92px; font: 700 17px/1 var(--ui); }
.lg-top img { border-radius: 7px; }
.lg-card { width: 100%; max-width: 400px; margin: auto 0; padding: 30px 22px 22px; background: #fff; border-radius: 22px; text-align: center;
  box-shadow: 0 1px 2px rgba(11,27,77,.05), 0 18px 40px -24px rgba(11,27,77,.3); }
/* รูปงาน 3 ใบโผล่เหนือกล่อง — ตอนเปิดคลี่ออกจากกองเดียว (การเคลื่อนไหวเดียวของหน้า) */
.lg-stack { display: flex; justify-content: center; margin: -66px 0 20px; }
.lg-stack img { width: 66px; height: 66px; object-fit: cover; border-radius: 18px; border: 4px solid #fff; background: var(--surface);
  box-shadow: 0 10px 18px -10px rgba(11,27,77,.55); animation: lg-fan .8s var(--ez) both; animation-delay: calc(.08s + var(--i) * 60ms); }
.lg-stack img:nth-child(1) { --t: 14px; --r: -9deg; rotate: var(--r); margin-right: -14px; }
.lg-stack img:nth-child(2) { --t: 0px; --r: 0deg; z-index: 1; translate: 0 -8px; }
.lg-stack img:nth-child(3) { --t: -14px; --r: 9deg; rotate: var(--r); margin-left: -14px; }
@keyframes lg-fan { from { opacity: 0; transform: translateX(var(--t)) translateY(14px) scale(.86); rotate: 0deg; } }
.lg-card h1 { margin: 0; font: 700 26px/1.25 var(--ui); letter-spacing: -.01em; }
.lg-sub { margin: 8px 0 22px; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.lg-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--ink); color: #fff; font: 600 16px var(--ui); white-space: nowrap; cursor: pointer; box-shadow: 0 10px 22px -12px rgba(11,27,77,.7); transition: background .15s, transform .12s; }
.lg-btn:hover { background: #16296A; } .lg-btn:active { transform: scale(.985); } .lg-btn:disabled { opacity: .75; cursor: default; }
.lg-btn:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 3px; }
.lg-ic { display: grid; place-items: center; width: 30px; height: 30px; margin-left: -10px; border-radius: 50%; background: #fff; flex: none; }
.lg-ic svg { width: 18px; height: 18px; display: block; }
.lg-err { margin: 12px 0 0; color: var(--error); font-size: 14px; line-height: 1.45; } .lg-err:empty { display: none; }
.lg-foot { margin: 14px 0 0; color: #8A94A8; font-size: 12.5px; line-height: 1.6; }
.lg-back, .lg-space { margin-top: 32px; }
.lg-back { color: var(--text-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .lg-stack img { animation: none; } }
/* 0.14.1 ทางเข้าอื่น: Facebook · Apple · อีเมล — ปุ่มรองสีเทาอ่อน (แบบ fastwork) ใต้ปุ่ม Google สีกรมท่า */
.lg-choose, .lg-form { display: grid; gap: 10px; }
.lg-choose[hidden], .lg-mail[hidden], .lg-form[hidden] { display: none; }
.lg-btn.alt { background: #EEF0F4; color: var(--ink); box-shadow: none; font-weight: 600; }
.lg-btn.alt:hover { background: #E3E6EC; }
.lg-btn.alt .lg-ic { background: transparent; }
.lg-btn.alt .lg-ic svg { width: 20px; height: 20px; }
/* ปุ่มที่ยังไม่เปิดใช้ (Apple) — จาง กดไม่ได้ มีป้าย "เร็ว ๆ นี้" */
.lg-btn.soon, .lg-btn.soon:disabled { opacity: .45; cursor: not-allowed; }
.lg-btn.soon:hover { background: #EEF0F4; } .lg-btn.soon:active { transform: none; }
.lg-soon { padding: 3px 8px; border-radius: 999px; background: #D9DDE5; color: var(--text-2); font: 600 11.5px/1 var(--ui); }
.lg-in { width: 100%; min-height: 52px; padding: 0 18px; border: 1.5px solid #D9DDE5; border-radius: 14px; background: #fff; color: var(--ink);
  font: 500 16px var(--ui); text-align: center; }
.lg-in:focus { outline: none; border-color: var(--ink); }
.lg-in.code { font: 700 24px/1 var(--ui); letter-spacing: .4em; padding-left: calc(18px + .4em); }
.lg-in.code::placeholder { font: 500 16px var(--ui); letter-spacing: 0; }
.lg-link[hidden] { display: none; }
.lg-note { margin: 0 0 2px; color: var(--text-2); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.lg-links { display: flex; justify-content: center; gap: 18px; margin-top: 4px; }
.lg-link { border: 0; background: none; padding: 8px 4px; color: var(--text-2); font: 500 14px var(--ui); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lg-link:disabled { opacity: .5; cursor: default; }

/* ================= 0.14 หน้าเขียนแบบ Canva: ทุกอย่างเป็นชิ้นที่จับได้ · รูปทรง/เส้นเชื่อม · ซูม · แผงหน้า ================= */
/* กรอบเลือก: เส้นทึบบาง มุมกลม 4 จุด ขอบเป็นแท่ง · ปุ่มหมุนใต้กรอบ (ขนาดคงที่บนจอเสมอด้วย --inv) */
.sk-layer .sk-selbox { border: calc(1.5px * var(--inv, 1)) solid var(--blue); border-radius: calc(3px * var(--inv, 1)); background: none; transform-origin: 50% 50%; box-shadow: 0 0 0 calc(.5px * var(--inv, 1)) rgba(255,255,255,.8); }
.sk-h { position: absolute; box-sizing: border-box; background: #fff; border: calc(1.5px * var(--inv, 1)) solid rgba(11,27,77,.22); box-shadow: 0 calc(1px * var(--inv, 1)) calc(4px * var(--inv, 1)) rgba(11,27,77,.3);
  width: calc(14px * var(--inv, 1)); height: calc(14px * var(--inv, 1)); border-radius: 50%; margin: calc(-7px * var(--inv, 1)) 0 0 calc(-7px * var(--inv, 1)); }
.sk-h[data-h="nw"] { left: 0; top: 0; } .sk-h[data-h="ne"] { left: 100%; top: 0; } .sk-h[data-h="se"] { left: 100%; top: 100%; } .sk-h[data-h="sw"] { left: 0; top: 100%; }
.sk-h[data-h="n"], .sk-h[data-h="s"] { left: 50%; width: calc(22px * var(--inv, 1)); height: calc(8px * var(--inv, 1)); border-radius: calc(4px * var(--inv, 1)); margin: calc(-4px * var(--inv, 1)) 0 0 calc(-11px * var(--inv, 1)); }
.sk-h[data-h="n"] { top: 0; } .sk-h[data-h="s"] { top: 100%; }
.sk-h[data-h="e"], .sk-h[data-h="w"] { top: 50%; width: calc(8px * var(--inv, 1)); height: calc(22px * var(--inv, 1)); border-radius: calc(4px * var(--inv, 1)); margin: calc(-11px * var(--inv, 1)) 0 0 calc(-4px * var(--inv, 1)); }
.sk-h[data-h="e"] { left: 100%; } .sk-h[data-h="w"] { left: 0; }
.sk-selbox[data-kind="multi"] .sk-h[data-h="n"], .sk-selbox[data-kind="multi"] .sk-h[data-h="s"], .sk-selbox[data-kind="multi"] .sk-h[data-h="e"], .sk-selbox[data-kind="multi"] .sk-h[data-h="w"],
.sk-selbox[data-kind="texts"] .sk-h[data-h="n"], .sk-selbox[data-kind="texts"] .sk-h[data-h="s"] { display: none; }
.sk-selbox[data-kind="multi"] { border-style: dashed; }
.sk-rot { position: absolute; left: 50%; top: 100%; display: grid; place-items: center; width: calc(28px * var(--inv, 1)); height: calc(28px * var(--inv, 1)); margin-left: calc(-14px * var(--inv, 1)); margin-top: calc(26px * var(--inv, 1));
  border-radius: 50%; background: #fff; color: var(--ink); box-shadow: 0 0 0 calc(1px * var(--inv, 1)) rgba(11,27,77,.14), 0 calc(3px * var(--inv, 1)) calc(8px * var(--inv, 1)) rgba(11,27,77,.28); }
.sk-rot svg { width: 60%; height: 60%; }
.sk-ends { position: absolute; inset: 0; }
.sk-end { position: absolute; width: calc(16px * var(--inv, 1)); height: calc(16px * var(--inv, 1)); margin: calc(-8px * var(--inv, 1)) 0 0 calc(-8px * var(--inv, 1)); border-radius: 50%;
  background: #fff; border: calc(2.5px * var(--inv, 1)) solid var(--blue); box-shadow: 0 calc(1px * var(--inv, 1)) calc(5px * var(--inv, 1)) rgba(10,108,241,.4); }
.sk-end.on { background: var(--blue); border-color: #fff; box-shadow: 0 0 0 calc(1.5px * var(--inv, 1)) var(--blue); }
/* แถบเมนูลอยเหนือสิ่งที่เลือก */
.sk-selbar { flex-direction: column; gap: 4px; padding: 4px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(11,27,77,.08), 0 14px 30px -12px rgba(11,27,77,.5); max-width: calc(100vw - 16px); }
.sk-selrow { display: flex; align-items: center; gap: 1px; }
.sk-selbar button { color: var(--ink); padding: 0; width: 38px; height: 38px; justify-content: center; border-radius: 10px; }
.sk-selbar button:active, .sk-selbar button:hover { background: var(--surface); }
.sk-selbar button.del { color: var(--error); }
.sk-selbar svg { width: 19px; height: 19px; }
.sk-sep { width: 1px; height: 22px; margin: 0 3px; background: #E3E8F0; flex: none; }
.sk-swb i { width: 22px; height: 22px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(11,27,77,.15); }
.sk-swb[aria-expanded="true"] { background: var(--surface); }
.sk-selpal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 6px 4px; border-top: 1px solid #EDF0F5; }
.sk-selpal button { width: 26px !important; height: 26px !important; border-radius: 50% !important; background: var(--sw) !important; box-shadow: inset 0 0 0 1px rgba(11,27,77,.12); }
.sk-selpal button[aria-pressed="true"] { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px var(--sw); }
.sk-badge { position: absolute; z-index: 9; padding: 4px 9px; border-radius: 9px; background: var(--ink); color: #fff; font: 700 12.5px Inter, sans-serif; pointer-events: none; }
/* รูปทรงในแถบตัวเลือก: แถวเลื่อนข้างได้บนจอเล็ก */
.sk-opts .sk-kinds { max-width: 100%; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.sk-opts .sk-kinds::-webkit-scrollbar { display: none; }
.sk-opts .sk-kinds button { flex: none; }
.sk-opts[data-tool="shape"] .sk-kinds { order: 0; flex-basis: 100%; justify-content: center; }
@media (max-width: 520px) { .sk-opts[data-tool="shape"] .sk-kinds { justify-content: flex-start; } }
.sk-ta.in-shape { text-align: center; font-weight: 600; line-height: 1.3; background: rgba(10,108,241,.04); }
/* ซูม: จอใหญ่มีแถบ − % + พอดีหน้า มุมขวาล่าง (จอเล็กใช้ปุ่ม % เดิม) */
.sk-zbar { position: absolute; z-index: 6; right: 14px; bottom: calc(14px + var(--safe-b)); display: none; align-items: center; gap: 2px; padding: 4px; border-radius: 20px;
  background: rgba(255,255,255,.86); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 0 0 1px rgba(11,27,77,.07), 0 10px 24px -14px rgba(11,27,77,.5); }
.sk-zb { width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; color: var(--ink); }
.sk-zb:hover, .sk-zpct:hover { background: rgba(11,27,77,.06); }
.sk-zb svg { width: 17px; height: 17px; }
.sk-zpct { min-width: 52px; height: 32px; border-radius: 16px; font: 600 13px Inter, sans-serif; color: var(--ink); }
@media (min-width: 900px) { .sk-zbar { display: flex; } .sk > .sk-zoom { display: none !important; } }
/* แผงทุกหน้าทางซ้าย (จอ ≥ 1100 px) */
.sk-side { position: absolute; z-index: 5; left: 12px; top: calc(66px + env(safe-area-inset-top, 0px)); bottom: 14px; width: 150px; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden;
  background: rgba(255,255,255,.86); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 0 0 1px rgba(11,27,77,.07), 0 14px 30px -18px rgba(11,27,77,.5); }
.sk-side-h { margin: 0; padding: 12px 14px 6px; font: 600 12.5px var(--disp); color: var(--text-2); }
.sk-side-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 10px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; }
.sk-sp { position: relative; display: block; width: 100%; padding: 0; border-radius: 6px; }
.sk-sp canvas { display: block; width: 100%; height: auto; border-radius: 5px; box-shadow: 0 0 0 1px rgba(11,27,77,.1), 0 6px 12px -8px rgba(11,27,77,.5); }
.sk-sp.on canvas { box-shadow: 0 0 0 2.5px var(--blue), 0 6px 12px -6px rgba(10,108,241,.5); }
.sk-sp b { position: absolute; left: 6px; bottom: 6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: rgba(11,27,77,.78); color: #fff; font: 700 11px/20px Inter, sans-serif; text-align: center; }
.sk-sp.on b { background: var(--blue); }
.sk-sp:hover canvas { transform: translateY(-1px); }
.sk-sp-add { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 14px 12px; height: 38px; border-radius: 12px; border: 1.5px dashed #CBD3E1; color: var(--text-2); font: 600 13px var(--disp); }
.sk-sp-add svg { width: 16px; height: 16px; }
.sk-sp-add:hover { border-color: var(--blue); color: var(--blue); }
.sk-opts[data-tool="shape"] { max-width: min(100%, 600px); }
.lg-foot a { color: inherit; }

/* 0.16.1 กล่องแจ้งเตือนใช้ฟอนต์เดียวกับหน้าฉัน (Anuphan) ไม่ใช่ Inter/Noto Looped ของกล่องทั่วไป */
.nt-box, .nt-box .btn, .nt-box .flabel { font-family: var(--disp); }
.modal:has(.nt-box) .mhead h2 { font-family: var(--disp); font-weight: 700; }

/* 0.16 แจ้งเตือนรายวิชา: วิชาละบรรทัด = จุดสี · ชื่อ · เวลา (แตะเปลี่ยน) · สวิตช์ */
.rm-list { margin: 4px 0 6px; }
.rm-row { display: flex; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--border); }
.rm-row:last-child { border-bottom: 0; }
.rm-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.rm-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-row.off .rm-name { color: var(--text-2); font-weight: 500; }
.rm-time { position: relative; flex: none; min-width: 78px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.rm-time b { font: 700 17px "Anuphan", "Noto Sans Thai Looped", sans-serif; color: var(--ink); font-variant-numeric: tabular-nums; }
.rm-row.off .rm-time b { color: var(--text-2); font-weight: 600; font-size: 15px; }
.rm-time input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.rm-sw { position: relative; flex: none; width: 48px; height: 28px; border-radius: 14px; background: #CBD3E1; transition: background .2s; }
.rm-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(11, 27, 77, .25); transition: transform .2s; }
.rm-sw[aria-checked="true"] { background: var(--green); }
.rm-sw[aria-checked="true"]::after { transform: translateX(20px); }
.rm-note { font-size: 13.5px; line-height: 1.5; }
/* 0.23.1 ถามเปิดแจ้งเตือนครั้งแรก: หน้าตาแบบกล่องของระบบ (กลางจอ · 2 ปุ่มแบ่งครึ่ง) */
.pa { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(11,27,77,.32); opacity: 0; transition: opacity .2s; }
.pa.show { opacity: 1; }
.pa-box { width: min(300px, 100%); border-radius: 18px; background: rgba(250,251,253,.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); text-align: center; overflow: hidden;
  transform: scale(1.08); transition: transform .22s cubic-bezier(.2,.9,.3,1.2); font-family: var(--disp); box-shadow: 0 20px 50px -20px rgba(11,27,77,.45); }
.pa.show .pa-box { transform: none; }
.pa-ic { width: 52px; height: 52px; margin: 22px auto 10px; border-radius: 14px; display: grid; place-items: center; background: #0A6CF1; color: #fff; }
.pa-ic svg { width: 28px; height: 28px; }
.pa-box h2 { margin: 0 18px 4px; font-size: 17px; font-weight: 700; color: var(--ink); }
.pa-box p { margin: 0 18px 18px; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.pa-acts { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(11,27,77,.12); }
.pa-acts button { height: 48px; font: 500 17px var(--disp); color: #0A6CF1; }
.pa-acts button + button { border-left: 1px solid rgba(11,27,77,.12); }
.pa-acts .pa-yes { font-weight: 700; }
.pa-acts button:active { background: rgba(11,27,77,.06); }
@media (prefers-reduced-motion: reduce) { .pa, .pa-box { transition: none; } }
/* 0.23.1 การแจ้งเตือน = สวิตช์เดียว */
.nt-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface); margin-bottom: 12px; }
.nt-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.nt-txt b { font-size: 17px; color: var(--ink); }
.nt-txt span { font-size: 14px; color: var(--text-2); }
.nt-row .rm-sw { width: 52px; height: 30px; border-radius: 15px; }
.nt-row .rm-sw::after { width: 24px; height: 24px; }
.nt-row .rm-sw[aria-checked="true"]::after { transform: translateX(22px); }
.rm-sw:disabled { opacity: .45; }
.nt-box #nt-test { margin-top: 12px; }
.nacts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.nt-off { color: var(--error); }
.nwarn { padding: 12px 14px; border-radius: 12px; background: #FFF4D1; color: #6B4A00; font-size: 14.5px; line-height: 1.5; }
.nios ol { margin: 10px 0 6px; padding-left: 22px; line-height: 1.7; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .rm-sw, .rm-sw::after { transition: none; } }

/* ================= 0.18 หน้าโน้ตงาน: โครงเดียว + ธีมโน้ต 4 แบบ (features/notestyle.js) =================
   โครง (ทุกธีม · ทุกสถานะ): รูปโน้ต = หน้าปกแนวตั้ง (สูง --fcover จาก home.js) · แผ่นล่าง = หัว · เส้นเวลา · ปุ่มหลัก · กระดาษโน้ต
   ธีมกำหนดแค่ค่าสี/กรอบ/ตัวอักษรด้านล่าง (body.nt-clean / nt-photo / nt-book / nt-night) · --c0 = สีรูปโน้ต (ไม่มีรูป = สีวิชา) */
body {
  --n-ink: #0B1B4D; --n-sub: #5E6B85; --n-track: #E3E8F1; --n-fill: #0A6CF1; --n-urgent: #E2453A;
  --n-sheet: #fff; --n-sheet-r: 28px; --n-sheet-sh: 0 -8px 28px -20px rgba(11,27,77,.28);
  --n-1bg: linear-gradient(180deg, #2B82FF, #0A6CF1); --n-1ink: #fff; --n-fin: #0B1B4D; --n-finink: #fff;
  --n-2bg: #F1F4F9; --n-2ink: #0B1B4D; --n-2bd: transparent; --n-btn-r: 20px; --n-btn-sh: 0 12px 22px -12px rgba(11,27,77,.45);
  --n-chrome: #fff; --n-chrome-ink: #0B1B4D; --n-chrome-bd: transparent; --n-dot: #0B1B4D; --n-dot-off: rgba(11,27,77,.2);
  --n-paper: #F4F6FA; --n-paper-ink: #1D2B55; --n-paper-sub: #8D97AE; --n-paper-line: #E6ECF6; --n-margin: rgba(226,69,58,.35);
  --n-tool: rgba(10,108,241,.08); --n-tool-ink: #0A6CF1; --n-title: inherit;
}
body.nt-photo { --n-ink: #fff; --n-sub: rgba(255,255,255,.72); --n-track: rgba(255,255,255,.2); --n-fill: #fff; --n-urgent: #FF9A8F;
  --n-sheet: color-mix(in srgb, var(--fsc, #0A6CF1) 28%, #0C0F17); --n-sheet-r: 0px; --n-sheet-sh: none;
  --n-1bg: #fff; --n-1ink: #0B1B4D; --n-fin: #fff; --n-finink: #0B1B4D;
  --n-2bg: rgba(255,255,255,.14); --n-2ink: #fff; --n-2bd: rgba(255,255,255,.2); --n-btn-sh: 0 12px 24px -12px rgba(0,0,0,.5);
  --n-chrome: rgba(255,255,255,.16); --n-chrome-ink: #fff; --n-chrome-bd: rgba(255,255,255,.18); --n-dot: #fff; --n-dot-off: rgba(255,255,255,.3);
  --n-paper: rgba(255,255,255,.09); --n-paper-ink: #fff; --n-paper-sub: rgba(255,255,255,.6); --n-tool: rgba(255,255,255,.12); --n-tool-ink: #fff; }
body.nt-book { --n-sheet: #FFFDF6; --n-sheet-r: 26px; --n-sheet-sh: 0 -2px 0 #0B1B4D, 0 -14px 30px -18px rgba(11,27,77,.35);
  --n-1bg: #0A6CF1; --n-fin: #FFD84D; --n-finink: #0B1B4D; --n-2bg: #fff; --n-2bd: #0B1B4D; --n-btn-r: 16px; --n-btn-sh: 3px 3px 0 #0B1B4D;
  --n-chrome: #fff; --n-chrome-bd: #0B1B4D; --n-track: #fff; --n-paper: #fff; --n-paper-line: #D7E0EE; --n-margin: rgba(229,101,101,.6);
  --n-tool: #FFF6D6; --n-tool-ink: #0B1B4D; --n-title: var(--hand); }
body.nt-night { --n-ink: #E8ECF7; --n-sub: #8A93AD; --n-track: rgba(255,255,255,.1); --n-fill: #7FB6FF; --n-urgent: #FF8A7E;
  --n-sheet: #0E1222; --n-sheet-sh: 0 -1px 0 rgba(255,255,255,.07);
  --n-1bg: #2563D9; --n-fin: #2563D9; --n-2bg: rgba(255,255,255,.07); --n-2ink: #E8ECF7; --n-2bd: rgba(255,255,255,.1); --n-btn-sh: none;
  --n-chrome: rgba(255,255,255,.08); --n-chrome-ink: #E8ECF7; --n-chrome-bd: rgba(255,255,255,.1); --n-dot: #E8ECF7; --n-dot-off: rgba(255,255,255,.2);
  --n-paper: rgba(255,255,255,.045); --n-paper-ink: #C9D0E4; --n-paper-sub: #6F7894; --n-paper-line: rgba(255,255,255,.06); --n-margin: rgba(255,120,120,.28);
  --n-tool: rgba(127,182,255,.12); --n-tool-ink: #9CC6FF; }

/* ---------- ชั้นหลัง: พื้น + หน้าปก ---------- */
.nrow { transition: bottom .34s cubic-bezier(.2,.8,.2,1); }
body.focus-on .npage { --c0: var(--pc, var(--sc)); transition: background .5s; }
body.focus-on .npage .wm { display: none; }
body.focus-on:not(.nt-book) .npage .wash { display: none; }
body.focus-on .nrow { --card-w: min(80vw, 420px, calc(var(--fcover) * .82)); align-items: center; }
body.focus-on .nitem { height: var(--fcover); }
body.focus-on #stage .nitem:not(.empty) { border: 0; border-radius: 22px; box-shadow: 0 24px 44px -16px rgba(0,0,0,.45); }
/* เรียบ: สีพาสเทลจากโทนรูป (สีเดียวกับรูป แต่สว่างและใส) ด้านบน แล้วจางเป็นเกือบขาวก่อนถึงแผ่นขาว — ไม่มีรอยต่อ ไม่หม่น */
body.focus-on.nt-clean .npage {
  background: linear-gradient(180deg, color-mix(in oklab, var(--c0) 20%, #fff) 0%, color-mix(in oklab, var(--c0) 7%, #fff) 55%, #F8F9FC calc(100% - var(--low)));
  background: linear-gradient(180deg, oklch(from var(--c0) .935 .05 h) 0%, oklch(from var(--c0) .972 .022 h) 55%, #F8F9FC calc(100% - var(--low))); }
body.focus-on.nt-clean #stage .nitem:not(.empty) { border: 6px solid #fff; border-radius: 26px; box-shadow: 0 20px 36px -18px rgba(11,27,77,.32), 0 18px 40px -20px color-mix(in oklab, var(--c0) 70%, transparent); }
body.focus-on.nt-photo .npage { background: linear-gradient(180deg, color-mix(in srgb, var(--c0) 88%, #000) 0%, color-mix(in srgb, var(--c0) 48%, #0C0F17) calc(100% - var(--low) - 60px), color-mix(in srgb, var(--c0) 28%, #0C0F17) calc(100% - var(--low))); }
body.focus-on.nt-photo #stage .nitem:not(.empty) { box-shadow: 0 24px 48px -14px rgba(0,0,0,.6); }
body.focus-on.nt-book .npage { background: #F6F8FC; }
body.focus-on.nt-book #stage .nitem:not(.empty) { overflow: visible; border-radius: 4px; background: #fff; border: 10px solid #fff; border-bottom-width: 34px; box-shadow: 0 16px 28px -12px rgba(11,27,77,.4), 0 0 0 1px rgba(11,27,77,.06); transform: rotate(-1.2deg); }
body.focus-on.nt-book #stage .nitem:not(.empty) > :first-child { border-radius: 2px; }
body.focus-on.nt-book #stage .nitem.photo::before { display: none; } /* พื้นเบลอใต้รูปล้นออกนอกกรอบโพลารอยด์ */
body.focus-on.nt-night .npage { background: radial-gradient(90% 55% at 50% 22%, color-mix(in srgb, var(--c0) 34%, #0B0E1B), #070912 72%); }
body.focus-on.nt-night #stage .nitem:not(.empty) { border-radius: 18px; filter: brightness(.88); box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 24px 44px -16px #000; }

/* ---------- ปุ่มบน / จุดบอกหน้า / ป้ายปัดขึ้น ---------- */
body.note-mode.focus-on :is(#note-back, #note-hand, #note-clock, #note-chip) { background: var(--n-chrome); color: var(--n-chrome-ink); border: 1.5px solid var(--n-chrome-bd); box-shadow: 0 4px 14px -8px rgba(0,0,0,.4); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
body.note-mode.nt-book.focus-on :is(#note-back, #note-hand, #note-clock, #note-chip) { border-width: 2px; box-shadow: 3px 3px 0 #0B1B4D; }
body.note-mode.focus-on #note-chip .sib { background: transparent; color: inherit; }
body.note-mode.focus-on .pager i { background: var(--n-dot-off); }
body.note-mode.focus-on .pager i.on { background: var(--n-dot); }
body.note-mode.focus-on .pager small { color: var(--n-dot); opacity: .7; }
body.note-mode.focus-on .peek { background: none; border: 0; box-shadow: none; color: var(--n-sub); height: 28px; bottom: calc(var(--sheet-vis) + 6px); }
body.note-mode.nt-clean.focus-on .peek, body.note-mode.nt-book.focus-on .peek { color: #7A86A0; }

/* ---------- แผ่นล่าง ---------- */
body.note-mode.focus-on #sheet { background: var(--n-sheet); color: var(--n-ink); box-shadow: var(--n-sheet-sh); border-radius: var(--n-sheet-r) var(--n-sheet-r) 0 0; -webkit-backdrop-filter: none; backdrop-filter: none; left: 0; right: 0; bottom: 0; transition: transform .34s cubic-bezier(.2,.8,.2,1), background-color .5s; }
body.note-mode.nt-photo.focus-on #sheet { background: color-mix(in srgb, var(--fsc, #0A6CF1) 28%, #0C0F17); }
body.note-mode.focus-on .grab { background: transparent; } body.note-mode.focus-on .grab i { background: var(--n-track); }
body.note-mode.focus-on .pane-note { padding-top: 0; }
.fpane { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; color: var(--n-ink); padding: 0 2px; }
.fhead { display: flex; align-items: center; gap: 12px; }
.ft { flex: 1; min-width: 0; }
.fpane .ft h2 { margin: 0; font-size: 25px; line-height: 1.25; font-weight: 800; color: var(--n-ink); font-family: var(--n-title); letter-spacing: -.3px; -webkit-line-clamp: 1; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.fpane .ft h2 .ht { background: none; padding: 0; }
body.nt-book .fpane .ft h2 { font-size: 27px; letter-spacing: 0; font-weight: 700; }
body.nt-book .fpane .ft h2 .ht { background: linear-gradient(100deg, transparent 0 1%, #FFE27A 2% 97%, transparent 99%) 0 78% / 100% 46% no-repeat; padding: 0 4px; border-radius: 4px; }
#pane-note .fpane .iconbtn { background: var(--n-2bg); color: var(--n-2ink); border: 1.5px solid var(--n-2bd); box-shadow: none; border-radius: 50%; }
body.nt-book #pane-note .fpane .iconbtn { border-radius: 12px; border-width: 2px; box-shadow: 3px 3px 0 #0B1B4D; }
.fsub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; font-size: 13.5px; color: var(--n-sub); }
.fdot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 25%, transparent); }
.fdue { font-weight: 600; } .fdue.urgent { color: var(--n-urgent); font-weight: 700; }
.fstate { font-weight: 700; color: var(--n-ink); display: inline-flex; align-items: center; gap: 5px; }
.fstate::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--n-fill); animation: fblink 1.4s infinite; }
.fstate.paused { color: #D98A10; } .fstate.paused::before { background: #F0A030; animation: none; }
body.nt-photo .fstate.paused, body.nt-night .fstate.paused { color: #FFC266; }
.fstate.ok::before { display: none; }
.fstate svg { width: 14px; height: 14px; stroke-width: 3; }
#pane-note .fsub .timer { background: none; color: var(--n-sub); padding: 0; height: auto; margin: 0; font-size: 13px; font-weight: 600; }
@keyframes fblink { 50% { opacity: .25 } }
.fprog { display: grid; gap: 7px; }
.fbar { height: 6px; border-radius: 3px; background: var(--n-track); position: relative; overflow: hidden; }
body.nt-book .fbar { height: 10px; border-radius: 5px; border: 2px solid #0B1B4D; }
.ffill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--n-fill); transition: width .9s linear; }
.ftimes { display: flex; justify-content: space-between; font: 600 12px Inter, "Noto Sans Thai Looped", system-ui, sans-serif; color: var(--n-sub); font-variant-numeric: tabular-nums; }
.ftimes .over { color: var(--n-urgent); font-weight: 700; }
.ffill.over { background: var(--n-urgent); }
.fask[hidden] { display: none; }
.fpane:has(.fask:not([hidden])) :is(.fctl, .fpaper) { display: none; } /* ถามแทนที่ปุ่ม + กระดาษ (กลับมาเมื่อตอบ) — แผ่นสูงเท่าเดิม รูปไม่โดนบัง */
.fpane .fask { gap: 8px; padding: 10px 12px; }
.fpane .fasktx { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; }
.fpane .fasktx b { flex: none; } .fpane .fasktx small { overflow: hidden; text-overflow: ellipsis; }
.fpane .faskbt button { min-height: 44px; }
.fask { display: grid; gap: 10px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--n-urgent) 10%, transparent); border: 1.5px solid color-mix(in srgb, var(--n-urgent) 45%, transparent); }
.fasktx { display: grid; gap: 2px; } .fasktx b { font-size: 15px; } .fasktx small { font-size: 13px; color: var(--n-sub); }
.faskbt { display: flex; gap: 8px; }
.faskbt button { flex: 1; min-height: 40px; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 700; border: 1.5px solid var(--n-2bd); background: var(--n-2bg); color: var(--n-2ink); cursor: pointer; }
.faskbt button.pri { background: var(--n-urgent); border-color: transparent; color: #fff; }
.fctl { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; flex: none; }
.fctl.one { grid-template-columns: 1fr; }
.fplay, .ffinish, .fstart { height: 56px; border-radius: var(--n-btn-r); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 16px; transition: transform .12s; border: 1.5px solid var(--n-2bd); }
.fplay { background: var(--n-2bg); color: var(--n-2ink); }
.ffinish { background: var(--n-fin); color: var(--n-finink); box-shadow: var(--n-btn-sh); border-color: transparent; }
.fstart { background: var(--n-1bg); color: var(--n-1ink); box-shadow: var(--n-btn-sh); border-color: transparent; font-size: 18px; }
.fstart small { font-size: 13px; font-weight: 600; opacity: .75; }
body.nt-book :is(.fplay, .ffinish, .fstart) { border: 2px solid #0B1B4D; box-shadow: 3px 3px 0 #0B1B4D; }
.fplay svg, .ffinish svg, .fstart svg { width: 19px; height: 19px; }
.fstart svg { fill: currentColor; }
.fplay:active, .ffinish:active, .fstart:active { transform: scale(.97); }
body.nt-book :is(.fplay, .ffinish, .fstart):active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #0B1B4D; }
.fnextbtn { justify-content: space-between; padding: 0 16px; background: var(--n-1bg); color: var(--n-1ink); }
.fnext { display: grid; text-align: left; line-height: 1.15; min-width: 0; }
.fnext small { font-size: 12px; font-weight: 600; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* กล่องโน้ต: การ์ดเรียบ (ธีมสมุดเท่านั้นเป็นกระดาษมีเส้นบรรทัด + เส้นกั้นหน้า) — เต็มที่ว่างที่เหลือ ล่างจางหาย */
.fpaper { flex: 1; min-height: 60px; border-radius: 18px 18px 0 0; margin: 0 -2px calc(-16px - var(--safe-b)); padding: 12px 16px; color: var(--n-paper-ink); overflow: hidden; position: relative; display: flex; flex-direction: column;
  background: var(--n-paper); -webkit-mask-image: linear-gradient(#000 calc(100% - 36px), transparent); mask-image: linear-gradient(#000 calc(100% - 36px), transparent); }
body.nt-book .fpaper { padding-left: 30px; background: linear-gradient(90deg, transparent 20px, var(--n-margin) 20px 21.5px, transparent 21.5px), repeating-linear-gradient(180deg, var(--n-paper) 0 27px, var(--n-paper-line) 27px 28px); }
body.nt-book .fpaper { border: 2px solid #0B1B4D; border-bottom: 0; box-shadow: none; }
.fpaper header { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 800; color: var(--n-paper-sub); height: 28px; }
.fpaper p { margin: 0; font-size: 16px; line-height: 28px; font-weight: 600; white-space: pre-line; }
body.nt-book .fpaper p { font-family: var(--hand); font-size: 17px; }
.fpaper p.dim { color: var(--n-paper-sub); font-weight: 500; font-size: 14.5px; }
.ftools { display: flex; gap: 4px; }
.ftool { width: 32px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--n-tool-ink); background: var(--n-tool); }
.ftool svg { width: 16px; height: 16px; }
@media (max-height: 700px) { .fpane { gap: 10px; } .fpane .ft h2 { font-size: 22px; } .fplay, .ffinish, .fstart { height: 50px; } }
@media (prefers-reduced-motion: reduce) { .fstate::before, .nstamp { animation: none; } .ffill, .nrow { transition: none; } }
/* ตราปั๊มแบบครูปั๊มสมุด บนรูปโน้ตของงานที่เพิ่งเสร็จ */
.nstamp { position: absolute; z-index: 3; left: 50%; top: calc(64px + env(safe-area-inset-top, 0px) + 40px); transform: translateX(-30%) rotate(-12deg); border: 3px solid #E2453A; color: #E2453A; border-radius: 12px; padding: 4px 14px 6px; text-align: center; background: rgba(255,255,255,.88); line-height: 1.1; pointer-events: none; animation: fstamp .38s cubic-bezier(.2,1.6,.4,1) both; }
.nstamp b { display: block; font-size: 24px; font-weight: 800; }
.nstamp small { font: 700 10.5px Inter, system-ui, sans-serif; letter-spacing: .04em; }
@keyframes fstamp { from { transform: translateX(-30%) rotate(-12deg) scale(1.8); opacity: 0 } }

/* 0.18 แม่แบบหน้า + สติกเกอร์ (เมนู ⋯ ของสมุด) */
.sk-tpls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.sk-tpl { display: flex; flex-direction: column; gap: 3px; padding: 12px 10px; border-radius: 14px; background: var(--surface); text-align: left; }
.sk-tpl:active { background: var(--blue-light); }
.sk-tpl b { font: 700 14px var(--disp); color: var(--text); }
.sk-tpl small { font: 500 11.5px var(--disp); color: var(--text-2); }
.sk-sub { margin: 8px 2px 4px; font: 700 12px var(--disp); color: var(--text-2); }
.sk-stk { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.sk-stk button { aspect-ratio: 1; border-radius: 12px; font-size: 24px; line-height: 1; }
.sk-stk button:active { background: var(--blue-light); }
.sk-stk.txt { grid-template-columns: repeat(2, 1fr); }
.sk-stk.txt button { aspect-ratio: auto; padding: 9px 6px; font: 700 13.5px var(--disp); color: var(--red, #E45465); background: var(--surface); }

/* 0.19 แต่งข้อความ (แถบลอยตอนเลือก/พิมพ์) */
.sk-selbar button[aria-pressed="true"] { background: rgba(255,255,255,.2); }
.sk-selbar .sk-tbg { position: relative; }
.sk-selbar .sk-tbg::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 4px; height: 3px; border-radius: 2px; background: var(--sw); }
.sk-ta { border-radius: 6px; }

/* 0.19 แถบเครื่องมือมีชื่อใต้ไอคอน (เห็นแล้วรู้เลยว่าปุ่มไหนทำอะไร) */
.sk-tool { height: 56px; width: 50px; grid-template-rows: 26px 14px; align-content: center; gap: 1px; border-radius: 20px; }
.sk-tool span { font: 600 10.5px/1 var(--disp); letter-spacing: -.01em; white-space: nowrap; }
.sk-tool svg { width: 21px; height: 21px; justify-self: center; align-self: center; }
.sk-tool[aria-pressed="true"] svg { transform: translateY(-1px) rotate(-8deg); }
.sk-tool::after { bottom: 3px; }
.sk-tool[data-tool="add"] { color: #7C3AED; }
.sk-tool[data-tool="add"][aria-pressed="true"] { color: #fff; background: linear-gradient(135deg, #8B5CF6, #0A6CF1); }
.sk-tool[data-tool="add"][aria-pressed="true"] svg { transform: rotate(45deg); }
@media (max-width: 380px) { .sk-tool { width: 44px; } .sk-tool span { font-size: 9.5px; } }
.sk.ins-on .sk-opts { display: none; }

/* ปุ่ม "เริ่มจากแม่แบบ" บนหน้าว่าง */
.sk-tplchip { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; font: 700 14px var(--disp); color: #5B21B6;
  background: rgba(255,255,255,.92); box-shadow: inset 0 0 0 1.5px rgba(139,92,246,.35), 0 12px 24px -14px rgba(91,33,182,.6); animation: skpop .3s cubic-bezier(.3,1.4,.5,1); }
.sk-tplchip svg { width: 18px; height: 18px; }
.sk-tplchip[hidden] { display: none; }

/* แผง "+ เพิ่ม" แบบ Canva */
.sk-ins { position: absolute; z-index: 9; left: 50%; bottom: calc(84px + var(--safe-b)); width: min(560px, calc(100vw - 16px)); transform: translateX(-50%);
  max-height: min(58dvh, 520px); display: flex; flex-direction: column; border-radius: 24px; background: #fff;
  box-shadow: 0 0 0 1px rgba(11,27,77,.07), 0 28px 60px -22px rgba(11,27,77,.55); animation: skins .28s cubic-bezier(.2,.9,.25,1); }
@keyframes skins { from { opacity: 0; transform: translate(-50%, 24px); } }
.sk-ins[hidden] { display: none; }
.sk-ins-grab { width: 36px; height: 4px; margin: 8px auto 2px; border-radius: 2px; background: #D7DDE8; }
.sk-ins-tabs { display: flex; gap: 4px; padding: 4px 10px 8px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.sk-ins-tabs button { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 10px; border-radius: 14px; font: 600 12px var(--disp); color: var(--text-2); }
.sk-ins-tabs button svg { width: 20px; height: 20px; }
.sk-ins-tabs button[aria-selected="true"] { background: var(--blue-light); color: var(--blue); }
.sk-ins-body { overflow-y: auto; padding: 10px 12px 14px; overscroll-behavior: contain; }
.sk-ins-tip { margin: 0 2px 10px; font: 500 12.5px var(--disp); color: var(--text-2); }
.sk-ins-tpls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 400px) { .sk-ins-tpls { grid-template-columns: repeat(2, 1fr); } }
.sk-ins-tpl { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.sk-ins-tpl canvas { width: 100%; height: auto; border-radius: 10px; margin-bottom: 4px; box-shadow: 0 0 0 1px rgba(11,27,77,.1), 0 8px 16px -12px rgba(11,27,77,.5); transition: transform .2s; }
.sk-ins-tpl:active canvas { transform: scale(.96); }
.sk-ins-tpl b { font: 700 13.5px var(--disp); color: var(--text); }
.sk-ins-tpl small { font: 500 11px var(--disp); color: var(--text-2); }
.sk-ins-texts { display: flex; flex-direction: column; gap: 8px; }
.sk-ins-text { padding: 12px 14px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--border); text-align: left; line-height: 1.25; }
.sk-ins-text:active { transform: scale(.98); }
.sk-ins-shapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sk-ins-shapes button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 4px 9px; border-radius: 14px; background: var(--surface); color: var(--ink); font: 600 11px var(--disp); }
.sk-ins-shapes svg { width: 30px; height: 30px; }
.sk-ins-shapes button:active { background: var(--blue-light); }
.sk-ins .sk-stk { grid-template-columns: repeat(6, 1fr); }
.sk-ins .sk-stk button { font-size: 28px; }
.sk-ins .sk-stk.txt { grid-template-columns: repeat(2, 1fr); }
.sk-ins .sk-stk.txt button { font-size: 14px; }
.sk-ins-imgs { display: grid; gap: 10px; }
.sk-ins-imgs button { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--surface); text-align: left; }
.sk-ins-imgs svg { grid-row: span 2; width: 28px; height: 28px; justify-self: center; color: var(--blue); }
.sk-ins-imgs b { font: 700 15px var(--disp); } .sk-ins-imgs small { font: 500 12px var(--disp); color: var(--text-2); }
.sk-ta::placeholder { color: rgba(11,27,77,.32); }
.sk-ins-grab, .sk-ins-tabs { flex-shrink: 0; }

/* 0.20 โหมดท่องจำ */
.sk-memochip { position: absolute; z-index: 6; right: 12px; top: calc(70px + env(safe-area-inset-top, 0px)); display: flex; align-items: center; gap: 6px; padding: 7px 12px 7px 10px; border-radius: 999px;
  font: 700 13px var(--disp); color: #5B21B6; background: rgba(255,255,255,.94); box-shadow: inset 0 0 0 1.5px rgba(139,92,246,.35), 0 10px 20px -12px rgba(91,33,182,.6); animation: skpop .3s cubic-bezier(.3,1.4,.5,1); }
.sk-memochip svg { width: 18px; height: 18px; }
.sk-memochip[hidden], .sk-memo[hidden] { display: none; }
.sk.memo-on .sk-tools, .sk.memo-on .sk-opts, .sk.memo-on .sk-tplchip, .sk.memo-on .sk-selbar { display: none !important; }
.sk-memo { width: min(560px, calc(100vw - 20px)); padding: 12px 14px 14px; border-radius: 24px; background: #0B1B4D; color: #fff;
  box-shadow: 0 26px 50px -20px rgba(11,27,77,.7); animation: skins2 .3s cubic-bezier(.2,.9,.25,1); display: flex; flex-direction: column; gap: 10px; }
@keyframes skins2 { from { opacity: 0; transform: translateY(20px); } }
.sk-memo-exam { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: #FFF1F1; color: #7A1F24; }
.sk-memo-exam > b { display: grid; place-items: center; min-width: 40px; height: 40px; border-radius: 12px; background: #E5484D; color: #fff; font: 800 18px/1 var(--disp); }
.sk-memo-exam > b small { display: block; font: 600 9.5px/1 var(--disp); }
.sk-memo-exam span { display: flex; flex-direction: column; } .sk-memo-exam strong { font: 700 14px var(--disp); } .sk-memo-exam span small { font: 500 12px var(--disp); opacity: .8; }
.sk-memo-head { display: flex; align-items: center; gap: 10px; font: 600 13px var(--disp); }
.sk-memo-head > span { display: flex; align-items: center; gap: 6px; font-size: 14.5px; } .sk-memo-head svg { width: 19px; height: 19px; color: #C4B5FD; }
.sk-memo-head em { font-style: normal; opacity: .75; } .sk-memo-head strong { color: #7CF2B4; }
.sk-memo-x { margin-left: auto; width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.1); color: #fff; }
.sk-memo-x svg { width: 18px; height: 18px; }
.sk-memo-bar { position: relative; height: 6px; border-radius: 3px; background: rgba(255,255,255,.14); overflow: hidden; display: flex; }
.sk-memo-bar i { height: 100%; background: #16B76A; transition: width .35s; } .sk-memo-bar i.open { background: #74C0FC; }
.sk-memo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sk-memo-btns button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 48px; border-radius: 16px; font: 700 15.5px var(--disp); color: #fff; background: rgba(255,255,255,.12); }
.sk-memo-btns button svg { width: 18px; height: 18px; }
.sk-memo-btns button.ok { background: #FFD43B; color: #0B1B4D; } .sk-memo-btns button.again { background: #2A3A6E; }
.sk-memo-btns button:active { transform: scale(.97); }
.sk-memo-tip { margin: -2px 2px 0; font: 500 12px var(--disp); opacity: .7; text-align: center; }

/* 0.20 จดตอนครูสอน (การ์ดลอยเหนือแถบเครื่องมือ — เขียนไปฟังไปได้) */
.sk-class { width: min(560px, calc(100vw - 20px)); padding: 12px 12px 12px; border-radius: 24px; background: #fff; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 0 0 1px rgba(11,27,77,.07), 0 24px 48px -20px rgba(11,27,77,.55); animation: skins2 .3s cubic-bezier(.2,.9,.25,1); }
.sk-class[hidden] { display: none; }
.sk.class-on .sk-opts, .sk.class-on .sk-tplchip { display: none; }
.sk-class-head { display: flex; align-items: center; gap: 10px; }
.sk-class-head > span { display: flex; flex-direction: column; min-width: 0; }
.sk-class-head b { font: 700 13.5px var(--disp); color: #E5484D; } .sk-class-head small { font: 600 12px var(--disp); color: var(--text-2); font-variant-numeric: tabular-nums; }
.sk-class-mic { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #9AA5BB; }
.sk-class-mic.on { background: #E5484D; box-shadow: 0 0 0 0 rgba(229,72,77,.5); animation: skmic 1.6s infinite; }
@keyframes skmic { 70% { box-shadow: 0 0 0 12px rgba(229,72,77,0); } 100% { box-shadow: 0 0 0 0 rgba(229,72,77,0); } }
.sk-class-mic svg { width: 22px; height: 22px; }
.sk-class-wave { display: flex; align-items: center; gap: 3px; height: 26px; }
.sk-class-wave i { width: 3.5px; height: 30%; border-radius: 2px; background: #0A6CF1; animation: skwave 1s ease-in-out infinite; }
.sk-class-wave i:nth-child(2n) { animation-delay: -.3s; } .sk-class-wave i:nth-child(3n) { animation-delay: -.6s; } .sk-class-wave i:nth-child(5n) { animation-delay: -.15s; }
@keyframes skwave { 50% { height: 100%; } }
.sk-class .sk-memo-x { background: var(--surface); color: var(--text-2); }
.sk-class-q { margin: 0; padding: 2px 4px; max-height: 4.6em; overflow: hidden; font: 600 15px/1.5 var(--disp); color: var(--ink); }
.sk-class-q.empty { color: var(--text-2); font-weight: 500; }
.sk-class-btns { display: grid; grid-template-columns: 1fr 1fr 48px; gap: 8px; }
.sk-class-btns button { height: 46px; border-radius: 15px; font: 700 14.5px var(--disp); }
.sk-class-btns .place { background: #0B1B4D; color: #fff; } .sk-class-btns .task { background: var(--blue-light); color: var(--blue); }
.sk-class-btns .cam { display: grid; place-items: center; background: var(--surface); color: var(--ink); } .sk-class-btns .cam svg { width: 22px; height: 22px; }
.sk-class-btns button:active { transform: scale(.97); }
.sk-ins-imgs button.cls svg { color: #E5484D; }
.sk-ins-tip.sm { margin-top: 10px; font-size: 11px; }
@media (max-width: 400px) { .sk-ins-tabs button { padding: 7px 7px; font-size: 11px; } }
/* ================= 0.18.2 ลายเซ็นของแต่ละธีม (ไม่ใช่แค่สี) ================= */
/* ภาพ: รูปโน้ตเบลอเต็มจอเป็นพื้น · แผ่นล่างกระจกฝ้าเห็นรูปเบลอทะลุ — เหมือนอยู่ในรูป */
body.focus-on.nt-photo .npage::before { content: ""; position: absolute; inset: -90px; background: var(--ph, none) center / cover; filter: blur(42px) saturate(1.8) brightness(.8); transform: scale(1.08); pointer-events: none; }
body.focus-on.nt-photo .npage .wash { display: block; opacity: 1; background: linear-gradient(180deg, rgba(0,0,0,.18) 0%, transparent 22%, transparent 45%, color-mix(in srgb, var(--c0) 20%, rgba(8,10,16,.62)) calc(100% - var(--low))); }
body.note-mode.nt-photo.focus-on #sheet { background: color-mix(in srgb, var(--fsc, #0A6CF1) 20%, rgba(10,12,20,.5)); -webkit-backdrop-filter: blur(30px) saturate(1.5); backdrop-filter: blur(30px) saturate(1.5); border-radius: 28px 28px 0 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.14); }
body.focus-on.nt-photo #stage .nitem:not(.empty) { box-shadow: 0 30px 60px -18px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.08); }
body.nt-photo .fpaper { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* สมุด: ห่วงสันสมุดตามขอบบนแผ่น · เส้นเวลาเป็นไม้บรรทัดมีขีด แถบเวลาเหมือนปากกาเน้นข้อความ */
body.note-mode.nt-book.focus-on #sheet::before { content: ""; position: absolute; z-index: 3; top: -10px; left: 30px; right: 30px; height: 22px; pointer-events: none;
  background: radial-gradient(circle at 50% 70%, #F6F8FC 0 3.2px, #0B1B4D 3.4px 5.4px, transparent 5.8px) 0 0 / 26px 22px repeat-x,
    linear-gradient(90deg, transparent 0 9px, #8C96AE 9px 11px, transparent 11px) 0 0 / 26px 13px repeat-x; }
body.nt-book .fbar { height: 16px; border-radius: 4px; background: #fff
  repeating-linear-gradient(90deg, #0B1B4D 0 1.5px, transparent 1.5px 100%) 0 100% / 4% 5px repeat-x; overflow: hidden; }
body.nt-book .fbar::after { content: ""; position: absolute; inset: auto 0 0; height: 9px; pointer-events: none;
  background: repeating-linear-gradient(90deg, #0B1B4D 0 1.5px, transparent 1.5px 100%) 0 100% / 20% 9px repeat-x; }
body.nt-book .ffill { border-radius: 0; background: rgba(255,216,77,.85); border-right: 2px solid #0B1B4D; }
body.nt-book .ffill.over { background: rgba(226,69,58,.8); }
body.nt-book .ftimes { font-family: var(--hand); font-size: 13px; font-weight: 600; }

/* กลางคืน: สีอำพันอุ่นแทนสีฟ้า (แสงฟ้าน้อยลงตอนดึก) · ดาวจาง ๆ กับแสงจันทร์มุมบน · รูปหรี่อุ่นลง */
body.nt-night { --n-fill: #FFB454; --n-1bg: #FFB454; --n-1ink: #1C1305; --n-fin: #FFB454; --n-finink: #1C1305;
  --n-tool: rgba(255,180,84,.12); --n-tool-ink: #FFC879; --n-dot: #FFC879; }
body.focus-on.nt-night .npage::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .75;
  background:
    radial-gradient(70px 70px at 86% 8%, rgba(255,214,150,.22), transparent 70%),
    radial-gradient(1.4px 1.4px at 9% 12%, #fff, transparent), radial-gradient(1px 1px at 22% 6%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 35% 16%, #fff, transparent), radial-gradient(1px 1px at 61% 5%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 72% 18%, #fff, transparent), radial-gradient(1px 1px at 93% 22%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 5% 38%, #fff, transparent), radial-gradient(1px 1px at 96% 44%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 14% 58%, #fff, transparent), radial-gradient(1px 1px at 88% 62%, #fff, transparent); }
body.focus-on.nt-night #stage .nitem:not(.empty) { filter: brightness(.84) sepia(.12); }
body.nt-night .fstart small { opacity: .7; }

/* ทำเสร็จ: พลุกระดาษสั้น ๆ จากตราปั๊ม (ปิดเมื่อเครื่องตั้งลดการเคลื่อนไหว) */
.confetti { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; left: var(--x0); top: var(--y0); width: 8px; height: 12px; border-radius: 2px; background: var(--c); opacity: 0;
  animation: fconf 1.25s cubic-bezier(.15,.7,.35,1) var(--d) forwards; }
.confetti i:nth-child(3n) { width: 7px; height: 7px; border-radius: 50%; }
@keyframes fconf {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)); } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

/* 0.21 แถบคำสั่งของที่เลือก = แถบล่างมีชื่อ (แทนแถบเครื่องมือ) แบบ Canva บนมือถือ */
.sk.sel-on:not([data-tool="shape"]) .sk-opts, .sk.sel-on .sk-tplchip { display: none; }
.sk-selbar.dock { position: relative; z-index: 7; left: auto; right: auto; top: auto !important; bottom: auto; transform: none;
  width: min(620px, calc(100vw - 16px)); max-width: 100%; padding: 6px; border-radius: 24px; background: rgba(255,255,255,.97); flex-direction: column; gap: 4px;
  box-shadow: 0 0 0 1px rgba(11,27,77,.08), 0 22px 44px -18px rgba(11,27,77,.5); animation: skins2 .22s cubic-bezier(.2,.9,.25,1); }
.sk-selbar.dock .sk-selrow { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sk-selbar.dock .sk-selrow::-webkit-scrollbar { display: none; }
.sk-selbar.dock button { flex: none; flex-direction: column; gap: 3px; min-width: 58px; padding: 7px 6px 6px; border-radius: 16px; color: var(--ink); font: 600 10.5px/1.1 var(--disp); }
.sk-selbar.dock button svg { width: 21px; height: 21px; }
.sk-selbar.dock button:active, .sk-selbar.dock button[aria-pressed="true"] { background: var(--blue-light); color: var(--blue); }
.sk-selbar.dock button.del { color: var(--error, #E5484D); }
.sk-selbar.dock button.sk-done { color: #fff; background: var(--ink); }
.sk-selbar.dock button.sk-hot { color: #fff; background: var(--blue); }
.sk-selbar.dock .sk-swb i { flex: none; display: block; min-width: 22px; width: 22px; height: 22px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 2px rgba(255,255,255,.9), 0 0 0 1px rgba(11,27,77,.2); }
.sk-selbar.dock .sk-sep { flex: none; width: 1px; margin: 8px 3px; background: var(--border); }
.sk-selbar.dock .sk-tbg::after { left: 18px; right: 18px; bottom: 19px; }
.sk-selbar.dock .sk-selpal { padding: 4px 6px 2px; }
.sk-selhint { margin: 0 8px 4px; font: 500 11.5px var(--disp); color: var(--text-2); }
.sk-selpos { padding: 2px 4px 4px; border-top: 1px solid var(--border); }
.sk-selpos p { margin: 6px 4px 2px; font: 700 11px var(--disp); color: var(--text-2); }
.sk-selpos > div { display: flex; flex-wrap: wrap; gap: 2px; }
.sk-selbox.locked { border-style: dashed; }
.sk-selbox.locked .sk-h, .sk-selbox.locked .sk-rot, .sk.crop-on .sk-selbox .sk-rot { display: none; }
.sk.crop-on .sk-selbox { border-color: #fff; box-shadow: 0 0 0 1px rgba(11,27,77,.5); }

/* แผงเลเยอร์ */
.sk-lay[hidden] { display: none; }
.sk.lay-on.sel-on .sk-lay { bottom: calc(172px + var(--safe-b)); max-height: min(46dvh, 440px); }
.sk-lay-head { display: flex; align-items: center; gap: 8px; padding: 2px 12px 8px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sk-lay-head b { font: 700 15px var(--disp); } .sk-lay-head small { font: 500 12px var(--disp); color: var(--text-2); }
.sk-lay-head .sk-memo-x { margin-left: auto; background: var(--surface); color: var(--text-2); }
.sk-lay-row { display: flex; align-items: center; gap: 2px; border-radius: 14px; }
.sk-lay-row.on { background: var(--blue-light); }
.sk-lay-row > button { flex: none; width: 38px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--text-2); }
.sk-lay-row > button svg { width: 19px; height: 19px; }
.sk-lay-row .sk-lay-main { flex: 1; width: auto; display: flex; align-items: center; gap: 10px; padding: 0 8px; justify-content: flex-start; color: var(--ink); font: 600 14px var(--disp); text-align: left; min-width: 0; }
.sk-lay-main span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sk-lay-main em { flex: none; font: 700 10px var(--disp); font-style: normal; color: #7C3AED; background: #F1EBFF; padding: 2px 6px; border-radius: 6px; }
.sk-lay-row.lk .sk-lay-main { color: var(--text-2); } .sk-lay-row.lk .sk-lay-lk { color: var(--blue); }
.sk-selbar.dock .sk-selrow { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 22px; }

/* ================= 0.18.3 เก็บกวาด: ไม่ให้รกตา (เจ้าของ: "อย่าให้มันรกตาก็พอ") ================= */
/* ตัวเลขข้างจุดบอกหน้าซ้ำกับ "1/3" บนรูป → เหลือแค่จุด */
body.note-mode.focus-on .pager small { display: none; }
/* ก่อนเริ่มไม่มีเวลาให้บอก → ไม่ต้องมีเส้นเวลา (ปุ่มเริ่มทำบอกเวลาที่ตั้งไว้อยู่แล้ว) */
.fpane.is-todo .fprog { display: none; }
/* ปุ่มจดโน้ต: ไอคอนเปล่า ไม่มีพื้น (กดแล้วค่อยมีพื้น) — หัวกล่องโน้ตเบาลง */
.ftool { background: transparent; color: var(--n-paper-sub); width: 34px; height: 30px; }
.ftool:hover, .ftool:focus-visible { background: var(--n-tool); color: var(--n-tool-ink); }
.ftool:active { background: var(--n-tool); }
/* ป้ายวันที่บนรูปเล็กลง จางลง */
body.focus-on #stage .ntag { font-size: 10.5px; padding: 3px 8px; background: rgba(15,18,26,.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* 0.22 ปุ่มนาฬิกา (แทนปุ่มมือ) + กล่อง "เตือนงานนี้" */
#note-clock[hidden] { display: none; }
#note-clock b { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); font: 800 10.5px/1 Inter, var(--disp), sans-serif; background: var(--n-fill, var(--green)); color: #fff; padding: 3px 6px; border-radius: 7px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
body.nt-night #note-clock b, body.nt-photo #note-clock b { color: #1C1305; }
#note-clock.set .i { color: var(--n-fill, var(--green)); }
.tr-box { text-align: center; }
.tr-sub { margin: -4px 0 4px; color: var(--text-2); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-cur { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 6px 0 0; font-size: 14px; color: var(--ink); font-weight: 600; }
.tr-cur button { color: var(--error); font-weight: 700; font-size: 14px; }
.tr-mic { width: 96px; height: 96px; border-radius: 50%; margin: 34px auto 30px; display: grid; place-items: center; background: var(--green); color: #fff; transition: box-shadow .3s, transform .15s; }
.tr-mic svg { width: 40px; height: 40px; }
.tr-mic:active { transform: scale(.96); }
.tr-mic.on { box-shadow: 0 0 0 12px rgba(10,108,241,.14), 0 0 0 26px rgba(10,108,241,.06); animation: trpulse 1.4s ease-in-out infinite; }
@keyframes trpulse { 50% { box-shadow: 0 0 0 16px rgba(10,108,241,.18), 0 0 0 34px rgba(10,108,241,.05); } }
.tr-st { margin: 0; min-height: 21px; font-size: 14.5px; color: var(--text-2); }
.tr-st.bad { color: var(--error); }
.tr-heard { min-height: 8px; margin: 8px 0 0; }
.tr-heard b { font: 700 28px/1.25 var(--disp); color: var(--ink); }
.tr-ok { margin: 6px 0 18px; font: 700 17px var(--disp); color: var(--green); }
.tr-ex { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 0; }
.tr-ex button { height: 38px; padding: 0 14px; border-radius: 12px; background: var(--surface); color: var(--ink); font: 600 14.5px var(--disp); }
.tr-type { display: flex; gap: 8px; margin-top: 14px; }
.tr-type .field { flex: 1; min-width: 0; margin: 0; }
.tr-type .btn { flex: none; min-height: 48px; padding: 0 20px; }
.tr-warn { margin-top: 4px; text-align: left; }
.tr-link { display: block; margin: 16px auto 2px; color: var(--green); font-weight: 600; font-size: 14.5px; }
@media (prefers-reduced-motion: reduce) { .tr-mic.on { animation: none; } }

/* ================= 0.23 สอนใช้งาน (ทัวร์ทับแอปจริง) =================
   ช่องสว่าง = กล่องเดียว เงากว้างเต็มจอเป็นม่านมืด · ไหลระหว่างฉากด้วยสปริงเด้งนิด ๆ · ข้ามจอ = ไอริสปิดเป็นจุดแล้วเปิดใหม่ */
.tour { --disp: "Anuphan", "Noto Sans Thai Looped", sans-serif; --spr: cubic-bezier(.3,1.32,.45,1); --ez: cubic-bezier(.2,.8,.2,1);
  position: fixed; inset: 0; z-index: 62; overflow: hidden; font-family: var(--disp); opacity: 0; transition: opacity .3s var(--ez); }
.tour.in { opacity: 1; }
.tour.out { opacity: 0; transition-duration: .35s; }
body.tour-on #toast { z-index: 63; }
.tr-hole { position: absolute; left: 0; top: 0; width: var(--w); height: var(--h); border-radius: var(--r); pointer-events: none;
  transform: translate3d(var(--x), var(--y), 0);
  box-shadow: 0 0 0 200vmax rgba(6, 12, 34, .8), 0 0 0 1.5px rgba(255,255,255,.85), 0 0 34px 6px rgba(120,170,255,.35);
  transition: transform .62s var(--spr), width .62s var(--spr), height .62s var(--spr), border-radius .5s var(--ez), box-shadow .3s; }
.tr-hole::after { content: ""; position: absolute; inset: -7px; border-radius: calc(var(--r) + 7px); border: 2px solid rgba(255,255,255,.55); animation: trring 1.9s var(--ez) .5s infinite; }
.tr-hole.none::after, .tr-hole.iris::after { display: none; }
.tr-hole.none { box-shadow: 0 0 0 200vmax rgba(6, 12, 34, .8); }
.tr-hole.iris { transition: transform .28s cubic-bezier(.6,0,.8,.3), width .28s cubic-bezier(.6,0,.8,.3), height .28s cubic-bezier(.6,0,.8,.3), border-radius .2s; box-shadow: 0 0 0 200vmax rgba(6, 12, 34, .86); }
@keyframes trring { 0% { opacity: .9; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.06); } }

.tr-skip { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; height: 36px; padding: 0 14px; border-radius: 18px; z-index: 3;
  font: 600 14px var(--disp); color: rgba(255,255,255,.86); background: rgba(255,255,255,.12); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tour[data-scene="end"] .tr-skip { opacity: 0; pointer-events: none; }

.tr-card { position: absolute; left: 50%; width: min(360px, calc(100vw - 32px)); margin-left: calc(min(360px, calc(100vw - 32px)) / -2); z-index: 2;
  padding: 16px 16px 14px; border-radius: 24px; background: #fff; color: var(--ink); box-shadow: 0 24px 60px -18px rgba(0,0,0,.55);
  animation: trin .52s var(--spr) both; }
.tr-card.center { top: 50%; transform: translateY(-50%); padding: 22px 20px 16px; text-align: center; animation-name: trinc; }
.tr-card.out { animation: trout .24s cubic-bezier(.5,0,.9,.4) forwards; pointer-events: none; }
.tr-card.center.out { animation-name: troutc; }
.tr-card.out.rev { animation-name: troutr; }
@keyframes trin { from { opacity: 0; transform: translate3d(0, 22px, 0) scale(.94); filter: blur(8px); } }
@keyframes trinc { from { opacity: 0; transform: translateY(-50%) scale(.86); filter: blur(10px); } }
@keyframes trout { to { opacity: 0; transform: translate3d(0, -14px, 0) scale(.96); filter: blur(6px); } }
@keyframes troutr { to { opacity: 0; transform: translate3d(0, 14px, 0) scale(.96); filter: blur(6px); } }
@keyframes troutc { to { opacity: 0; transform: translateY(-50%) scale(.9); filter: blur(8px); } }
.tr-dots { display: flex; gap: 4px; margin-bottom: 10px; }
.tr-card.center .tr-dots { justify-content: center; }
.tr-dots i { width: 6px; height: 6px; border-radius: 3px; background: #E1E7F2; transition: width .4s var(--spr), background .3s; }
.tr-dots i.done { background: #B9CCF0; }
.tr-dots i.on { width: 20px; background: var(--blue); }
.tr-t { font: 700 21px/1.3 var(--disp); letter-spacing: -.02em; text-wrap: balance; }
.tr-card.center .tr-t { font-size: 26px; }
.tr-w { display: inline-block; animation: trword .6s var(--ez) both; animation-delay: calc(.12s + var(--k) * 45ms); }
@keyframes trword { from { opacity: 0; transform: translateY(.45em); filter: blur(6px); } }
.tr-s { margin-top: 4px; font: 500 14.5px/1.55 var(--disp); color: #5E6B85; animation: trword .6s var(--ez) .26s both; }
.tr-act { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tr-card.center .tr-act { justify-content: center; }
.tr-card.center .tr-act > span:empty { display: none; }
.tr-prev { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #F1F4FA; color: var(--ink); }
.tr-next { height: 46px; padding: 0 18px 0 22px; border-radius: 23px; display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: #fff; font: 600 15.5px var(--disp); transition: transform .15s; }
.tr-next:active { transform: scale(.96); }
.tr-next .i { width: 18px; height: 18px; }
.tr-card.center .tr-next { min-width: 180px; justify-content: center; }
.tr-card.final .tr-next { background: var(--blue); padding: 0 26px; }
.tr-badge { width: 54px; height: 54px; margin: -2px auto 12px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #0A6CF1, #7C4DFF); box-shadow: 0 10px 24px -8px rgba(10,108,241,.7); animation: trpop .7s var(--spr) .1s both; }
.tr-badge .i { width: 26px; height: 26px; stroke-width: 2.6; }
.tr-badge.spark { background: linear-gradient(140deg, #FFB454, #FF6B5E); box-shadow: 0 10px 24px -8px rgba(255,107,94,.7); }
@keyframes trpop { from { transform: scale(0) rotate(-40deg); opacity: 0; } }

/* นิ้วผี: วงขาวโปร่ง ทำท่าให้ดู วนซ้ำ */
.tr-ghost { position: absolute; left: var(--gx); top: var(--gy); width: 46px; height: 46px; margin: -23px 0 0 -23px; z-index: 1; pointer-events: none; opacity: 0; }
.tr-ghost i { position: absolute; inset: 0; border-radius: 50%; background: rgba(255,255,255,.88); box-shadow: 0 0 0 8px rgba(255,255,255,.22), 0 8px 22px rgba(0,0,0,.35); }
.tr-ghost.on { opacity: 1; transition: opacity .3s .35s; }
.tr-ghost.g-down i { animation: trgdown 1.7s var(--ez) .5s infinite; }
.tr-ghost.g-swipe i { animation: trgswipe 3s var(--ez) .5s infinite; }
.tr-ghost.g-side i { animation: trgside 2s var(--ez) .5s infinite; }
@keyframes trgdown { 0% { transform: translateY(-6px) scale(1.15); opacity: 0; } 15% { transform: translateY(0) scale(1); opacity: 1; } 70% { transform: translateY(150px) scale(1); opacity: 1; } 90%, 100% { transform: translateY(170px) scale(.8); opacity: 0; } }
@keyframes trgswipe { 0% { transform: translate(0, 60px) scale(1.15); opacity: 0; } 8% { transform: translate(0, 60px); opacity: 1; } 36% { transform: translate(0, -90px); opacity: 1; } 44% { opacity: 0; transform: translate(0, -100px) scale(.8); }
  52% { transform: translate(70px, 0) scale(1.15); opacity: 0; } 58% { transform: translate(70px, 0); opacity: 1; } 86% { transform: translate(-90px, 0); opacity: 1; } 94%, 100% { transform: translate(-100px, 0) scale(.8); opacity: 0; } }
@keyframes trgside { 0% { transform: translateX(-90px) scale(1.15); opacity: 0; } 12% { transform: translateX(-90px); opacity: 1; } 75% { transform: translateX(90px); opacity: 1; } 90%, 100% { transform: translateX(100px) scale(.8); opacity: 0; } }

.tr-burst { position: fixed; left: 50%; top: 46%; z-index: 64; pointer-events: none; }
.tr-burst i { position: absolute; width: 8px; height: 12px; border-radius: 2px; background: var(--c); animation: trbits 1.3s cubic-bezier(.15,.7,.3,1) var(--d) forwards; }
@keyframes trbits { from { transform: translate(0,0) rotate(0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tr-hole, .tr-hole.iris { transition: none; } .tr-ghost i, .tr-hole::after { animation: none !important; } }

/* ---------------------------------------------------------------- 0.24 ห้อง (แทนสมุด) — mockups/sabaii-room-profile.html */
.rm-head { margin-bottom: 4px; }
.rm-title { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; text-align: left; }
.rm-title h1 { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-title span svg { width: 22px; height: 22px; color: var(--text-2); }
.rm-err { font: 500 13.5px var(--disp); color: #A15C00; background: #FFF4DF; border-radius: 12px; padding: 8px 12px; margin: 6px 0; }
/* แถวหน้าเพื่อน: รูปโปรไฟล์ที่ใช้ล็อกอิน + จุดสถานะ (ฟ้า กำลังทำ · เขียว ออนไลน์ · เทา ออฟไลน์) */
.rm-row { display: flex; gap: 12px; overflow-x: auto; margin: 10px -16px 0; padding: 4px 16px 6px; scrollbar-width: none; }
.rm-row::-webkit-scrollbar { display: none; }
.rm-who { flex: none; width: 56px; display: flex; flex-direction: column; align-items: center; gap: 5px; font: 600 11.5px var(--disp); color: var(--ink); }
.rm-who > span:last-child { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-face { --s: 52px; position: relative; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: grid; place-items: center;
  background: hsl(var(--hue, 220) 70% 90%); color: hsl(var(--hue, 220) 45% 32%); }
.rm-face b { font: 700 calc(var(--s) * .4) var(--disp); line-height: 1; }
.rm-face img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.rm-dot { position: absolute; right: -1px; bottom: -1px; width: 31%; height: 31%; min-width: 9px; min-height: 9px; border-radius: 50%; border: 2.5px solid var(--dotbd, #fff); background: #A4ADBF; }
.rm-dot.on { background: #22B573; } .rm-dot.doing { background: #0A6CF1; }
.rm-more .rm-face { background: var(--surface); color: var(--text-2); }
.rm-more .rm-face b { font-size: 16px; font-family: Inter, sans-serif; }
/* ชื่อคอลัมน์ตัวใหญ่ = แท็บ */
.rm-lanes { display: flex; gap: 20px; align-items: baseline; margin: 18px 0 14px; }
.rm-lanes button { font: 600 17px var(--disp); color: #A0A9BC; position: relative; padding-bottom: 6px; }
.rm-lanes button sup { font: 700 11px Inter, sans-serif; margin-left: 3px; vertical-align: 7px; }
.rm-lanes button[aria-selected="true"] { font-size: 24px; font-weight: 700; color: var(--ink); }
.rm-lanes button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 12px; bottom: 0; height: 3px; border-radius: 2px; background: var(--ink); }
/* การ์ดของห้อง: พื้นสีวิชาอ่อน · วงแหวนเสร็จแล้วกี่คน */
.rm-cards { display: grid; gap: 10px; }
.rm-card { display: flex; gap: 12px; align-items: stretch; text-align: left; width: 100%; padding: 14px 14px 14px 16px; border-radius: 24px;
  background: color-mix(in srgb, var(--c) 10%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 14%, transparent); transition: transform .15s; }
.rm-card:active { transform: scale(.985); }
.rm-card.isdone { opacity: .72; }
.rm-card.isdone .rm-ct b { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.rm-ct { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.rm-ct b { font: 700 17px/1.3 var(--disp); color: var(--ink); }
.rm-ct small { font: 500 12.5px var(--disp); color: var(--text-2); }
.rm-due { font: 700 11.5px var(--disp); color: var(--ink); background: #fff; border-radius: 999px; padding: 2px 10px; margin-bottom: 4px; }
.rm-due.hot { color: #C8352B; }
.rm-doing { display: flex; align-items: center; gap: 6px; margin-top: 6px; font: 600 12px var(--disp); color: #1F8A5B; }
.rm-faces { display: flex; } .rm-faces .rm-face { margin-left: -6px; box-shadow: 0 0 0 2px #fff; } .rm-faces .rm-face:first-child { margin-left: 0; }
.rm-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 10px; }
.rm-side .si-box { width: 38px; height: 38px; border-radius: 12px; background: #fff; }
.rm-ring { position: relative; width: 46px; height: 46px; display: grid; place-items: center; }
.rm-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.rm-ring circle { fill: none; stroke: color-mix(in srgb, var(--c, #0A6CF1) 18%, #fff); stroke-width: 4.5; }
.rm-ring circle.on { stroke: var(--c, #0A6CF1); stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }
.rm-ring b { font: 800 12.5px Inter, sans-serif; color: var(--ink); line-height: 1; }
.rm-ring b small { font-size: 9px; color: var(--text-2); font-weight: 700; }
.rm-empty { text-align: center; padding: 34px 16px; border-radius: 24px; background: var(--surface); display: grid; gap: 6px; }
.rm-empty b { font: 700 17px var(--disp); }
.rm-empty small { font: 500 13.5px var(--disp); color: var(--text-2); }
.rm-add { margin-top: 16px; }
/* ยังไม่มีห้อง */
.rm-hello { text-align: center; padding: 22px 6px 0; }
.rm-demo { display: flex; justify-content: center; margin-bottom: 22px; }
.rm-demo .rm-face { margin-left: -10px; box-shadow: 0 0 0 3px #fff; animation: rmIn .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 70ms); }
.rm-demo .rm-face:first-child { margin-left: 0; }
@keyframes rmIn { from { opacity: 0; transform: translateY(10px) scale(.9); } }
@media (prefers-reduced-motion: reduce) { .rm-demo .rm-face { animation: none; } }
.rm-hello h2 { font: 700 26px var(--disp); letter-spacing: -.01em; }
.rm-hello > p { color: var(--text-2); margin: 8px auto 0; max-width: 34em; line-height: 1.6; }
.rm-cta { display: grid; gap: 10px; max-width: 360px; margin: 22px auto 0; }
.rm-note { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 18px; font: 500 12.5px var(--disp); color: var(--text-2); }
.rm-note svg { width: 15px; height: 15px; }
/* กล่อง */
.rm-code-in { text-align: center; font: 800 26px Inter, sans-serif; letter-spacing: .3em; text-transform: uppercase; }
.rm-code { display: flex; gap: 8px; justify-content: center; margin: 14px 0 6px; }
.rm-code span { width: 44px; height: 56px; border-radius: 14px; background: var(--surface); display: grid; place-items: center; font: 800 26px Inter, sans-serif; color: var(--ink); }
.rm-more-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; margin-top: 18px; }
.linkbtn { font: 600 14px var(--disp); color: var(--blue); padding: 6px 2px; }
.linkbtn.danger { color: var(--error); }
.rm-grp { font: 700 13px var(--disp); color: var(--text-2); margin: 14px 0 6px; }
.rm-members .rm-grp:first-child { margin-top: 0; }
.rm-mem { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.rm-mem.off { opacity: .55; }
.rm-mem span:last-child { display: flex; flex-direction: column; line-height: 1.35; }
.rm-mem b { font: 700 15px var(--disp); } .rm-mem small { font: 500 12.5px var(--disp); color: var(--text-2); }
.rm-meta { display: flex; align-items: center; gap: 12px; }
.rm-meta > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.rm-meta b { font: 700 15px var(--disp); } .rm-meta small { font: 500 13px var(--disp); color: var(--text-2); }
.rm-sheet .si-box { color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); }
.rm-seg { display: flex; background: var(--surface); border-radius: 16px; padding: 4px; }
.rm-seg button { flex: 1; min-height: 44px; border-radius: 12px; font: 700 15px var(--disp); color: var(--text-2); }
.rm-seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(11,27,77,.14); }
.rm-sheet-actions { display: grid; gap: 8px; margin-top: 18px; }
.rm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rm-chips button { font: 600 13.5px var(--disp); border-radius: 999px; padding: 6px 13px; background: var(--surface); color: var(--ink); }
.rm-chips button[aria-pressed="true"] { background: var(--c); color: #fff; }
.rm-switch .list-btn[aria-pressed="true"] .lk { color: var(--blue); }
.rm-switch .row2 { margin-top: 14px; }

/* ---------------------------------------------------------------- 0.25 โปรไฟล์แบบไอจี — mockups/sabaii-room-profile.html */
.pf-head h1 { font-size: 22px !important; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-addf { position: relative; }
.pf-badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--error); color: #fff; font: 800 11px/18px Inter, sans-serif; font-style: normal; padding: 0 5px; }
.pf-top { display: flex; align-items: center; gap: 18px; margin-top: 8px; }
.pf-ring { padding: 3px; border-radius: 50%; background: conic-gradient(#8B7CF6, #5BA8FF, #FF9DBB, #FFC47A, #8B7CF6); display: inline-flex; }
.pf-ring .rm-face { box-shadow: 0 0 0 3px #fff; }
.pf-stats { flex: 1; display: flex; }
.pf-stats div { flex: 1; text-align: center; display: flex; flex-direction: column; }
.pf-stats b { font: 800 20px Inter, sans-serif; color: var(--ink); }
.pf-stats small { font: 500 12.5px var(--disp); color: var(--text-2); }
.pf-who { margin-top: 10px; }
.pf-who b { font: 700 16px var(--disp); }
.pf-who p { font: 500 14px var(--disp); color: var(--text-2); margin-top: 2px; }
.pf-nudge { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin-top: 12px; padding: 12px 14px; border-radius: 18px; background: var(--blue-light); color: var(--ink); }
.pf-nudge > span:first-child svg { width: 22px; height: 22px; color: var(--blue); }
.pf-nudge > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.pf-nudge b { font: 700 15px var(--disp); } .pf-nudge small { font: 500 12.5px var(--disp); color: var(--text-2); }
.pf-nudge i svg { width: 16px; height: 16px; color: var(--text-2); }
.pf-btns { display: flex; gap: 8px; margin-top: 14px; }
.pbtn { flex: 1; min-height: 40px; border-radius: 13px; background: var(--surface); color: var(--ink); font: 700 14px var(--disp); display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 14px; }
.pbtn.p { background: var(--blue); color: #fff; }
.pbtn svg { width: 16px; height: 16px; }
.pf-tabs { display: flex; margin: 18px -16px 0; border-bottom: 1px solid var(--border); }
.pf-tabs button { flex: 1; padding: 11px 0; font: 700 14.5px var(--disp); color: #A0A9BC; }
.pf-tabs button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.pf-hint { font: 500 12.5px var(--disp); color: var(--text-2); text-align: center; margin: 10px 0 8px; }
.pf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 2px -16px 0; }
.pf-tile { position: relative; aspect-ratio: 1; background: var(--surface) center/cover; overflow: hidden; text-align: left; }
.pf-tile.txt { background: #FFF4D6; color: #6B4E00; padding: 8px; font: 600 12px/1.45 var(--disp); }
.pf-tile.txt span { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.pf-tile.missing::after { content: "รูปยังไม่ขึ้น"; position: absolute; inset: 0; display: grid; place-items: center; font: 600 11px var(--disp); color: var(--text-2); }
.pf-sh { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; color: var(--blue); }
.pf-sh svg { width: 13px; height: 13px; }
.pf-empty { text-align: center; padding: 36px 16px; display: grid; gap: 6px; justify-items: center; }
.pf-empty b { font: 700 16px var(--disp); } .pf-empty small { font: 500 13.5px var(--disp); color: var(--text-2); max-width: 30em; }
.pf-lock svg { width: 30px; height: 30px; color: var(--text-2); }
.pf-form .field { width: 100%; }
.pf-at { display: flex; align-items: center; gap: 6px; }
.pf-at span { font: 800 20px Inter, sans-serif; color: var(--text-2); }
.pf-note .pf-big { width: 100%; max-height: 52vh; object-fit: contain; border-radius: 16px; background: var(--surface); display: block; }
.pf-note .pf-big.bg { aspect-ratio: 4 / 3; background: var(--surface) center/contain no-repeat; }
.pf-bigtxt { white-space: pre-wrap; background: #FFF4D6; color: #4A3600; border-radius: 16px; padding: 16px; font: 600 16px/1.6 var(--disp); }
.pf-note .muted { margin-top: 10px; }
.pf-friends .field { width: 100%; margin-top: 14px; }
.pf-mycard { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--surface); }
.pf-mycard > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.pf-mycard b { font: 700 16px var(--disp); } .pf-mycard small { font: 500 12.5px var(--disp); color: var(--text-2); }
.pf-mycard .pbtn { flex: none; }
.pf-frow { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.pf-fwho { flex: 1; display: flex; align-items: center; gap: 12px; text-align: left; min-width: 0; }
.pf-fwho > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.pf-fwho b { font: 700 15px var(--disp); } .pf-fwho small { font: 500 12.5px var(--disp); color: var(--text-2); }
.pf-frow .pbtn { flex: none; min-height: 36px; }
.pf-fact { display: flex; gap: 6px; }
.pf-found:not(:empty) { margin-top: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.rm-mem { width: 100%; text-align: left; }
.mlist.me-prof { margin-top: 18px; }

/* ---------------------------------------------------------------- 0.26 อ่านด้วยกัน — แถบเหนือเมนูล่าง + ห้องอ่านโต๊ะยาว */
#study-bar { position: fixed; z-index: 34; left: 50%; transform: translateX(-50%); width: min(calc(100vw - 32px), 380px);
  bottom: calc(86px + var(--safe-b)); height: 54px; border-radius: 19px; background: #0B1B4D; color: #fff; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 8px;
  box-shadow: 0 14px 30px -10px rgba(11,27,77,.6); animation: sbIn .35s cubic-bezier(.2,.8,.2,1); }
#study-bar[hidden] { display: none; }
@keyframes sbIn { from { opacity: 0; transform: translate(-50%, 14px); } }
@media (prefers-reduced-motion: reduce) { #study-bar { animation: none; } }
body.has-study-bar #page { padding-bottom: calc(210px + var(--safe-b)); }
.sb-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; color: #fff; height: 100%; }
.sb-faces { display: flex; } .sb-faces .rm-face { margin-left: -7px; box-shadow: 0 0 0 2px #0B1B4D; } .sb-faces .rm-face:first-child { margin-left: 0; }
.sb-ico { width: 34px; height: 34px; border-radius: 11px; background: rgba(255,255,255,.12); display: grid; place-items: center; } .sb-ico svg { width: 19px; height: 19px; }
.sb-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sb-t b { font: 700 14px var(--disp); } .sb-t b.num { font: 800 17px Inter, sans-serif; font-variant-numeric: tabular-nums; }
.sb-t small { font: 500 11.5px var(--disp); opacity: .68; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-go { flex: none; height: 40px; padding: 0 16px; border-radius: 14px; background: var(--blue); color: #fff; font: 700 13.5px var(--disp); }
.sb-pause { flex: none; width: 40px; height: 40px; border-radius: 14px; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; }
.sb-pause svg { width: 18px; height: 18px; }
.sb-ring { width: 34px; height: 34px; position: relative; flex: none; }
.sb-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sb-ring circle { fill: none; stroke: rgba(255,255,255,.15); stroke-width: 4; } .sb-ring circle.on { stroke: #6BA6FF; stroke-linecap: round; }
.sb-pick .list-btn { padding: 13px 2px; }
#study { position: fixed; inset: 0; z-index: 60; background: radial-gradient(120% 60% at 50% 0%, #1B2C6B 0%, #0B1B4D 55%, #081236 100%); color: #fff; overflow-y: auto;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 18px calc(24px + var(--safe-b)); opacity: 0; transform: translateY(24px); transition: opacity .25s, transform .3s cubic-bezier(.2,.8,.2,1); }
#study.show { opacity: 1; transform: none; }
#study > * { max-width: 460px; margin-left: auto; margin-right: auto; }
.st-top { display: flex; justify-content: space-between; align-items: center; font: 600 13.5px var(--disp); color: rgba(255,255,255,.65); }
.st-min { display: flex; align-items: center; gap: 4px; color: rgba(255,255,255,.75); font: 600 14px var(--disp); padding: 6px 0; }
.st-min svg { width: 18px; height: 18px; }
.st-head { text-align: center; margin-top: 18px; }
.st-head small { display: block; font: 600 13.5px var(--disp); color: rgba(255,255,255,.7); }
.st-head b { display: block; font: 800 60px/1.05 Inter, sans-serif; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.st-table { display: grid; grid-template-columns: 1fr 74px 1fr; gap: 10px; margin-top: 28px; align-items: start; }
.st-side { display: grid; gap: 16px; }
.st-desk { border-radius: 20px; background: linear-gradient(#22336B, #1A2858); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); align-self: stretch; display: grid; align-content: space-around; justify-items: center; padding: 14px 0; }
.st-desk i { width: 40px; height: 26px; border-radius: 6px; background: rgba(255,255,255,.12); }
.st-desk i:nth-child(n+3) { display: none; }
.st-seat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; min-height: 104px; }
.st-seat .rm-face { margin-bottom: 4px; }
.st-seat.me .rm-face { box-shadow: 0 0 0 3px #0B1B4D, 0 0 0 5px #6BA6FF; }
.st-seat b { font: 700 13px var(--disp); } .st-seat small { font: 700 11.5px Inter, var(--disp); color: #9CC6FF; }
.st-what { font: 500 11px var(--disp); color: rgba(255,255,255,.55); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-seat.paused { opacity: .45; } .st-seat.paused small { color: #fff; }
.st-seat.empty i { width: 46px; height: 46px; border-radius: 50%; border: 1.5px dashed rgba(255,255,255,.28); margin-bottom: 4px; }
.st-seat.empty small { color: rgba(255,255,255,.4); font-family: var(--disp); }
.st-cheer { display: flex; justify-content: center; gap: 8px; margin-top: 22px; }
.st-cheer button { width: 52px; height: 40px; border-radius: 999px; background: rgba(255,255,255,.09); font-size: 18px; }
.st-cheer button:active { transform: scale(.92); }
.st-btns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 18px; }
.st-b { height: 54px; border-radius: 18px; background: rgba(255,255,255,.1); color: #fff; font: 700 16px var(--disp); }
.st-b.p { background: #fff; color: #0B1B4D; }
.st-leave { display: block; margin: 14px auto 0; font: 600 13.5px var(--disp); color: rgba(255,255,255,.6); }
.st-float { position: fixed; z-index: 70; font-size: 30px; transform: translate(-50%, 0); pointer-events: none; animation: stUp 1.4s ease-out forwards; }
@keyframes stUp { to { transform: translate(-50%, -90px) scale(1.3); opacity: 0; } }
/* 0.27 หัวห้อง */
.rm-crown { position: absolute; top: -9px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: calc(var(--s) * .34); line-height: 1; font-style: normal; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.rm-headtag { flex: none; font: 700 12px var(--disp); color: #8A5A00; background: #FFF1CC; border-radius: 999px; padding: 4px 10px; }
.rm-headmini { font: 700 11px var(--disp); font-style: normal; color: #8A5A00; background: #FFF1CC; border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
.rm-memrow { display: flex; align-items: center; gap: 6px; }
.rm-memrow .rm-mem { flex: 1; }
.rm-memmore { font: 800 18px/1 Inter, sans-serif; letter-spacing: 1px; color: var(--text-2); }
.rm-manage { margin-top: 18px; }
.rm-manage .list-btn { padding: 12px 2px; }
.rm-row { padding-top: 12px; margin-top: 4px; }

/* ---------------------------------------------------------------- 0.28 ยศแบบ Discord + การ์ดรอยืนยัน */
.rn-head { color: #B7791F; } .rn-mod { color: #7C3AED; } .rn-scribe { color: #0A6CF1; }
.rm-badge { position: absolute; top: -4px; right: -4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 12px; font-style: normal; box-shadow: 0 1px 4px rgba(11,27,77,.22); }
.rm-headtag.rt-mod { color: #5B21B6; background: #EDE5FF; } .rm-headtag.rt-scribe { color: #0A4FB8; background: #E2EEFF; }
.rm-grp.rg-head { color: #B7791F; } .rm-grp.rg-mod { color: #7C3AED; } .rm-grp.rg-scribe { color: #0A6CF1; }
.rm-rolehelp { display: block; margin: 16px auto 0; }
.rm-rolesinfo div { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rm-rolesinfo b { font: 700 15px var(--disp); } .rm-rolesinfo small { font: 500 13px var(--disp); color: var(--text-2); }
.rm-rolesinfo .muted { margin-top: 12px; }
.rm-tip { font: 500 12.5px var(--disp); color: var(--text-2); background: var(--surface); border-radius: 12px; padding: 8px 11px; margin-top: 10px; }
.rm-act .rm-meta { margin-bottom: 4px; }
.rm-roles button { font-size: 13.5px; }
.rm-card.pending { background: #FFF8EC; box-shadow: inset 0 0 0 2px #F4C27A; border: 0; outline: 2px dashed #F4A340; outline-offset: -2px; cursor: pointer; }
.rm-card.hidden { background: var(--surface); box-shadow: none; opacity: .62; cursor: pointer; }
.rm-card.hidden .rm-ct b { text-decoration: line-through; }
.rm-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 4px; }
.rm-tags .rm-due { margin: 0; }
.rm-ptag { font: 700 11.5px var(--disp); color: #9A5B00; background: #FFE7C2; border-radius: 999px; padding: 2px 10px; }
.rm-ptag.hid { color: #A33; background: #FDE3E3; }
.rm-src { font: 600 11px var(--disp); color: var(--ink); background: #fff; border-radius: 999px; padding: 2px 9px; box-shadow: inset 0 0 0 1px #EADBC4; }
.rm-vote { display: flex; gap: 6px; width: 100%; margin-top: 10px; }
.rm-vbtn { flex: 1; min-height: 38px; border-radius: 12px; font: 700 13.5px var(--disp); background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px #EADBC4; }
.rm-vbtn.yes[aria-pressed="true"] { background: #1F8A5B; color: #fff; box-shadow: none; }
.rm-vbtn.no[aria-pressed="true"] { background: #FDE3E3; color: #A33; box-shadow: none; }
.rm-vbtn.yes:not([aria-pressed="true"]) { background: #1F8A5B; color: #fff; box-shadow: none; opacity: .92; }
.rm-wait { font: 600 12px var(--disp); color: #9A5B00; margin-top: 8px; }
.rm-pstat { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.rm-pstat small { font: 600 12.5px var(--disp); color: var(--text-2); }
.rm-yes { display: flex; align-items: center; gap: 8px; margin-top: 10px; font: 500 12.5px var(--disp); color: var(--text-2); }
.rm-sheet .row2 { margin-top: 14px; }
.rm-srcs button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.rm-dup { margin-top: 12px; border-radius: 16px; background: #FFF4E5; padding: 12px; font: 600 13px var(--disp); color: #8A4B00; }
.rm-dup .row2 { margin-top: 10px; }
.rm-dup .btn { min-height: 44px; font-size: 14px; }

/* ---------------------------------------------------------------- 0.28 หน้าฉัน: หัวหน้า = โปรไฟล์ (แบบ ก) */
.mehero2 { padding-top: 6px; }
.mh2-top { display: flex; align-items: center; gap: 18px; }
.mh2-stats { flex: 1; display: flex; }
.mh2-stats > * { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.mh2-stats b { font: 800 21px Inter, sans-serif; color: var(--ink); display: inline-flex; align-items: center; gap: 2px; }
.mh2-stats b svg { width: 17px; height: 17px; color: #F0702A; fill: #FFB547; }
.mh2-stats small { font: 500 12.5px var(--disp); color: var(--text-2); }
.mh2-streak.zero b { color: #A3ACBF; }
.mehero2 .mh-t { margin-top: 10px; gap: 1px; }
.mehero2 .mh-name { font-size: 25px; }
.mh2-at { font: 600 14px var(--disp); color: var(--text-2); }
.mh2-btns { display: flex; gap: 8px; margin-top: 12px; }
.mh2-rooms { display: flex; gap: 6px; margin: 12px -16px 0; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
.mh2-rooms::-webkit-scrollbar { display: none; }
.mh2-room { flex: none; height: 34px; border-radius: 999px; padding: 0 13px; background: #fff; box-shadow: inset 0 0 0 1.5px #E3E8F0; font: 700 13px var(--disp); color: var(--ink); display: inline-flex; align-items: center; }
.mh2-room small { font: 500 12px var(--disp); color: var(--text-2); }
.mh2-room.add { color: var(--blue); box-shadow: inset 0 0 0 1.5px #CFE0FD; background: var(--blue-light); }
.mehero2 + .mecard { margin-top: 16px; }
.mh2-room small { margin-left: 4px; }

/* ---------------------------------------------------------------- 0.29 หน้าห้องยกระดับ: แบนเนอร์ · แบ่งตามวันส่ง · ปุ่มเพิ่มเข้างานของฉันบนการ์ด */
.rm-banner { position: relative; overflow: hidden; border-radius: 28px; padding: 16px 16px 14px 18px; margin: 2px 0 6px; color: #fff;
  background: radial-gradient(120% 90% at 100% 0%, hsl(calc(var(--rh) + 40) 85% 66% / .9) 0%, transparent 55%), linear-gradient(140deg, hsl(var(--rh) 78% 48%), hsl(calc(var(--rh) + 28) 70% 38%));
  box-shadow: 0 18px 34px -22px hsl(var(--rh) 70% 30%); }
.rm-banner::after { content: ""; position: absolute; right: -46px; bottom: -60px; width: 170px; height: 170px; border-radius: 50%; border: 18px solid rgba(255,255,255,.08); pointer-events: none; }
.rm-bn-top { display: flex; align-items: center; gap: 10px; }
.rm-banner .rm-title h1 { color: #fff; font-size: 30px; }
.rm-banner .rm-title span svg { color: rgba(255,255,255,.8); }
.rm-banner .rm-invite { background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); color: #fff; position: relative; z-index: 1; }
.rm-bn-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; font: 600 13px var(--disp); color: rgba(255,255,255,.85); }
.rm-livedot { display: inline-flex; align-items: center; gap: 6px; }
.rm-livedot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #5BE39A; box-shadow: 0 0 0 3px rgba(91,227,154,.28); }
.rm-banner .rm-headtag { background: rgba(255,255,255,.2); color: #fff; }
.rm-bn-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.rm-bstat { border-radius: 16px; background: rgba(255,255,255,.14); padding: 8px 4px 7px; display: flex; flex-direction: column; align-items: center; color: #fff; line-height: 1.2; }
.rm-bstat b { font: 800 19px Inter, sans-serif; }
.rm-bstat small { font: 600 11px var(--disp); opacity: .85; }
.rm-bstat.hot { background: #fff; color: #C8352B; } .rm-bstat.hot small { opacity: 1; color: #C8352B; }
.rm-row { margin-top: 8px; }
.rm-sec { display: flex; align-items: center; gap: 8px; font: 700 13px var(--disp); color: var(--text-2); margin: 14px 2px 2px; }
.rm-sec:first-child { margin-top: 0; }
.rm-sec span { font: 800 11px Inter, sans-serif; color: var(--text-2); background: var(--surface); border-radius: 999px; padding: 1px 7px; }
.rm-sec.rs-late, .rm-sec.rs-today { color: #C8352B; } .rm-sec.rs-pending { color: #9A5B00; }
.rm-card { text-align: left; cursor: pointer; position: relative; }
.rm-card::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); opacity: .8; }
.rm-card.pending::before, .rm-card.hidden::before { display: none; }
.rm-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.rm-new { font: 700 11px var(--disp); color: #fff; background: var(--blue); border-radius: 999px; padding: 2px 9px; }
.rm-mine { width: 34px; height: 34px; border-radius: 12px; background: #fff; color: var(--blue); display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--blue) 30%, transparent); }
.rm-mine svg { width: 17px; height: 17px; }
.rm-mine.on { background: #E3F6EC; color: #1F8A5B; box-shadow: none; }
.rm-side { gap: 8px; }

/* ================= 0.30 หน้าตาห้อง 3 แบบ (body[data-rv]) — ภาพเปรียบเทียบ mockups/sabaii-room-styles.jpg ================= */
/* ---- ก เรียบตามแอป: กรมท่าแบบการ์ดหน้าฉัน · การ์ดขาวแบบหน้างาน · คอลัมน์เป็นชิปแบบตัวกรองหน้างาน ---- */
body[data-rv="a"] .rm-banner { background: radial-gradient(120% 80% at 100% 0%, rgba(107,140,255,.35), transparent 60%), linear-gradient(150deg, #1B2C6B, #0B1B4D 60%, #2A1F5E); box-shadow: 0 18px 34px -22px rgba(11,27,77,.7); }
body[data-rv="a"] .rm-bstat { background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
body[data-rv="a"] .rm-bstat.hot { background: #FF6B6B; color: #fff; } body[data-rv="a"] .rm-bstat.hot small { color: #fff; }
body[data-rv="a"] .rm-lanes { gap: 8px; margin: 16px 0 12px; }
body[data-rv="a"] .rm-lanes button { font: 600 14px var(--disp); color: var(--text-2); background: #fff; box-shadow: inset 0 0 0 1.5px #E3E8F0; border-radius: 999px; padding: 8px 15px; }
body[data-rv="a"] .rm-lanes button sup { vertical-align: 0; font-size: 11px; margin-left: 5px; opacity: .7; }
body[data-rv="a"] .rm-lanes button[aria-selected="true"] { font-size: 14px; background: var(--ink); color: #fff; box-shadow: none; }
body[data-rv="a"] .rm-lanes button[aria-selected="true"]::after { display: none; }
body[data-rv="a"] .rm-card { background: #fff; box-shadow: inset 0 0 0 1px #E8ECF4, 0 6px 18px -14px rgba(11,27,77,.35); border-radius: 22px; }
body[data-rv="a"] .rm-card::before { top: 16px; bottom: 16px; }
body[data-rv="a"] .rm-card .rm-due { background: var(--surface); }
body[data-rv="a"] .rm-card .rm-due.hot { background: #FDECEC; }
body[data-rv="a"] .rm-card .rm-side .si-box { background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }
body[data-rv="a"] .rm-card.pending { background: #fff; outline: 0; box-shadow: inset 0 0 0 1.5px #F4C27A, 0 6px 18px -14px rgba(154,91,0,.4); }
body[data-rv="a"] .rm-card.pending .rm-vbtn.no { box-shadow: inset 0 0 0 1.5px #E3E8F0; }

/* ---- ข สีสดแบบหน้าแรก: แบนเนอร์ขาว + ไทล์ตัวเลขสีแบบปุ่มจดงาน · ไอคอนวิชาใหญ่สีเต็ม ---- */
body[data-rv="b"] .rm-banner { background: #fff; color: var(--ink); box-shadow: none; padding: 4px 0 0; border-radius: 0; overflow: visible; }
body[data-rv="b"] .rm-banner::after { display: none; }
body[data-rv="b"] .rm-banner .rm-title h1 { color: var(--ink); font-size: 32px; }
body[data-rv="b"] .rm-banner .rm-title span svg { color: var(--text-2); }
body[data-rv="b"] .rm-banner .rm-invite { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px #E3E8F0; }
body[data-rv="b"] .rm-bn-sub { color: var(--text-2); }
body[data-rv="b"] .rm-banner .rm-headtag { background: #FFF1CC; color: #8A5A00; }
body[data-rv="b"] .rm-banner .rm-headtag.rt-mod { background: #EDE5FF; color: #5B21B6; } body[data-rv="b"] .rm-banner .rm-headtag.rt-scribe { background: #E2EEFF; color: #0A4FB8; }
body[data-rv="b"] .rm-bn-stats { gap: 8px; }
body[data-rv="b"] .rm-bstat { border-radius: 20px; padding: 12px 4px 10px; color: var(--ink); }
body[data-rv="b"] .rm-bstat b { font-size: 24px; }
body[data-rv="b"] .rm-bstat small { opacity: 1; color: inherit; }
body[data-rv="b"] .rm-bstat:nth-child(1) { background: #0A6CF1; color: #fff; }
body[data-rv="b"] .rm-bstat:nth-child(2) { background: #EEE8FF; color: #4B2FB8; }
body[data-rv="b"] .rm-bstat:nth-child(3) { background: #FFF0DD; color: #9A5B00; }
body[data-rv="b"] .rm-bstat:nth-child(4) { background: #E3F6EC; color: #1F7A50; }
body[data-rv="b"] .rm-bstat.hot { background: #E2453A; color: #fff; }
body[data-rv="b"] .rm-card { background: #fff; box-shadow: inset 0 0 0 1.5px #EEF1F7; border-radius: 24px; flex-direction: row-reverse; padding: 14px; }
body[data-rv="b"] .rm-card::before { display: none; }
body[data-rv="b"] .rm-card .rm-side { align-items: center; }
body[data-rv="b"] .rm-card .rm-side .si-box { width: 52px; height: 52px; border-radius: 17px; background: var(--c); color: #fff; }
body[data-rv="b"] .rm-card .rm-side .si-box svg { width: 26px; height: 26px; }
body[data-rv="b"] .rm-card .rm-due { background: color-mix(in srgb, var(--c) 12%, #fff); color: color-mix(in srgb, var(--c) 70%, #0B1B4D); }
body[data-rv="b"] .rm-card .rm-due.hot { background: #E2453A; color: #fff; }
body[data-rv="b"] .rm-card.pending { flex-direction: column; background: #FFF8EC; outline: 0; box-shadow: inset 0 0 0 1.5px #F4C27A; }

/* ---- ค มืดแบบ Discord: ทั้งหน้ามืด · การ์ดพื้นเข้มมีแสงสีวิชา · ยศสีสด ---- */
body[data-rv="c"] #page:has(.rm-banner) { background: #0E1326; color: #E8ECF7; }
body[data-rv="c"] #page:has(.rm-banner)::after { background: linear-gradient(180deg, rgba(14,19,38,0), rgba(14,19,38,.92) 70%, #0E1326) !important; }
body[data-rv="c"] .rm-banner { background: radial-gradient(120% 90% at 100% 0%, rgba(124,92,255,.55), transparent 55%), linear-gradient(150deg, #2B2F7A, #171C45); box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 20px 40px -24px #000; }
body[data-rv="c"] .rm-bstat { background: rgba(255,255,255,.07); }
body[data-rv="c"] .rm-bstat.hot { background: #FF5C6C; color: #fff; } body[data-rv="c"] .rm-bstat.hot small { color: #fff; }
body[data-rv="c"] .rm-row { border-color: rgba(255,255,255,.06); }
body[data-rv="c"] .rm-who { color: #C9D0E4; }
body[data-rv="c"] .rm-face { box-shadow: none; }
body[data-rv="c"] .rm-dot { --dotbd: #0E1326; border-color: #0E1326; }
body[data-rv="c"] .rm-more .rm-face { background: #1D2440; color: #9AA5C4; }
body[data-rv="c"] .rm-lanes button { color: #5F6A8C; }
body[data-rv="c"] .rm-lanes button[aria-selected="true"] { color: #fff; }
body[data-rv="c"] .rm-lanes button[aria-selected="true"]::after { background: #7C5CFF; }
body[data-rv="c"] .rm-sec { color: #7D88AA; } body[data-rv="c"] .rm-sec span { background: #1D2440; color: #9AA5C4; }
body[data-rv="c"] .rm-sec.rs-late, body[data-rv="c"] .rm-sec.rs-today { color: #FF7A85; } body[data-rv="c"] .rm-sec.rs-pending { color: #F5B65B; }
body[data-rv="c"] .rm-card { background: #171D35; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 10px 26px -18px color-mix(in srgb, var(--c) 70%, transparent); }
body[data-rv="c"] .rm-card::before { opacity: 1; box-shadow: 0 0 12px var(--c); }
body[data-rv="c"] .rm-ct b { color: #F2F4FB; } body[data-rv="c"] .rm-ct small { color: #8A94B4; }
body[data-rv="c"] .rm-card .rm-due { background: #232B4B; color: #C9D0E4; } body[data-rv="c"] .rm-card .rm-due.hot { background: #4A1F2A; color: #FF8E99; }
body[data-rv="c"] .rm-card .rm-side .si-box { background: color-mix(in srgb, var(--c) 22%, #171D35); color: color-mix(in srgb, var(--c) 60%, #fff); }
body[data-rv="c"] .rm-ring circle { stroke: #262E50; } body[data-rv="c"] .rm-ring circle.on { stroke: color-mix(in srgb, var(--c) 70%, #fff); }
body[data-rv="c"] .rm-ring b { color: #fff; } body[data-rv="c"] .rm-ring b small { color: #8A94B4; }
body[data-rv="c"] .rm-mine { background: #232B4B; color: #9CC6FF; box-shadow: none; } body[data-rv="c"] .rm-mine.on { background: #173D2C; color: #5BE39A; }
body[data-rv="c"] .rm-doing { color: #5BE39A; } body[data-rv="c"] .rm-faces .rm-face { box-shadow: 0 0 0 2px #171D35; }
body[data-rv="c"] .rm-card.pending { background: #251E14; outline: 0; box-shadow: inset 0 0 0 1.5px rgba(245,182,91,.55); }
body[data-rv="c"] .rm-ptag { background: rgba(245,182,91,.16); color: #F5B65B; } body[data-rv="c"] .rm-src { background: #232B4B; color: #C9D0E4; box-shadow: none; }
body[data-rv="c"] .rm-vbtn { background: #232B4B; color: #E8ECF7; box-shadow: none; } body[data-rv="c"] .rm-vbtn.yes:not([aria-pressed="true"]), body[data-rv="c"] .rm-vbtn.yes[aria-pressed="true"] { background: #23A36A; color: #fff; }
body[data-rv="c"] .rm-wait { color: #F5B65B; }
body[data-rv="c"] .rm-empty { background: #171D35; } body[data-rv="c"] .rm-empty small { color: #8A94B4; }
body[data-rv="c"] .rm-add { background: #7C5CFF; }
body[data-rv="c"] .rm-err { background: #2A2216; color: #F5B65B; }

/* ---------------------------------------------------------------- 0.30 การ์ดห้องลำดับใหม่ (เจ้าของ: "ไม่ชอบลำดับสายตา · มีข้อความส่วนเกิน") */
.rm-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 12px 12px 12px 12px; }
.rm-card::before { display: none !important; }
.rm-card > .si-box { width: 44px; height: 44px; border-radius: 14px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); }
.rm-card > .si-box svg { width: 22px; height: 22px; }
.rm-card .rm-ct { gap: 3px; }
.rm-card .rm-ct b { font: 700 16.5px/1.3 var(--disp); color: var(--ink); display: inline-flex; align-items: center; gap: 7px; }
.rm-ndot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: none; box-shadow: 0 0 0 3px rgba(10,108,241,.15); }
.rm-m { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; font: 500 13px var(--disp); color: var(--text-2); }
.rm-sj { color: color-mix(in srgb, var(--c) 72%, #0B1B4D); font-weight: 600; }
.rm-dotsep { width: 3px; height: 3px; border-radius: 50%; background: #C3CAD9; }
.rm-m .late { color: #C8352B; font-weight: 700; }
.rm-m .rm-doing { margin: 0; gap: 5px; font-size: 12.5px; }
.rm-card .rm-ring { width: 40px; height: 40px; }
.rm-card .rm-ring b { font-size: 11.5px; }
.rm-card.isdone > .si-box { filter: grayscale(.6); opacity: .7; }
.rm-card.pending .rm-vote, .rm-card.pending .rm-wait { grid-column: 1 / -1; margin-top: 6px; }
.rm-card .rm-ptag { align-self: center; font: 700 12px var(--disp); padding: 3px 10px; }
.rm-row { border: 0 !important; }
.rm-sec { margin-top: 18px; font-size: 13.5px; }
/* แบบแถวบาง (body[data-rc="row"]) — เหมือนรายการหน้างาน */
body[data-rc="row"] .rm-cards { gap: 0; }
body[data-rc="row"] .rm-card { background: transparent !important; box-shadow: none !important; border-radius: 0; padding: 12px 2px; border-bottom: 1px solid #EEF1F7; }
body[data-rc="row"] .rm-card.pending { background: #FFF8EC !important; border-radius: 18px; padding: 12px; border: 0; margin: 4px 0; box-shadow: inset 0 0 0 1.5px #F4C27A !important; }
body[data-rc="row"] .rm-sec { margin-top: 20px; }

/* ---------------------------------------------------------------- 0.31 ห้อง: การ์ดพระเอก + รูปกระดาน (mockups/sabaii-room-vibe.html แบบ 1+2) */
.rm-banner.slim, body[data-rv] .rm-banner.slim { background: none; box-shadow: none; color: var(--ink); padding: 2px 0 0; border-radius: 0; overflow: visible; margin: 0; }
.rm-banner.slim::after { display: none; }
.rm-banner.slim .rm-title h1 { color: var(--ink); font-size: 30px; }
.rm-banner.slim .rm-title span svg { color: var(--text-2); }
.rm-banner.slim .rm-invite { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px #E3E8F0; }
.rm-banner.slim .rm-bn-sub { color: var(--text-2); margin-top: 0; }
.rm-banner.slim .rm-headtag { background: #FFF1CC; color: #8A5A00; }
.rm-banner.slim .rm-headtag.rt-mod { background: #EDE5FF; color: #5B21B6; } .rm-banner.slim .rm-headtag.rt-scribe { background: #E2EEFF; color: #0A4FB8; }
.rm-hero { position: relative; overflow: hidden; border-radius: 28px; margin: 12px 0 2px; background: var(--tint); color: #fff; cursor: pointer; box-shadow: 0 22px 40px -26px var(--tint); }
.rm-hero:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.rh-img { height: 168px; background: center/cover no-repeat; position: relative; }
.rh-img::after { content: ""; position: absolute; inset: auto 0 0; height: 90px; background: linear-gradient(rgba(0,0,0,0), var(--tint)); }
.rh-img.none { height: 92px; display: grid; place-items: center; color: rgba(255,255,255,.22); background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--c) 55%, transparent), transparent 60%), var(--tint); }
.rh-img.none svg { width: 64px; height: 64px; }
.rh-img.none::after { height: 40px; }
.rh-lab { position: absolute; top: 12px; left: 12px; font: 700 12px var(--disp); color: #C8352B; background: rgba(255,255,255,.95); border-radius: 999px; padding: 4px 11px; }
.rh-tx { position: relative; padding: 0 16px 16px; margin-top: -6px; }
.rh-tx > b { display: block; font: 700 21px/1.25 var(--disp); }
.rh-tx > small { font: 500 12.5px var(--disp); opacity: .78; }
.rh-bar { height: 7px; border-radius: 4px; background: rgba(255,255,255,.2); overflow: hidden; margin: 12px 0 8px; }
.rh-bar i { display: block; height: 100%; border-radius: 4px; background: #fff; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.rh-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rh-row b { font: 700 13px var(--disp); }
.rh-row .rm-faces .rm-face { box-shadow: 0 0 0 2px var(--tint); }
.rh-btns { display: flex; gap: 8px; margin-top: 12px; }
.rh-go { flex: 1.4; height: 46px; border-radius: 16px; background: #fff; color: var(--tint); font: 700 15px var(--disp); }
.rh-mine { flex: 1; height: 46px; border-radius: 16px; background: rgba(255,255,255,.16); color: #fff; font: 700 14px var(--disp); }
.rh-mine.on { background: rgba(91,227,154,.22); color: #C9FFE2; }
.rm-th { width: 44px; height: 44px; border-radius: 14px; background: var(--surface) center/cover no-repeat; box-shadow: 0 0 0 1px rgba(11,27,77,.06); }
.rm-photo { display: block; position: relative; width: 100%; height: 200px; border: 0; padding: 0; border-radius: 20px; background: var(--surface) center/cover no-repeat; margin-bottom: 14px; cursor: zoom-in; }
.rm-shot { margin-top: 12px; }
.rm-shot-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--blue-light); text-align: left; color: var(--ink); }
.rm-shot-btn > span:first-child svg { width: 24px; height: 24px; color: var(--blue); }
.rm-shot-btn > span:last-child, .rm-shot > span:nth-child(2) { display: flex; flex-direction: column; }
.rm-shot b { font: 700 14.5px var(--disp); } .rm-shot small { font: 500 12px var(--disp); color: var(--text-2); }
.rm-shot:has(.rm-shot-img) { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 16px; background: var(--surface); }
.rm-shot-img { width: 56px; height: 56px; border-radius: 12px; background: center/cover; flex: none; }
.rm-shot:has(.rm-shot-img) > span:nth-child(2) { flex: 1; }
/* ขอบจอบน (แถบสถานะ iPhone) = ขาว เมื่อเปิดหน้าแท็บ (งาน · ห้อง · ฉัน) หรือแผ่นหน้าแรกเต็มจอ
   Safari เอาสีแถบบนจากชั้น fixed ที่อยู่ใต้ → ซ่อนโน้ตด้านหลัง + ม่านมืด ให้เหลือพื้นขาวล้วน */
html:has(#page:not([hidden])), html:has(#page:not([hidden])) body,
html:has(#sheet.full), html:has(#sheet.full) body { background: #fff; }
body:has(#page:not([hidden])) #stage, body:has(#page:not([hidden])) #stage-dim,
body:has(#sheet.full):not(.note-mode) #stage-dim { visibility: hidden; }
/* ชื่อห้องเป็นตัวเลขล้วน (4/16) ดูลอย → นำด้วยคำว่า "ห้อง" สีจาง ให้อ่านเป็นหัวเรื่อง */
.rm-pre { color: #A3ADC2; font-weight: 600; margin-right: .28em; }

/* ---------------------------------------------------------------- 0.32 หลายห้อง (แถบห้อง A) · ชมรม/กลุ่ม · แจ้งเตือนของห้อง — mockups/sabaii-rooms-many.html */
.rm-pills { display: flex; gap: 7px; overflow-x: auto; margin: 0 -16px 10px; padding: 4px 16px 2px; scrollbar-width: none; }
.rm-pills::-webkit-scrollbar { display: none; }
.rm-pill { flex: none; position: relative; display: flex; align-items: center; gap: 6px; height: 36px; border-radius: 999px; padding: 0 13px 0 5px; max-width: 190px;
  font: 700 13.5px var(--disp); color: var(--text-2); background: var(--surface); transition: background .15s, color .15s; }
.rm-pill > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-pill i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 14px; background: var(--c); flex: none; }
.rm-pill.on { background: var(--ink); color: #fff; }
.rm-pill.add { padding: 0 14px; background: #fff; box-shadow: inset 0 0 0 1.5px #D7DEEA; color: var(--blue, #0A6CF1); font-size: 17px; }
.rm-pn { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #E5483B; color: #fff;
  font: 800 10.5px Inter, sans-serif; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
#nav a.has-dot::after { content: ""; position: absolute; top: 9px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: #E5483B; box-shadow: 0 0 0 2px #fff; }
/* ประเภทห้อง (สร้างห้อง · หัวห้องเปลี่ยนได้) */
.rm-types { display: grid; gap: 8px; margin-bottom: 6px; }
.rm-type { display: grid; grid-template-columns: 44px 1fr; gap: 11px; align-items: center; text-align: left; border-radius: 18px; padding: 10px; box-shadow: inset 0 0 0 1.5px #E3E8F0; background: #fff; }
.rm-type[aria-checked="true"] { box-shadow: inset 0 0 0 2.5px var(--blue, #0A6CF1); background: #F5F9FF; }
.rm-type i { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; font-style: normal; background: var(--c); }
.rm-type b { display: block; font: 700 15px/1.3 var(--disp); color: var(--ink); }
.rm-type small { display: block; font: 500 12px/1.45 var(--disp); color: var(--text-2); }
/* นัด (ชมรม) */
.rm-ev { display: block; border-radius: 26px; padding: 16px; margin: 4px 0 6px; color: #fff; text-align: left; cursor: pointer;
  background: radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.16), transparent 55%), linear-gradient(150deg, #6A3FD6, #3B2A8E); box-shadow: 0 18px 34px -22px rgba(59,42,142,.8); }
.rm-evlab { display: inline-block; font: 700 11.5px var(--disp); background: rgba(255,255,255,.95); color: #5A2FC0; border-radius: 999px; padding: 3px 10px; }
.rm-ev > b { display: block; font: 700 20px/1.3 var(--disp); margin-top: 9px; }
.rm-ev > small { display: block; font: 500 13px var(--disp); opacity: .88; }
.rm-ev .rm-evn { margin-top: 4px; opacity: .75; font-size: 12px; }
.rm-rsvp { display: flex; gap: 8px; margin-top: 6px; }
.rm-rsvp button { flex: 1; height: 44px; border-radius: 14px; font: 700 14px var(--disp); background: var(--surface); color: var(--ink); }
.rm-rsvp .go[aria-pressed="true"] { background: #1F8A5B; color: #fff; }
.rm-rsvp .no[aria-pressed="true"] { background: #FDE7E5; color: #C8352B; }
.rm-rsvp.hero { margin-top: 12px; }
.rm-rsvp.hero button { height: 40px; background: rgba(255,255,255,.16); color: #fff; }
.rm-rsvp.hero .go { background: #fff; color: #4B2BB0; }
.rm-rsvp.hero .go[aria-pressed="true"] { background: #5BE39A; color: #0B3B24; }
.rm-rsvp.hero .no[aria-pressed="true"] { background: rgba(255,255,255,.32); color: #fff; }
.rm-evic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 21px; background: #F1EAFF; flex: none; }
.rm-card.event { --c: #6A3FD6; align-items: center; }
.rm-going { flex: none; align-self: center; font: 700 12px var(--disp); border-radius: 999px; padding: 4px 10px; background: #F1EAFF; color: #5A2FC0; }
.rm-going.me { background: #1F8A5B; color: #fff; } .rm-going.no { background: #FDE7E5; color: #C8352B; }
/* กลุ่ม: คนรับผิดชอบ */
.rm-own { font: 700 11px var(--disp); background: #EAF7F0; color: #1F7A50; border-radius: 999px; padding: 1px 8px; margin-left: 6px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-owners { margin: 2px 0 4px; }
.rm-ownrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rm-ownchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: #EAF7F0; font: 700 13px var(--disp); color: #1F7A50; }
.rm-ownme { height: 34px; padding: 0 14px; margin-left: auto; }
.rm-owners-pick button { display: inline-flex; align-items: center; gap: 6px; padding-left: 4px; }
.rm-evbox .row2 { grid-template-columns: 120px 1fr; }
.rm-ckind { margin-bottom: 10px; }
.rm-nbox { margin-top: 14px; }
.rm-evic.task { background: var(--surface); }

/* 0.34 กล้องในแอป (เปิดจากปุ่มลัด "ถ่ายรูปกระดาน") */
#cam { position: fixed; inset: 0; z-index: 70; background: #000; color: #fff; }
.cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-top { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 0; right: 0; text-align: center; font: 600 14px "Anuphan", "Noto Sans Thai Looped", sans-serif; }
.cam-top span { background: rgba(0,0,0,.35); backdrop-filter: blur(8px); padding: 6px 16px; border-radius: 999px; }
.cam-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 24px calc(28px + var(--safe-b)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.cam-side { background: none; border: 0; color: #fff; font: 600 15px "Anuphan", "Noto Sans Thai Looped", sans-serif; display: flex; align-items: center; gap: 6px; padding: 10px 4px; }
.cam-side:last-child { justify-self: end; }
.cam-side:first-child { justify-self: start; }
.cam-side .i { width: 22px; height: 22px; }
.cam-shut { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: #fff; box-shadow: 0 0 0 4px #000 inset; }
.cam-shut:active { transform: scale(.94); }
.cam-shut:disabled { opacity: .35; }
.cam-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.cam-fallback[hidden] { display: none; }
.cam-fallback p { color: #cfd5e2; }
.cam-fallback .btn { flex: none; width: auto; height: auto; min-height: 52px; padding: 12px 28px; }

/* ---------------------------------------------------------------- 0.35 แชทของห้องแบบ Discord — features/chat.js */
.ch-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin: 12px 0 2px; padding: 10px 12px 10px 10px; border-radius: 20px; background: var(--surface); color: var(--ink); }
.ch-row:active { transform: scale(.99); }
.ch-row .ch-ico { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: #fff; color: var(--blue); flex: none; box-shadow: 0 1px 0 rgba(11,27,77,.04); }
.ch-row .ch-ico svg { width: 22px; height: 22px; }
.ch-row.new .ch-ico { background: var(--blue); color: #fff; }
.ch-rt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-rt b { font-family: var(--disp); font-size: 15px; display: flex; gap: 6px; align-items: baseline; }
.ch-rt b small { font: 600 11.5px var(--disp); color: var(--text-2); }
.ch-rt > small { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-row.new .ch-rt > small { color: var(--ink); font-weight: 600; }
.ch-row .chev { color: var(--text-2); width: 20px; flex: none; }
.ch-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--error); color: #fff; font: 800 12px/22px Inter, sans-serif; text-align: center; flex: none; }
.ch-badge.at { background: #F04B6B; }

#chat { position: fixed; inset: 0; z-index: 38; background: #fff; display: flex; flex-direction: column; opacity: 0; transform: translateY(14px); transition: opacity .22s, transform .26s cubic-bezier(.2,.8,.2,1); }
#chat.show { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { #chat { transition: none; } }
#chat > * { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
.ch-top { display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 4px; flex: none; }
.ch-back { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); flex: none; }
.ch-back svg { width: 20px; height: 20px; }
.ch-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-title b { font: 700 22px/1.15 var(--disp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-title small { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.ch-title small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22B573; }
.ch-on { display: flex; } .ch-on .rm-face { margin-left: -8px; box-shadow: 0 0 0 2px #fff; } .ch-on .rm-face:first-child { margin-left: 0; }
.ch-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px 14px 10px; flex: none; border-bottom: 1px solid var(--border); }
.ch-tabs::-webkit-scrollbar { display: none; }
.ch-tab { height: 34px; border-radius: 999px; padding: 0 14px; display: flex; align-items: center; gap: 5px; flex: none; font: 700 13.5px var(--disp); color: var(--text-2); box-shadow: inset 0 0 0 1.5px var(--border); background: #fff; }
.ch-tab.on { background: var(--ink); color: #fff; box-shadow: none; }
.ch-tab.new:not(.on) { color: var(--ink); }
.ch-tab.add { width: 34px; padding: 0; justify-content: center; }
.ch-tab.add svg { width: 16px; height: 16px; }
.ch-tab .ch-lk { font-size: 12px; }
.ch-tab .ch-badge { min-width: 19px; height: 19px; font-size: 11px; line-height: 19px; padding: 0 5px; }
.ch-list { flex: 1; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; padding: 6px 12px 10px; -webkit-overflow-scrolling: touch; background: #F6F8FC; }
.ch-list > :first-child { margin-top: auto; }
.ch-list > * { flex: none; }
.ch-empty { color: var(--text-2); text-align: center; padding: 40px 16px; }
.ch-err { color: var(--error); text-align: center; font-size: 13px; padding: 6px 16px; }
.ch-older { display: block; margin: 8px auto; padding: 6px 14px; border-radius: 999px; background: #fff; font: 700 13px var(--disp); color: var(--text-2); }
.ch-hello { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 24px 20px; }
.ch-hello span { width: 54px; height: 54px; border-radius: 18px; background: #fff; color: var(--blue); display: grid; place-items: center; margin-bottom: 8px; box-shadow: 0 6px 18px -10px rgba(11,27,77,.3); }
.ch-hello span svg { width: 26px; height: 26px; }
.ch-hello b { font: 700 17px var(--disp); }
.ch-hello small { color: var(--text-2); font-size: 13px; }
.ch-day { align-self: center; margin: 14px 0 6px; padding: 3px 12px; border-radius: 999px; background: rgba(11,27,77,.06); font: 700 11.5px var(--disp); color: var(--text-2); }
/* ข้อความ: แบบ a ฟองข้อความ */
.ch-msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ch-msg.join { margin-top: 3px; }
.ch-msg.mine { justify-content: flex-end; }
.ch-msg.pend { opacity: .6; }
.ch-av { width: 32px; height: 32px; padding: 0; flex: none; align-self: flex-start; margin-top: 18px; }
.ch-msg.join .ch-av { margin-top: 0; }
.ch-main { min-width: 0; max-width: 78%; display: flex; flex-direction: column; align-items: flex-start; }
.ch-msg.mine .ch-main { align-items: flex-end; }
.ch-head { display: flex; align-items: center; gap: 6px; margin: 0 0 3px 4px; }
.ch-head b { font: 700 12.5px var(--disp); color: var(--text-2); }
.ch-role { font: 700 10.5px var(--disp); color: var(--text-2); background: #fff; border-radius: 999px; padding: 0 7px; box-shadow: inset 0 0 0 1px var(--border); }
.ch-bub { position: relative; background: #fff; border-radius: 20px 20px 20px 6px; padding: 8px 12px 6px; box-shadow: 0 1px 2px rgba(11,27,77,.06); max-width: 100%; }
.ch-msg.join .ch-bub { border-top-left-radius: 8px; }
.ch-msg.mine .ch-bub { background: var(--blue); color: #fff; border-radius: 20px 20px 6px 20px; }
.ch-msg.mine.join .ch-bub { border-top-right-radius: 8px; }
.ch-msg.atme .ch-bub { box-shadow: inset 0 0 0 2px #F5B33B, 0 1px 2px rgba(11,27,77,.06); background: #FFFAEB; }
.ch-msg.flash .ch-bub { box-shadow: 0 0 0 3px rgba(10,108,241,.35); }
.ch-msg.onlypic .ch-bub { padding: 4px; }
.ch-text { font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.ch-text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ch-msg:not(.mine) .ch-text a { color: var(--blue); }
.ch-at { background: #E7F0FE; color: #0A4FB8; border-radius: 6px; padding: 0 3px; font-weight: 700; }
.ch-msg.mine .ch-at { background: rgba(255,255,255,.22); color: #fff; }
.ch-at.me { background: #FFE7A3; color: #7A4B00; }
.ch-time { display: block; text-align: right; font: 600 10px Inter, "Noto Sans Thai Looped", sans-serif; color: var(--text-2); margin-top: 1px; opacity: .8; }
.ch-msg.mine .ch-time { color: rgba(255,255,255,.8); }
.ch-msg.onlypic .ch-time { position: absolute; right: 10px; bottom: 8px; color: #fff; background: rgba(0,0,0,.35); border-radius: 999px; padding: 0 6px; }
.ch-gone { font-style: italic; opacity: .7; font-size: 14px; }
.ch-quote { display: flex; flex-direction: column; align-items: flex-start; text-align: left; max-width: 100%; width: 100%; margin: 0 0 5px; padding: 5px 9px; border-radius: 12px; background: var(--surface); border-left: 3px solid var(--blue); font-size: 12.5px; color: var(--text-2); }
.ch-msg.mine .ch-quote { background: rgba(255,255,255,.16); border-left-color: #fff; color: rgba(255,255,255,.88); }
.ch-quote b { font: 700 12px var(--disp); color: var(--ink); }
.ch-msg.mine .ch-quote b { color: #fff; }
.ch-quote span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ch-pic { display: block; padding: 0; border-radius: 16px; overflow: hidden; background: var(--surface); max-width: min(240px, 100%); min-height: 140px; min-width: 140px; }
.ch-pic.ok { min-height: 0; min-width: 0; background: none; }
.ch-pic.bad::after { content: "เปิดรูปไม่ได้"; display: grid; place-items: center; height: 140px; font-size: 12px; color: var(--text-2); }
.ch-pic img { display: block; max-width: 100%; max-height: 320px; object-fit: cover; }
.ch-bub .ch-pic + .ch-text { margin-top: 6px; }
.ch-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -6px; padding: 0 8px; position: relative; }
.ch-rx { height: 26px; border-radius: 999px; padding: 0 8px; display: flex; align-items: center; gap: 3px; background: #fff; box-shadow: 0 1px 4px rgba(11,27,77,.14); font-size: 13.5px; }
.ch-rx b { font: 700 11.5px Inter, sans-serif; color: var(--text-2); }
.ch-rx.me { box-shadow: inset 0 0 0 1.5px var(--blue), 0 1px 4px rgba(11,27,77,.14); }
.ch-rx.me b { color: var(--blue); }
.ch-pend { font-size: 11px; color: var(--text-2); margin: 2px 6px 0; }
.ch-pend.bad { color: var(--error); font-weight: 700; }


.ch-typing { min-height: 22px; padding: 2px 16px 0; font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex: none; background: #F6F8FC; }
.ch-dots { display: inline-flex; gap: 3px; }
.ch-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-2); animation: chDot 1.2s infinite; }
.ch-dots i:nth-child(2) { animation-delay: .15s; } .ch-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes chDot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
.ch-compose { position: relative; padding: 6px 12px calc(10px + var(--safe-b)); flex: none; background: #fff; box-shadow: 0 -1px 0 var(--border); }
.ch-compose.off p { margin: 0 4px; padding: 12px 14px; border-radius: 16px; background: var(--surface); color: var(--text-2); font-size: 13.5px; text-align: center; }
.ch-inrow { display: flex; align-items: flex-end; gap: 8px; }
.ch-inrow textarea { flex: 1; resize: none; border: 0; outline: 0; background: var(--surface); border-radius: 22px; padding: 10px 16px; font: 15px/1.45 inherit; font-family: inherit; color: var(--ink); max-height: 132px; min-height: 44px; }
.ch-inrow textarea:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }
.ch-plus, .ch-send { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.ch-plus { background: var(--surface); color: var(--text-2); }
.ch-plus svg { width: 21px; height: 21px; }
.ch-send { background: var(--blue); color: #fff; transition: opacity .15s; }
.ch-send svg { width: 20px; height: 20px; }
.ch-send:disabled { opacity: .35; }
.ch-bar { display: flex; align-items: center; gap: 8px; margin: 0 4px 6px; padding: 8px 8px 8px 12px; border-radius: 14px; background: var(--surface); border-left: 3px solid var(--blue); }
.ch-bar > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-bar b { font: 700 12.5px var(--disp); }
.ch-bar em { font-style: normal; }
.ch-bar small { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-bar button { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; flex: none; }
.ch-bar button svg { width: 15px; height: 15px; }
.ch-shot { position: relative; display: inline-block; margin: 0 4px 6px; }
.ch-shot img { display: block; height: 84px; border-radius: 12px; }
.ch-shot button { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; }
.ch-shot button svg { width: 13px; height: 13px; }
.ch-mention { position: absolute; left: 12px; right: 12px; bottom: calc(100% + 4px); background: #fff; border-radius: 16px; box-shadow: 0 10px 30px rgba(11,27,77,.18), 0 0 0 1px var(--border); padding: 6px; display: flex; flex-direction: column; }
.ch-mention[hidden] { display: none; }
.ch-mention button { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; text-align: left; }
.ch-mention button:first-child { background: var(--surface); }
.ch-mention b { font: 700 14px var(--disp); color: var(--ink); }
.ch-acts .ch-quick { display: flex; justify-content: space-between; gap: 4px; margin-bottom: 10px; }
.ch-quick button { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); font-size: 20px; display: grid; place-items: center; }
.ch-quick button[aria-pressed="true"] { background: #E7F0FE; box-shadow: inset 0 0 0 1.5px var(--blue); }
.ch-prev { display: flex; gap: 6px; font-size: 13px; color: var(--text-2); margin: 0 2px 6px; }
.ch-prev b { flex: none; font-family: var(--disp); color: var(--ink); }
.ch-prev span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-aico { display: inline-grid; place-items: center; width: 22px; margin-right: 10px; vertical-align: -4px; }
.ch-aico svg { width: 19px; height: 19px; }
.list-btn.danger { color: var(--error); }
.ch-cform { display: flex; flex-direction: column; gap: 14px; }
.ch-lock { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--surface); }
.ch-lock input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue); }
.ch-lock span { display: flex; flex-direction: column; }
.ch-lock small { color: var(--text-2); font-size: 12.5px; }

/* 0.35 คุยใต้การ์ดงาน — mockups/sabaii-room-talk.html (แบบ A) */
.rm-cwrap { display: flex; flex-direction: column; }
.rm-cwrap > .rm-card { margin-bottom: 0; }
.ch-talk { display: flex; align-items: center; gap: 8px; margin: -16px 10px 12px; padding: 18px 12px 8px 10px; border-radius: 0 0 18px 18px; background: var(--surface); text-align: left; font-size: 12.5px; color: var(--text-2); position: relative; z-index: 0; }
.rm-cwrap > .rm-card { position: relative; z-index: 1; }
.ch-talk > span:not(.rm-face):not(.ch-tico) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-talk b { color: var(--ink); font-weight: 700; }
.ch-talk em { font-style: normal; font: 700 11px var(--disp); border-radius: 999px; padding: 1px 8px; background: #FFE9B8; color: #9A5B00; flex: none; }
.ch-talk.q { background: #FFF6DD; color: #7A4B00; }
.ch-talk.q b { color: #7A4B00; }
.ch-talk .ch-tico { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.ch-talk .ch-badge { min-width: 20px; height: 20px; line-height: 20px; font-size: 11px; padding: 0 6px; }
.ch-talk.dark { margin: 10px 0 0; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.14); color: rgba(255,255,255,.85); }
.ch-talk.dark b { color: #fff; }
.ch-talk.dark.q { background: rgba(255,214,120,.22); }
.ch-talk.dark em { background: #FFD678; color: #5C3A00; }
.ch-talk.dark .ch-tico { color: rgba(255,255,255,.8); }
.rm-talk { margin: 14px 0 4px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.rm-talk span { width: 20px; height: 20px; display: grid; }
.ch-top.card { gap: 10px; padding-bottom: 10px; }
.ch-cic { width: 44px !important; height: 44px !important; border-radius: 13px; flex: none; }
.ch-title small.nodot::before { display: none; }
.ch-title small.nodot { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-top.card .ch-title b { font-size: 17px; }
.ch-tabs.none { padding: 0; border-bottom: 1px solid var(--border); }
.ch-tag { display: inline-block; font: 700 10.5px var(--disp); border-radius: 999px; padding: 0 8px; margin: 0 0 3px; }
.ch-tag.q { background: #F5B33B; color: #fff; }
.ch-tag.best { background: #22B573; color: #fff; }
.ch-msg.isq .ch-bub { background: #FFFAEB; box-shadow: inset 0 0 0 2px #F5B33B; color: var(--ink); }
.ch-msg.isq.mine .ch-bub .ch-time, .ch-msg.isbest.mine .ch-bub .ch-time { color: var(--text-2); }
.ch-msg.isbest .ch-bub { background: #F0FBF5; box-shadow: inset 0 0 0 2px #22B573; color: var(--ink); }
.ch-msg.mine.isq .ch-at, .ch-msg.mine.isbest .ch-at { background: #E7F0FE; color: #0A4FB8; }
.ch-auto { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; }
.ch-app { width: 32px; height: 32px; border-radius: 11px; background: linear-gradient(140deg, #0A6CF1, #7C5CFF); color: #fff; display: grid; place-items: center; flex: none; }
.ch-app svg { width: 18px; height: 18px; }
.ch-auto > div { flex: 1; min-width: 0; background: #fff; border-radius: 18px; padding: 8px 12px 9px; box-shadow: inset 0 0 0 1.5px #D9E4FF; }
.ch-auto small { display: block; font: 700 10.5px var(--disp); color: var(--blue); }
.ch-auto b { display: block; font: 700 14px var(--disp); }
.ch-autorow { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin-top: 3px; }
.ch-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 8px; padding: 2px 12px; }
.ch-chips::-webkit-scrollbar { display: none; }
.ch-chip { flex: none; height: 34px; border-radius: 999px; padding: 0 12px; font: 700 12.5px var(--disp); background: var(--surface); color: var(--ink); }
.ch-chip.y { background: #FFF1CC; color: #7A4B00; }
.ch-chip.g { background: #E3F6EC; color: #167A4A; }
.ch-bar.ask { background: #FFF6DD; border-left-color: #F5B33B; }
.list-btn.good { color: #167A4A; font-weight: 700; }

/* ---------------------------------------------------------------- 0.36 ห้องใช้ง่ายขึ้น: ปุ่มหัวห้องมีคำ · แถวทางลัด 3 ปุ่ม · หัวข้อ "งานของห้อง" */
.rm-hbtn { height: 42px; padding: 0 14px 0 11px; border-radius: 21px; display: inline-flex; align-items: center; gap: 6px; flex: none;
  background: var(--blue); color: #fff; font: 700 14.5px var(--disp); position: relative; z-index: 1; }
.rm-hbtn span { display: grid; } .rm-hbtn svg { width: 19px; height: 19px; }
.rm-banner .rm-hbtn, .rm-banner.slim .rm-hbtn { background: var(--blue); color: #fff; box-shadow: none; }
.rm-banner .rm-set { position: relative; z-index: 1; } .rm-banner.slim .rm-set { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px #E3E8F0; }
.rm-set svg { width: 21px; height: 21px; }
.rm-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 4px; }
.rm-quick.two { grid-template-columns: repeat(2, 1fr); }
.rm-q { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 11px 11px 10px; border-radius: 20px;
  background: var(--surface); color: var(--ink); text-align: left; min-width: 0; }
.rm-q:active { transform: scale(.97); }
.rm-qi { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--blue); margin-bottom: 6px; box-shadow: 0 1px 0 rgba(11,27,77,.04); }
.rm-qi svg { width: 20px; height: 20px; }
.rm-q > b { font: 700 14.5px/1.25 var(--disp); }
.rm-q > small { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rm-q .ch-badge { position: absolute; top: 8px; right: 8px; }
.rm-q.new .rm-qi { background: var(--blue); color: #fff; } .rm-q.new > small { color: var(--ink); font-weight: 600; }
.rm-q.study .rm-qi { color: #1F8A5B; } .rm-q.study.on .rm-qi { background: #22B573; color: #fff; } .rm-q.study.on > small { color: #1F8A5B; font-weight: 600; }
.rm-q.rm-add { margin: 0; } .rm-q.rm-add .rm-qi { background: var(--ink); color: #fff; } .rm-q.rm-add.off { opacity: .5; }
.rm-sec { font: 700 13px var(--disp); color: var(--text-2); margin: 22px 0 -8px; letter-spacing: .01em; }
body[data-rv="c"] .rm-q { background: rgba(255,255,255,.06); color: #E8ECF7; } body[data-rv="c"] .rm-qi { background: rgba(255,255,255,.1); }
.rm-qr { width: 210px; margin: 4px auto 0; padding: 8px; border-radius: 24px; background: #fff; box-shadow: inset 0 0 0 1.5px #E3E8F0; }
.rm-qr svg { display: block; width: 100%; height: auto; border-radius: 14px; }
.rm-qrtip { text-align: center; font: 700 15px var(--disp); margin: 10px 0 2px; }
.rm-code.sm { margin: 8px 0 2px; gap: 6px; } .rm-code.sm span { width: 36px; height: 44px; font-size: 20px; border-radius: 12px; }
.rm-codetip { text-align: center; font-size: 12.5px; margin-bottom: 12px; }

/* ---------------------------------------------------------------- 0.37 เข้าใจง่ายขึ้น: งานว่าง · รอยืนยัน · คำใบ้ดึงลง */
.tk-empty { margin: 28px 0 10px; padding: 22px 18px 18px; border-radius: 24px; background: var(--surface); text-align: center; display: flex; flex-direction: column; gap: 4px; }
.tk-empty > b { font: 700 18px var(--disp); color: var(--ink); }
.tk-empty > small { color: var(--text-2); font-size: 13.5px; margin-bottom: 12px; }
.rm-ptip { font-size: 12.5px; line-height: 1.45; color: #8A5A00; background: #FFF6DE; border-radius: 12px; padding: 7px 10px; margin: 2px 0 8px; }
.grab .hint { font-size: 12.5px; font-weight: 600; color: var(--ink); opacity: .72; }
.grab .hint::before { content: "⌄ "; font-weight: 800; }
.mrow-seg .lk small { display: block; }

/* ---------------------------------------------------------------- 0.38 จดครั้งเดียว ได้ทั้งงานฉันและห้อง */
.sh-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border, #E8ECF4); }
.sh-lab { font: 700 13px var(--disp); color: var(--text-2); margin-right: 2px; width: 100%; }
.sh-chip { height: 36px; padding: 0 14px; border-radius: 18px; background: #fff; color: var(--ink); font: 600 14px var(--disp); box-shadow: inset 0 0 0 1.5px #E3E8F0; }
.sh-chip.on { background: var(--blue); color: #fff; box-shadow: none; }
.sh-in { margin: 6px 0; }
.rm-pkgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.rm-pk { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border-radius: 22px; background: var(--surface); color: var(--ink); text-align: left; min-height: 118px; }
.rm-pk:active { transform: scale(.97); }
.rm-pki { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: #fff; color: var(--blue); margin-bottom: 8px; }
.rm-pki svg { width: 22px; height: 22px; }
.rm-pk > b { font: 700 16px var(--disp); } .rm-pk > small { font-size: 12px; color: var(--text-2); }
.rm-pk.pk-cam { background: #0B1B4D; color: #fff; } .rm-pk.pk-cam .rm-pki { background: rgba(255,255,255,.14); color: #fff; } .rm-pk.pk-cam > small { color: rgba(255,255,255,.7); }
.rm-pk.pk-mic .rm-pki { color: #E5487B; } .rm-pk.pk-txt .rm-pki { color: #1F8A5B; } .rm-pk.pk-img .rm-pki { color: #7C3AED; }
.rm-pkmore { display: block; margin: 14px auto 2px; }

/* ================= 0.38 การ์ดโน้ตน่าใช้ขึ้น (เจ้าของ 3 ธ.ค.: "อยากให้มันน่าใช้มากกว่านี้") =================
   1) ป้ายวันที่ไม่เป็นกล่องดำทึบแล้ว — ตัวหนังสือบนเงาไล่จางที่ก้นการ์ด · ลำดับ "1/2" แยกไปชิดขวา
   2) โน้ตตัวอักษร: สั้น = ตัวใหญ่กลางการ์ด · กระดาษสีตามโทนงาน (--c0) แทนเหลืองเดียวทุกธีม · แต่ละธีมมีลายของตัวเอง
   3) กดแล้วการ์ดยุบนิดนึง ให้รู้ว่าแตะได้ */
#stage .nitem:not(.empty) .ntag { left: 0; right: 0; bottom: 0; border-radius: 0; padding: 34px 14px 12px; gap: 6px;
  background: linear-gradient(180deg, transparent, rgba(8,10,18,.5)); -webkit-backdrop-filter: none; backdrop-filter: none;
  font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,.94); text-shadow: 0 1px 2px rgba(0,0,0,.3); pointer-events: none; }
#stage .nitem:not(.empty) .ntag svg { width: 13px; height: 13px; opacity: .9; }
#stage .nitem .ntag .ncount { margin-left: auto; opacity: 1; font: 700 11px/1 Inter, var(--disp), sans-serif; padding: 4px 8px; border-radius: 999px;
  background: rgba(255,255,255,.22); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); text-shadow: none; }
#stage .nitem .nexp { width: 32px; height: 32px; border-radius: 50%; background: rgba(8,10,18,.32); }
#stage .nitem.photo .zoom, #stage .nitem.page .zoom { transition: transform .18s ease-out; }
#stage .nitem.photo .zoom:active, #stage .nitem.page .zoom:active { transform: scale(.985); }

/* ---- โน้ตตัวอักษร: ฐาน (ทุกธีม) ---- */
#stage .nitem.sticky { --pp: oklch(from var(--c0, #F5C542) .965 .045 h); --pp-ink: #1B2440; --pp-sub: rgba(27,36,64,.5);
  background: var(--pp); color: var(--pp-ink); padding: 0; display: flex; flex-direction: column; white-space: normal; }
#stage .nitem.sticky::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 30px; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in oklab, var(--c0, #F5C542) 16%, transparent), transparent); }
#stage .nitem.sticky .ntxt { flex: 1; min-height: 0; overflow: auto; scrollbar-width: none; white-space: pre-line; overflow-wrap: anywhere;
  padding: 30px 24px 52px; font-family: var(--hand); font-size: 19px; line-height: 1.6; }
#stage .nitem.sticky .ntxt::-webkit-scrollbar { display: none; }
#stage .nitem.sticky.sz-s .ntxt { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 64px), transparent calc(100% - 30px)); mask-image: linear-gradient(180deg, #000 calc(100% - 64px), transparent calc(100% - 30px)); }
#stage .nitem.sticky.sz-m .ntxt { display: flex; flex-direction: column; justify-content: center; font-size: 24px; line-height: 1.55; padding-bottom: 72px; }
#stage .nitem.sticky.sz-l .ntxt { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 30px; line-height: 1.45; padding: 30px 26px 56px; }
#stage .nitem.sticky .nline { margin: 0; max-width: 100%; }
#stage .nitem.sticky.sz-l .nw { display: inline-block; max-width: 100%; } /* ห่อวลีไว้ ไม่ให้ขาดกลางคำ */
#stage .nitem.sticky .ntag { background: none; color: var(--pp-sub); text-shadow: none; }
#stage .nitem.sticky .ntag .ncount { background: color-mix(in oklab, var(--pp-ink) 8%, transparent); }

/* เรียบ: กระดาษพาสเทลสีเดียวกับพื้น + ขอบขาวแบบการ์ดรูป */
body.nt-clean #stage .nitem.sticky { --pp: oklch(from var(--c0, #F5C542) .975 .035 h); }
/* ภาพเต็มจอ: กระจกฝ้าบนพื้นสีรูป ตัวขาว */
body.nt-photo #stage .nitem.sticky { --pp: color-mix(in srgb, var(--c0, #0A6CF1) 30%, rgba(255,255,255,.2)); --pp-ink: #fff; --pp-sub: rgba(255,255,255,.62);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 24px 48px -14px rgba(0,0,0,.5); }
body.nt-photo #stage .nitem.sticky::before { background: linear-gradient(180deg, rgba(255,255,255,.12), transparent); }
/* สมุด: กระดาษมีเส้นบรรทัด + เส้นกั้นหน้าแดง · วันที่เขียนลายมือ */
body.nt-book #stage .nitem.sticky { --pp: #FFFDF6; --pp-sub: #7A86A0; }
body.nt-book #stage .nitem.sticky::before { display: none; }
body.nt-book #stage .nitem.sticky .ntxt { line-height: 34px; padding: 30px 22px 20px 40px; background-attachment: local;
  background-image: linear-gradient(90deg, transparent 28px, rgba(229,101,101,.4) 28px 30px, transparent 30px), repeating-linear-gradient(transparent 0 33px, #DCE5F3 33px 34px);
  background-position: 0 0, 0 30px; }
body.nt-book #stage .nitem.sticky.sz-m .ntxt { display: block; font-size: 22px; padding-bottom: 20px; }
body.nt-book #stage .nitem.sticky.sz-s .ntxt { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 40px), transparent); }
body.nt-book #stage .nitem.sticky.sz-l .ntxt { display: block; text-align: left; font-size: 26px; line-height: 34px; padding-top: 30px; }
/* มืด: กระดาษกรมท่าเข้ม ตัวครีมอุ่น · แถบสีวิชาเรืองจาง ๆ ด้านบน */
body.nt-night #stage .nitem.sticky { --pp: color-mix(in srgb, var(--c0, #7FB6FF) 10%, #141828); --pp-ink: #F3E9D2; --pp-sub: rgba(232,236,247,.42); filter: none !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), 0 24px 44px -16px #000; }
body.nt-night #stage .nitem.sticky::before { height: 3px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--c0, #7FB6FF) 80%, #fff), transparent); opacity: .7; }

/* สมุด (โพลารอยด์): ป้ายวันที่ย้ายไปอยู่ขอบขาวล่าง เขียนเหมือนลายมือ */
body.focus-on.nt-book #stage .nitem:not(.empty) .ntag { bottom: -31px; padding: 0 4px; height: 28px; background: none; color: #5E6B85; text-shadow: none; font-family: var(--hand); font-size: 13px; font-weight: 500; }
body.focus-on.nt-book #stage .nitem:not(.empty) .ntag .ncount { background: #EEF2F9; -webkit-backdrop-filter: none; backdrop-filter: none; color: #0B1B4D; }
@media (prefers-reduced-motion: reduce) { #stage .nitem .zoom { transition: none; } }

/* ---- การ์ดว่าง "ยังไม่มีโน้ต" (เจ้าของ 3 ธ.ค.: สีกับฟอนต์แปลก ไม่ชัด) — ใช้สีของธีมแทนเทาคงที่ ---- */
#stage .nitem.empty { border: 1.5px dashed color-mix(in srgb, var(--n-ink, #0B1B4D) 28%, transparent); border-radius: 22px; color: var(--n-ink, #0B1B4D);
  background: color-mix(in srgb, var(--n-ink, #0B1B4D) 5%, transparent); }
.nempty { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 270px; font-family: var(--disp); }
.nemp-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 8px;
  background: color-mix(in srgb, var(--n-ink, #0B1B4D) 10%, transparent); color: var(--n-ink, #0B1B4D); }
.nemp-ic svg { width: 28px; height: 28px; }
.nempty b { font-size: 19px; font-weight: 800; color: var(--n-ink, #0B1B4D); line-height: 1.35; }
.nempty p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--n-sub, #5E6B85); }
.nemp-btns { display: flex; gap: 8px; margin-top: 16px; }
#stage .nitem.empty .nemp-btns button { margin: 0; height: 44px; padding: 0 16px 0 13px; border-radius: 22px; display: inline-flex; align-items: center; gap: 6px; font: 700 15px var(--disp); white-space: nowrap; }
.nemp-btns svg { width: 18px; height: 18px; }
.nemp-1 { background: var(--n-1bg, #0A6CF1); color: var(--n-1ink, #fff); box-shadow: var(--n-btn-sh, none); }
.nemp-2 { background: var(--n-2bg, #F1F4F9); color: var(--n-2ink, #0B1B4D); box-shadow: inset 0 0 0 1.5px var(--n-2bd, transparent); }
body.nt-book #stage .nitem.empty .nemp-2 { box-shadow: inset 0 0 0 2px var(--n-2bd), var(--n-btn-sh); }
body.nt-book #stage .nitem.empty { background: rgba(255,255,255,.7); border-color: #9AA8C2; }

/* ---- 0.40 แจ้งเตือนของห้อง: งาน · แชท · พักห้อง · กันปั่น ---- */
.rm-nbox .rm-grp { margin: 14px 0 8px; }
.rm-nbox .rm-grp:first-of-type { margin-top: 4px; }
.rm-nbox .rm-tip { margin: 6px 2px 0; }
.rm-noff { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 10px 10px 14px; border-radius: 16px; background: #FFF4E0; color: #7A4B00; font: 700 14px var(--disp); margin-bottom: 6px; }
.rm-noff .btn.sm { height: 36px; padding: 0 16px; border-radius: 18px; }
.rm-snz { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; font: 700 14px var(--disp); color: var(--text-2); }
.rm-snz > span { margin-right: 2px; }
.rm-snzb { height: 38px; padding: 0 14px; border-radius: 19px; background: var(--surface); font: 700 14px var(--disp); color: var(--ink); }
.rm-snz.on { justify-content: space-between; padding: 10px 14px; border-radius: 16px; background: #EEF1FF; color: #3A3F9E; margin: 0 0 6px; }
.rm-safe { margin-top: 16px; border-radius: 16px; background: #EFF8F3; padding: 2px 14px; }
.rm-safe summary { cursor: pointer; padding: 10px 0; font: 700 14px var(--disp); color: #1F7A50; list-style: none; }
.rm-safe summary::-webkit-details-marker { display: none; }
.rm-safe summary::after { content: ' ›'; }
.rm-safe[open] summary::after { content: ' ⌄'; }
.rm-safe ul { margin: 0 0 12px; padding-left: 18px; font-size: 13.5px; line-height: 1.55; color: #2F5E46; }
.rm-safe li + li { margin-top: 4px; }
.ch-bell { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); flex: none; font-size: 18px; margin-left: 6px; }
.ch-bell.off { background: #EEF1FF; }
