/* จดไว — ชุดออกแบบเวอร์ชัน 2 "Soft Objects" (พาสเทลชมพู ฟ้า เหลือง ลาเวนเดอร์ มีมิติ) · ไม่มีฟอนต์/ไฟล์จากเว็บอื่น */
/* ฟอนต์ให้ผู้ใช้เลือก (เจ้าของตัดสิน 8 ต.ค. 2569) — ทุกตัว SIL OFL 1.1 ดู docs/licenses/fonts-OFL.md · เก็บบนเซิร์ฟเวอร์เราเอง ·
   แยกไฟล์ไทย/ละติน น้ำหนัก 400/700 · เบราว์เซอร์โหลดเฉพาะฟอนต์ที่ถูกใช้จริง · ค่าเริ่มต้น Sarabun · เปลี่ยนด้วย <html data-font="…"> */
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/sarabun-thai-400.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/sarabun-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/sarabun-thai-700.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/sarabun-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Google Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/assets/googlesans-thai.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Google Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/assets/googlesans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Mali"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/mali-thai-400.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Mali"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/mali-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Mali"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/mali-thai-700.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Mali"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/mali-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Thai"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/ibmplexsansthai-thai-400.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "IBM Plex Sans Thai"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/ibmplexsansthai-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Thai"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/ibmplexsansthai-thai-700.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "IBM Plex Sans Thai"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/ibmplexsansthai-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Prompt"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/prompt-thai-400.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Prompt"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/prompt-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Prompt"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/prompt-thai-700.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Prompt"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/prompt-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Anuphan"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/assets/anuphan-thai.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Anuphan"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/assets/anuphan-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #fbf9fd; --surface: #fff; --ink: #291b2e; --muted: #524858; --line: #ece2f1;
  --primary: #a84077; --primary-ink: #5f2a48;
  --pink: #fce0ed; --blue: #e0f6fc; --yellow: #fff2c7; --lilac: #eee2fa; --mint: #e3f6ec;
  --danger: #a43453; --ok: #2f6f58;
  --clay: inset 0 2px 2px #ffffffed, inset 0 -3px 3px #ac7aaf12, 0 6px 15px #9b7aa414;
  --font: "Sarabun", "Noto Sans Thai", "Sukhumvit Set", "Leelawadee UI", "Thonburi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --brand-font: var(--font);
  --nav-h: 84px;
}
html[data-font="anuphan"] { --font: "Anuphan", "Noto Sans Thai", "Sukhumvit Set", "Leelawadee UI", "Thonburi", system-ui, -apple-system, "Segoe UI", sans-serif; }
html[data-font="googlesans"] { --font: "Google Sans", "Noto Sans Thai", "Sukhumvit Set", "Leelawadee UI", "Thonburi", system-ui, -apple-system, "Segoe UI", sans-serif; }
html[data-font="mali"] { --font: "Mali", "Noto Sans Thai", "Sukhumvit Set", "Leelawadee UI", "Thonburi", system-ui, -apple-system, "Segoe UI", sans-serif; }
html[data-font="ibmplexsansthai"] { --font: "IBM Plex Sans Thai", "Noto Sans Thai", "Sukhumvit Set", "Leelawadee UI", "Thonburi", system-ui, -apple-system, "Segoe UI", sans-serif; }
html[data-font="prompt"] { --font: "Prompt", "Noto Sans Thai", "Sukhumvit Set", "Leelawadee UI", "Thonburi", system-ui, -apple-system, "Segoe UI", sans-serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.65; color: var(--ink);
  background: radial-gradient(ellipse at 5% 5%, #ffe5f159, transparent 42%), radial-gradient(ellipse at 95% 20%, #ddf5ff65, transparent 45%), var(--bg);
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--primary); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #b075a5; outline-offset: 3px; border-radius: 10px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #ba94b4; outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; font-weight: 700; line-height: 1.45; }
h2 { font-size: 19px; line-height: 1.5; }
h3 { font-size: 16px; line-height: 1.55; }
[hidden] { display: none !important; }

/* ไอคอน: ชุด SVG มีมิติ (ไฟล์ /assets/icons.svg) */
.icon { width: 24px; height: 24px; flex: none; overflow: visible; vertical-align: middle; }

/* ───── แบรนด์ ───── */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo { width: 46px; height: 46px; border-radius: 14px; flex: none; box-shadow: 0 3px 6px #95587c26; display: block; }
.brand strong { display: block; font: 900 26px/1.1 var(--brand-font); letter-spacing: -.6px; color: #2f192f; }
.brand small { display: block; font-size: 12px; line-height: 1.45; color: #5d4f5f; }

/* ───── โครงหน้า ───── */
.shell { max-width: 1360px; margin: 0 auto; min-height: 100vh; }
.sidebar { display: none; }
.main { min-width: 0; padding: 20px 18px calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.page-head p { margin-top: 2px; color: var(--muted); font-size: 14px; }
.page-head .btn { flex: none; }

@media (min-width: 861px) {
  .shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; padding: 30px 18px;
    background: linear-gradient(160deg, #fffdfef5, #fcf7fde6 70%, #eff8ffcc); border-right: 1px solid #fff; box-shadow: 5px 0 30px #a388ad0b;
  }
  .side-nav { display: grid; gap: 8px; }
  .side-bottom { margin-top: auto; border-top: 1px solid #f0e5f3; padding-top: 16px; font-size: 13px; color: var(--muted); }
  .main { padding: 30px 40px 64px; }
  .main.readable > * { max-width: 860px; }
  .topbar { display: none; }
  .bottom-nav { display: none !important; }
}

/* เมนู */
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 10px 14px; border-radius: 15px;
  border: 1px solid transparent; color: #514458; font-weight: 500; font-size: 15px; text-decoration: none; transition: background .18s;
}
.nav-item .icon { width: 28px; height: 28px; }
.nav-item:hover { background: #fff6fb; }
.nav-item.active { background: linear-gradient(140deg, #fff2f8, #f7ddec); border-color: #fff; box-shadow: inset 0 1px 1px #fff, 0 4px 10px #aa689316; color: var(--primary-ink); font-weight: 700; }
.side-nav .nav-item.active::after { content: ''; position: absolute; right: 9px; top: 50%; width: 3px; height: 20px; margin-top: -10px; border-radius: 4px; background: #ca6e9e; }

.bottom-nav {
  position: fixed; z-index: 20; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-around; gap: 2px; padding: 7px 6px;
  border: 1px solid #fff; border-radius: 25px; background: linear-gradient(145deg, #fffefef7, #fcf2faf7);
  box-shadow: inset 0 2px 2px #fff, 0 -5px 28px #c299b620, 0 8px 20px #91729918;
}
.bottom-nav .nav-item { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; min-height: 58px; padding: 4px 2px; font-size: 12px; background: none; box-shadow: none; border: 0; }
.bottom-nav .nav-item span { padding: 0 8px; border-radius: 8px; white-space: nowrap; }
.bottom-nav .nav-item.active { color: var(--primary-ink); background: none; box-shadow: none; }
.bottom-nav .nav-item.active span { background: linear-gradient(140deg, #f8d5e9, #e7b0d0); box-shadow: inset 0 1px #fff0f8, 0 2px 3px #bd7da329; font-weight: 700; }
.add-fab {
  flex: none; width: 60px; height: 60px; margin-top: -24px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  border: 4px solid #fff5fc; background: radial-gradient(at 25% 15%, #ffdbf0, transparent 48%), linear-gradient(130deg, #ed9cd1 20%, #cbaff0 58%, #83dcee);
  box-shadow: inset 0 2px 2px #fff5ffcc, inset 0 -3px 4px #ab70b329, 0 5px 12px #ab76b940; transition: transform .15s;
}
.add-fab .icon { width: 30px; height: 30px; }
.add-fab:active { transform: translateY(2px); }

/* ───── ปุ่ม ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 9px 17px;
  border: 1px solid #f0e5f1; border-radius: 15px; background: linear-gradient(155deg, #fff, #f9f1fa); box-shadow: var(--clay);
  color: #44334c; font-size: 15px; font-weight: 600; line-height: 1.3; text-decoration: none; text-align: center; cursor: pointer;
  transition: transform .14s, box-shadow .14s, filter .14s;
}
.btn .icon { width: 22px; height: 22px; }
.btn:hover { filter: brightness(.98); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 2px 5px #7348621f, 0 1px 3px #87608312; }
.btn.primary { color: #fff; border-color: #de87b1; background: linear-gradient(155deg, #c66d9c, #b34e86 50%, #9e3c73); box-shadow: inset 0 2px 2px #ffd4e866, inset 0 -3px 0 #7e245743, 0 6px 13px #9e47792b; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.soft { color: #50325f; border-color: #e7d2ed; background: linear-gradient(145deg, #fff8ff, #ecdaf6); }
.btn.danger { color: var(--danger); border-color: #f5d2de; background: linear-gradient(145deg, #fff8fa, #ffe3eb); }
.btn.small { min-height: 44px; padding: 7px 13px; font-size: 14px; border-radius: 13px; }
.btn.block { display: flex; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; background: #eee9f0; color: #665d6a; border-color: #e5dde9; box-shadow: none; transform: none; filter: none; }
.btn.line-login { color: #fff; border-color: #2fa866; background: linear-gradient(145deg, #0a9a4f, #067a3e); box-shadow: inset 0 2px #9fe6bc66, inset 0 -3px #008a4136, 0 4px 9px #1b9c4c1c; }
.btn.tg-login { color: #0f4362; border-color: #cbe2ed; background: linear-gradient(145deg, #f1fcff, #d7edf9); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.icon-button {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 15px; flex: none;
  border: 1px solid #fff; background: linear-gradient(145deg, #fff, #f9f3fb); box-shadow: var(--clay); color: #67506b;
}
.icon-button .icon { width: 24px; height: 24px; }
.icon-button:active { transform: translateY(2px); }
.icon-button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.flip { transform: rotate(180deg); }
.turn-up { transform: rotate(-90deg); }
.turn-down { transform: rotate(90deg); }

/* ───── ช่องกรอก ───── */
.field {
  width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #e3d3e9; border-radius: 14px;
  background: linear-gradient(145deg, #f9f3fc, #fff); box-shadow: inset 0 2px 4px #8e6c9a10; font-size: 16px;
}
textarea.field { resize: vertical; line-height: 1.6; }
.label { display: block; margin: 14px 0 6px; font-size: 14px; font-weight: 600; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 50px; height: 30px; margin: 0; cursor: pointer;
  border-radius: 20px; border: 1px solid #9783a6; background: linear-gradient(#d4c8dc, #c3b5ce); box-shadow: inset 0 2px 4px #65436e24;
}
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(145deg, #fff, #faf1fc); box-shadow: 0 2px 4px #76597d30; transition: transform .18s; }
.switch:checked { background: linear-gradient(135deg, #de9fc5, #b267a0); border-color: #b879a7; }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid #b075a5; outline-offset: 3px; }

/* ───── ป้ายสี ───── */
.pink { background: var(--pink); color: #5c374d; }
.blue { background: var(--blue); color: #204b56; }
.yellow { background: var(--yellow); color: #524311; }
.lilac { background: var(--lilac); color: #4b385d; }
.tag { display: inline-block; padding: 1px 9px; border-radius: 8px; font-size: 13px; white-space: nowrap; border: 1px solid #ffffff80; box-shadow: inset 0 1px #ffffff80; }
.status { display: inline-block; padding: 2px 9px; border-radius: 8px; font-size: 13px; white-space: nowrap; background: var(--mint); color: var(--ok); }
.status.off { background: #f1ecf3; color: var(--muted); }

/* ───── มาสคอต (เล็ก ไม่บังปุ่ม) ───── */
.mascot-hero {
  position: relative; isolation: isolate; display: flex; align-items: center; min-height: 150px; margin: 0 0 20px; padding: 20px;
  border-radius: 26px; border: 1px solid #fff; overflow: hidden;
  background: linear-gradient(115deg, #fbd6ec 0%, #ead8f7 53%, #cbf0fa 100%);
  box-shadow: inset 0 3px 3px #ffffffe6, inset 0 -5px 6px #b182c12b, 0 12px 25px #c695c32e;
}
.mascot-hero::before { content: ''; position: absolute; inset: 1px; z-index: -1; border-radius: 25px; pointer-events: none; background: radial-gradient(ellipse at 20% 0%, #ffffff83, transparent 60%); }
.hero-copy { position: relative; z-index: 2; width: 60%; }
.hero-copy h2 { font-size: 24px; line-height: 1.45; }
.hero-copy p { margin-top: 6px; font-size: 14px; color: #4e3b53; }
.mascot-hero > img { position: absolute; right: 6px; bottom: 0; width: 150px; height: 150px; object-fit: contain; object-position: bottom; pointer-events: none; filter: drop-shadow(0 10px 6px #9558841a); }
.hero-mini { min-height: 104px; padding: 16px 18px; }
.hero-mini .hero-copy { width: 68%; }
.hero-mini .hero-copy h2 { font-size: 18px; }
.hero-mini .hero-copy p { font-size: 13px; }
.hero-mini > img { width: 104px; height: 104px; right: 8px; }
@media (min-width: 861px) {
  .mascot-hero { min-height: 182px; padding: 26px 32px; }
  .hero-copy h2 { font-size: 28px; }
  .mascot-hero > img { width: 196px; height: 196px; right: 28px; }
  .hero-mini { min-height: 112px; padding: 20px 26px; }
  .hero-mini .hero-copy h2 { font-size: 19px; }
  .hero-mini > img { width: 124px; height: 124px; right: 24px; }
}

/* ───── ช่องจดเร็ว ───── */
.composer {
  position: relative; margin-bottom: 16px; padding: 20px 18px 18px; border-radius: 24px; border: 1px solid #fff;
  background: linear-gradient(150deg, #fff, #fffafd); box-shadow: var(--clay), 0 11px 25px #ac82b415;
}
.composer::before { content: ''; position: absolute; top: 0; left: 24px; right: 24px; height: 4px; border-radius: 10px; background: linear-gradient(90deg, #f6a7d0, #d9b7f4, #a9dfee); opacity: .9; }
.composer h2 { font-size: 17px; margin: 2px 0 12px; }
.composer-entry { display: flex; gap: 10px; align-items: stretch; }
.composer textarea {
  flex: 1; min-width: 0; min-height: 70px; padding: 13px 14px; border: 1px solid #eae0ef; border-radius: 16px; resize: vertical;
  background: linear-gradient(135deg, #f9f5fb, #fdfbfe); box-shadow: inset 0 3px 7px #79528b0d, inset 0 1px 2px #70548010, 0 1px #fff; font-size: 16px; line-height: 1.6;
}
.composer textarea::placeholder { color: #665d6c; }
.composer-entry .btn { min-width: 100px; border-radius: 17px; }
.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.quick {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 68px; padding: 8px 4px;
  border: 1px solid #fff; border-radius: 17px; box-shadow: var(--clay); color: #423246; font-size: 13px; font-weight: 500; transition: transform .15s;
}
.quick .icon { width: 30px; height: 30px; }
.quick:active { transform: translateY(2px); }
.quick.pink { background: linear-gradient(145deg, #fff7fb, #fce0ec); }
.quick.yellow { background: linear-gradient(145deg, #fffdf1, #fff0bf); }
.quick.blue { background: linear-gradient(145deg, #f2fdff, #d9f2fc); }
@media (max-width: 420px) {
  .composer-entry { flex-direction: column; }
  .composer-entry .btn { width: 100%; min-height: 48px; }
}
@media (min-width: 861px) { .quick { flex-direction: row; min-height: 54px; gap: 8px; font-size: 14px; } .quick-actions { max-width: 540px; } }

/* แถบใบร่างรอยืนยัน */
.draft-strip {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; margin: 0 0 20px; padding: 10px 16px; text-align: left;
  border-radius: 18px; border: 1px solid #fff4d5; background: linear-gradient(145deg, #fff9e3, #ffedb3);
  box-shadow: inset 0 2px 1px #fff, inset 0 -2px 2px #cc9f3c17, 0 6px 15px #b68c4513; color: #4f3c1a; font-weight: 600; font-size: 15px;
}
.draft-strip span { flex: 1; }
.draft-strip .icon:first-child { width: 28px; height: 28px; }
.draft-strip .icon:last-child { width: 18px; height: 18px; }

/* ───── เนื้อหา ───── */
.content-grid { display: grid; gap: 22px; }
@media (min-width: 1100px) { .content-grid { grid-template-columns: minmax(0, 1fr) 250px; gap: 26px; } }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.section-head h2 { font-size: 18px; }
.subhead { margin: 22px 0 10px; font-size: 16px; color: #443349; display: flex; align-items: center; gap: 8px; }
.subhead .icon { width: 24px; height: 24px; }
.segmented { display: inline-flex; gap: 3px; padding: 4px; border-radius: 13px; border: 1px solid #fff; background: linear-gradient(130deg, #f4ebf7, #fdfaff); box-shadow: inset 0 1px 3px #85618e13, 0 3px 8px #97759e10; }
.segmented button { min-height: 44px; padding: 5px 14px; border-radius: 10px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.segmented button[aria-pressed="true"] { color: #fff; font-weight: 600; background: linear-gradient(145deg, #b65d92, #93427a); box-shadow: inset 0 1px 1px #ffd8edaa, 0 3px 5px #a3608224; }
.list { display: grid; gap: 12px; }
.day-label { margin: 14px 2px 2px; font-size: 14px; font-weight: 700; color: #5a465f; }
.day-label:first-child { margin-top: 0; }

/* การ์ดรายการ */
.task {
  position: relative; display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 14px 12px;
  border: 1px solid #fff; border-radius: 20px; background: linear-gradient(140deg, #fff, #fffcff);
  box-shadow: inset 0 1px #fff, inset 0 -2px 3px #c09bca09, 0 7px 18px #83658c0c; transition: opacity .2s;
}
.task.is-done { opacity: .72; }
.task.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.check {
  position: relative; flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin-top: 2px; border-radius: 8px;
  border: 1.5px solid #9783a6; background: linear-gradient(140deg, #fff, #f4eef8); box-shadow: inset 0 2px 2px #fff, 0 2px 1px #c3b4ca73;
}
.check::before { content: ''; position: absolute; inset: -9px; }
.check .icon { width: 20px; height: 20px; visibility: hidden; color: #69234c; }
.check[aria-pressed="true"] { border-color: #b674a0; background: linear-gradient(145deg, #f6d9ea, #e6b5d4); }
.check[aria-pressed="true"] .icon { visibility: visible; }
.check:disabled { cursor: default; }
.tag-text { font-size: 13px; color: #5a465f; }
.task-symbol { flex: none; display: grid; place-items: center; width: 30px; height: 32px; }
.task-symbol .icon { width: 28px; height: 28px; }
.task-body { flex: 1; min-width: 0; }
.task-title { display: block; font-size: 16px; font-weight: 600; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-time { display: inline-block; margin-right: 6px; font: 800 14px/1 var(--brand-font); color: #674e6a; vertical-align: 1px; }
.task-detail { margin-top: 3px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.tag-link { min-height: 40px; padding: 2px 9px; border-radius: 8px; background: #f6eef9; color: #5a3b63; font-size: 13px; }
.task-more { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -4px -4px 0 0; border-radius: 12px; color: #7b667d; background: #fcf8fd; }
.task-more .icon { width: 22px; height: 22px; }
.thumb { display: block; max-width: 100%; max-height: 260px; margin-top: 8px; border-radius: 12px; }
.task audio { display: block; width: 100%; margin-top: 8px; }
@media (min-width: 861px) { .task { padding: 17px 16px; gap: 12px; } }

/* สรุปด้านข้าง */
.rail { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.summary-tile {
  display: block; padding: 15px; border-radius: 20px; border: 1px solid #fff; text-decoration: none; color: inherit;
  background: linear-gradient(145deg, #fffef9, #fff3d6); box-shadow: var(--clay);
}
.summary-tile + .summary-tile { background: linear-gradient(145deg, #fff8fd, #fce4f0); }
.summary-tile .icon { width: 36px; height: 36px; margin-bottom: 6px; }
.summary-tile small { display: block; font-size: 14px; color: #56475a; }
.summary-tile strong { display: block; font: 800 22px/1.35 var(--brand-font); color: #3e233b; }
.rail-mascot { display: none; }
@media (min-width: 1100px) {
  .rail { grid-template-columns: 1fr; gap: 16px; }
  .summary-tile { padding: 20px; }
  .rail-mascot { display: block; text-align: center; padding: 6px; }
  .rail-mascot img { width: 132px; height: 132px; object-fit: contain; }
  .rail-mascot p { font-size: 14px; color: #5d4860; }
}

/* ว่าง */
.empty { padding: 22px 18px; text-align: center; border-radius: 20px; border: 1px solid #fff; background: linear-gradient(135deg, #fff8fc, #f3f4ff); box-shadow: var(--clay); }
.empty img { display: block; width: 96px; height: 96px; margin: 0 auto 8px; object-fit: contain; }
.empty h3 { font-size: 16px; }
.empty p { margin-top: 4px; font-size: 14px; color: var(--muted); }

/* แผง (ตั้งค่า/ปฏิทิน) */
.panel { margin-bottom: 18px; padding: 18px; border-radius: 23px; border: 1px solid #fff; background: linear-gradient(145deg, #fff, #fffcff); box-shadow: var(--clay); }
.panel h2 { margin-bottom: 6px; font-size: 18px; }
.panel > p { font-size: 14px; color: var(--muted); }
@media (min-width: 861px) { .panel { padding: 24px; } }
.settings-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f0e7f3; }
.settings-row:last-child { border-bottom: 0; }
.settings-row .grow { flex: 1; min-width: 0; }
.settings-row strong { display: block; font-size: 15px; }
.settings-row small { display: block; font-size: 13px; color: var(--muted); }
.settings-row input[type="time"] { width: 116px; min-height: 44px; padding: 6px 8px; border: 1px solid #e7dbea; border-radius: 12px; background: #faf6fc; box-shadow: inset 0 2px 3px #8363890b; font-size: 16px; }
.settings-row.wrap { flex-wrap: wrap; }
.settings-row.wrap > .grow { flex: 1 1 200px; }
.settings-row.wrap > .btns { margin-top: 0; }
.icon-wrap { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 1px solid #fff; background: linear-gradient(145deg, #fff, #f7edf9); box-shadow: var(--clay); }
.icon-wrap .icon { width: 30px; height: 30px; }
@media (max-width: 360px) { .settings-row .icon-wrap { display: none; } }
.order { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.order li { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-radius: 15px; background: #fbf6fd; border: 1px solid #f1e6f4; }
.order li span { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; }
.order li em { display: block; font-style: normal; font-size: 12px; color: var(--muted); font-weight: 500; }
.danger-zone { padding-top: 4px; }
.danger-zone summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--danger); font-weight: 600; }
.danger-zone form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.danger-zone .field { flex: 1 1 200px; }
.note { padding: 12px 14px; border-radius: 14px; background: #fff7dc; color: #4f401c; font-size: 14px; }
.small, .meta { font-size: 14px; color: var(--muted); }
.error { color: var(--danger); font-size: 14px; margin: 8px 0; }

/* ค้นหา/ตัวกรอง */
.search { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 2px 14px; border-radius: 18px; border: 1px solid #eee2f2; background: #fff; box-shadow: inset 0 2px 4px #9b7baa10, 0 3px 9px #a27fab06; }
.search .icon { width: 24px; height: 24px; }
.search input { flex: 1; min-width: 0; min-height: 50px; border: 0; background: none; outline: none; font-size: 16px; }
.category-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin: 0 -2px 4px; scrollbar-width: none; overscroll-behavior-x: contain; }
.category-scroll::-webkit-scrollbar { display: none; }
.chips-wrap { position: relative; }
.chips-wrap::after {
  content: ''; position: absolute; top: 0; right: -2px; bottom: 12px; width: 48px; pointer-events: none;
  background: linear-gradient(90deg, #fbf9fd00, #fbf9fdf2 70%); opacity: 0; transition: opacity .2s;
}
.chips-wrap.more-right::after { opacity: 1; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 7px 13px; border-radius: 14px; border: 1px solid #fff; background: linear-gradient(135deg, #fff, #f7effa); box-shadow: var(--clay); color: #524358; font-size: 14px; white-space: nowrap; }
.chip .icon { width: 24px; height: 24px; }
.chip[aria-pressed="true"] { color: #592946; border-color: #f2d0e3; background: linear-gradient(140deg, #fbe6f2, #ebccdf); box-shadow: inset 0 1px #fff, 0 4px 8px #ac719920; font-weight: 600; }
.filter-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.filter-line select { min-height: 44px; max-width: 170px; padding: 6px 10px; border: 1px solid #eadfeb; border-radius: 12px; background: linear-gradient(145deg, #fff, #f7f0fb); box-shadow: var(--clay); font-size: 16px; }
.money-bars { display: grid; gap: 8px; margin-top: 10px; }
.money-bars .cat { font-size: 14px; }
.bar { height: 8px; margin-top: 3px; border-radius: 4px; background: linear-gradient(90deg, #e7a4cb, #b9a2e8, #91d9eb); }

/* ปฏิทิน */
.calendar-layout { display: grid; gap: 14px; }
@media (min-width: 1100px) { .calendar-layout { grid-template-columns: 1.3fr 1fr; gap: 24px; } }
.cal-controls { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.cal-controls strong { flex: 1; min-width: 0; font-size: 16px; }
.cal-controls .btn.small { min-height: 44px; padding: 4px 12px; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.dayname { padding: 4px 0; text-align: center; font-size: 13px; color: #625366; }
.day {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 46px; padding: 2px 0;
  border-radius: 12px; border: 1px solid #fff; background: linear-gradient(145deg, #fff, #f2eaf8); box-shadow: inset 0 1px #fff, 0 2px 3px #9a80a010;
  font: 700 15px/1.2 var(--brand-font); color: #523c58;
}
.day .dots { display: flex; gap: 3px; height: 5px; margin-top: 4px; }
.day i { display: block; width: 5px; height: 5px; border-radius: 50%; background: #dc95bb; }
.day i:nth-child(2) { background: #89c9d8; }
.day i:nth-child(3) { background: #e9bf52; }
.day.today { outline: 2px solid #dc9bc4; outline-offset: -2px; }
.day[aria-pressed="true"] { color: #391831; border-color: #e5a4c8; background: linear-gradient(145deg, #e8acd0, #bf71a6); box-shadow: inset 0 2px 2px #ffdcf0, 0 4px 8px #b476a82b; }
.day[aria-pressed="true"] i { background: #fff1ba; }
@media (min-width: 861px) { .day { min-height: 60px; } .calendar { gap: 8px; } }

/* ───── หน้าเข้าสู่ระบบ / หน้าเดี่ยว ───── */
.login { max-width: 460px; margin: 0 auto; padding: 22px 18px 40px; text-align: center; }
.login .brand { justify-content: center; margin-bottom: 4px; }
.login-mascot { display: block; width: 150px; height: 150px; margin: 6px auto 8px; object-fit: contain; filter: drop-shadow(0 7px 8px #b47b971c); }
.login-mascot.small { width: 104px; height: 104px; }
.login h1 { font-size: 26px; line-height: 1.5; }
.login .lead { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.login .panel { margin-top: 20px; text-align: left; }
.login .btn.block + .btn.block { margin-top: 10px; }
.login details { margin-top: 14px; border-top: 1px solid #eee2f0; padding-top: 6px; }
.login summary { display: flex; align-items: center; min-height: 46px; cursor: pointer; font-weight: 600; }
.login form { margin-top: 6px; }
.login form .btn { margin-top: 12px; }
.login a[hidden] + a[hidden] + details { margin-top: 0; padding-top: 0; border-top: 0; }
.login .panel h2 { margin: 16px 0 4px; font-size: 17px; }
.login .note { margin-bottom: 4px; }
.login .code-field { font: 800 22px/1.2 var(--brand-font); letter-spacing: 3px; text-align: center; text-transform: uppercase; }
.login .foot { margin-top: 16px; font-size: 14px; }
.steps { margin: 10px 0 0; padding-left: 22px; text-align: left; }
.steps li { margin: 6px 0; }
@media (min-width: 861px) { .login-mascot { width: 172px; height: 172px; } .login h1 { font-size: 28px; } }

/* ───── หน้าต่าง (dialog) ───── */
dialog.sheet {
  width: min(520px, calc(100vw - 24px)); max-height: min(88dvh, 760px); padding: 0; color: var(--ink);
  border: 1px solid #fff; border-radius: 26px; background: linear-gradient(140deg, #fffcff, #fcf8ff); box-shadow: inset 0 2px 2px #fff, 0 25px 100px #6137543b;
}
dialog.sheet::backdrop { background: #3e264e66; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 8px; }
.sheet-head h2 { font-size: 20px; }
.sheet-body { padding: 0 20px 22px; overflow-y: auto; max-height: calc(min(88dvh, 760px) - 80px); }
.sheet-body > p { font-size: 14px; color: var(--muted); margin: 4px 0 12px; }
.sheet-mascot { float: right; width: 64px; height: 64px; margin: -2px 0 6px 10px; object-fit: contain; }
.reply-card { clear: both; margin-top: 12px; padding: 14px 15px; border-radius: 18px; border: 1px solid #fff; background: linear-gradient(145deg, #fff, #fcf4ff); box-shadow: var(--clay); }
.reply-card + .reply-card { margin-top: 10px; }
.reply-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.7; }
.reply-card .btns { margin-top: 12px; }
.sheet-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.menu-list { display: grid; gap: 8px; margin-top: 6px; }
.menu-list .btn { justify-content: flex-start; width: 100%; }
#replies .reply-card { margin: 0 0 12px; }

/* แจ้งผลสั้น */
.toast {
  position: fixed; z-index: 60; inset: auto auto calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)) 50%; margin: 0; overflow: visible; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 28px); padding: 10px 16px 10px 10px;
  border-radius: 16px; border: 1px solid #876b93; background: linear-gradient(130deg, #62466b, #41314a); color: #fff;
  box-shadow: inset 0 1px #cbaaed33, 0 10px 30px #45314d29; font-size: 15px;
}
.toast span { white-space: pre-wrap; }
.toast img { width: 36px; height: 36px; flex: none; object-fit: contain; }
.toast:not([popover]):not([hidden]), .toast:popover-open { display: flex; }
.toast[popover]:not(:popover-open) { display: none; }
.no-nav .toast, dialog[open] ~ .toast { bottom: 26px; }
@media (min-width: 861px) { .toast { bottom: 28px; } }

@media (prefers-reduced-motion: no-preference) {
  .mascot-hero > img { animation: mascot-enter .45s cubic-bezier(.2, .8, .2, 1) both; }
  .task { animation: soft-in .24s ease both; }
  dialog.sheet[open] { animation: sheet-in .2s ease both; }
  /* เคลื่อนอย่างเดียว ไม่เริ่มจากโปร่งใส — ถ้าแอนิเมชันหยุด (แท็บพื้นหลัง/ประหยัดแบต) เนื้อหายังมองเห็นครบ */
  @keyframes mascot-enter { from { transform: translateY(7px) rotate(-2deg); } to { transform: none; } }
  @keyframes soft-in { from { transform: translateY(3px); } to { transform: none; } }
  @keyframes sheet-in { from { transform: translateY(14px); } to { transform: none; } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 360px) {
  .main { padding-left: 12px; padding-right: 12px; }
  h1 { font-size: 26px; }
  .hero-copy h2 { font-size: 20px; }
  .mascot-hero > img { width: 124px; height: 124px; right: 0; }
  .bottom-nav { left: 6px; right: 6px; }
  .bottom-nav .nav-item { font-size: 11px; }
  .bottom-nav .nav-item span { padding: 0 5px; }
  .add-fab { width: 54px; height: 54px; }
  .quick { font-size: 12px; }
  .page-head .btn { padding: 7px 10px; }
}

/* ───── ตารางแยกรายหมวด (ระยะ 1 · 8 ต.ค. 2569) ───── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tbl-box { margin-bottom: 16px; }
.tbl-sum { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.sum-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 12px; border: 1px solid #fff; background: linear-gradient(145deg, #fff, #f7effa); box-shadow: var(--clay); }
.sum-chip small { font-size: 13px; color: var(--muted); }
.sum-chip strong { font: 800 16px/1.3 var(--brand-font); }
.sum-chip.sum-in strong { color: #1f5f45; }
.sum-chip.sum-out strong { color: #8c2442; }
.sum-chip.sum-warn strong { color: #7a5410; }
.amt-in { color: #1f5f45; font-weight: 700; white-space: nowrap; }
.amt-out { color: #8c2442; font-weight: 700; white-space: nowrap; }
.chip-s { display: inline-block; padding: 1px 8px; border-radius: 8px; font-size: 13px; line-height: 1.6; white-space: nowrap; background: #f1ebf4; color: #4a3d52; }
.chip-s.st-wait { background: #eae4fb; color: #463a6c; }
.chip-s.st-sent { background: #e0f2ea; color: #1f5f45; }
.chip-s.st-skip { background: #fff0c9; color: #6a4a0c; }
.chip-s.st-fail { background: #fde2ea; color: #8c2442; }
.chip-s.st-ok { background: #e2f3f8; color: #1f5566; }
.chip-s.pink { background: var(--pink); } .chip-s.blue { background: var(--blue); } .chip-s.yellow { background: var(--yellow); } .chip-s.lilac { background: var(--lilac); }
.tbl-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.tbl-title audio { display: block; width: 100%; max-width: 320px; margin-top: 6px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tbl-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.tbl-place { font-weight: 700; color: var(--ink); }
.tbl-thumb { display: block; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; border: 1px solid #fff; box-shadow: var(--clay); flex: none; }
.tbl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tbl-note { margin-left: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.month-nav { margin: 0 0 12px; }
.month-nav strong { text-align: center; }
.filter-line .segmented { flex-wrap: wrap; }

/* คอม: ตารางจริง */
.tbl-wrap { border-radius: 20px; border: 1px solid #fff; background: linear-gradient(145deg, #fff, #fffcff); box-shadow: var(--clay); overflow-x: auto; }
.tbl { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; }
.tbl thead th { padding: 10px 12px; text-align: left; font-size: 13px; font-weight: 700; color: var(--muted); background: #faf5fc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #f2ebf5; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fffafd; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .c-check, .tbl .c-thumb, .tbl .c-icon { width: 52px; }
.tbl .c-act { width: 1%; white-space: nowrap; text-align: right; }
.tbl .c-time { white-space: nowrap; font: 700 14px/1.3 var(--brand-font); color: #5d4563; }
.tbl .c-muted { color: var(--muted); font-size: 14px; }
.tbl .task-more { margin: 0; }
.tbl-group th { padding: 12px 12px 6px; text-align: left; font-size: 14px; font-weight: 800; color: #4f3a57; background: linear-gradient(90deg, #fbeef6, #f6f3fd); border-bottom: 1px solid var(--line); }
.tbl tr.is-late td { background: #fff7f9; }
.tbl tr.is-done td, .tbl tr.is-past td { color: var(--muted); }
.tbl tr.is-done .tbl-title { text-decoration: line-through; }

/* มือถือ: แถวบาง 2 บรรทัด มีเส้นคั่น */
.tbl-m { border-radius: 20px; border: 1px solid #fff; background: linear-gradient(145deg, #fff, #fffcff); box-shadow: var(--clay); overflow: hidden; }
.tbl-mgroup { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; margin: 0; padding: 10px 14px 6px; font-size: 14px; font-weight: 800; color: #4f3a57; background: linear-gradient(90deg, #fbeef6, #f6f3fd); border-bottom: 1px solid var(--line); }
.tbl-mgroup .tbl-note { margin: 0; }
.tbl-row { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 10px 8px 12px; border-bottom: 1px solid #f2ebf5; }
.tbl-row:last-child { border-bottom: 0; }
.tbl-row.is-late { background: #fff7f9; }
.tbl-row.is-done, .tbl-row.is-past { color: var(--muted); }
.tbl-row.is-done .tbl-title { text-decoration: line-through; }
.tbl-mmain { flex: 1; min-width: 0; }
.tbl-mtitle { font-size: 16px; line-height: 1.5; }
.tbl-msub { margin-top: 2px; font-size: 13px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.tbl-row > .amt-in, .tbl-row > .amt-out, .tbl-row > strong { flex: none; font-size: 16px; }
.tbl-row .task-more { margin: 0; width: 44px; height: 44px; }
.tbl-row .btn.small { min-height: 44px; padding: 6px 10px; }

/* ตัวเลือกฟอนต์ในหน้าตั้งค่า — ตัวอย่างแสดงด้วยฟอนต์นั้นจริง */
.font-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.font-opt { position: relative; display: grid; gap: 2px; min-height: 64px; padding: 10px 44px 10px 14px; text-align: left; border-radius: 16px; border: 1.5px solid #ece2f1; background: linear-gradient(145deg, #fff, #faf6fc); box-shadow: var(--clay); color: var(--ink); }
.font-opt strong { font-size: 16px; }
.font-opt span { font-size: 15px; color: var(--muted); }
.font-opt small { font-size: 12px; color: var(--muted); }
.font-opt[aria-checked="true"] { border-color: #b86a97; background: linear-gradient(145deg, #fff7fb, #f6e3ef); }
.font-opt[aria-checked="true"]::after { content: ""; position: absolute; right: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; background: radial-gradient(circle, #fff 30%, #a84077 34%); }
.fp-sarabun { font-family: "Sarabun", var(--font); }
.fp-anuphan { font-family: "Anuphan", var(--font); }
.fp-googlesans { font-family: "Google Sans", var(--font); }
.fp-mali { font-family: "Mali", var(--font); }
.fp-ibmplexsansthai { font-family: "IBM Plex Sans Thai", var(--font); }
.fp-prompt { font-family: "Prompt", var(--font); }
.font-box { margin-top: 12px; }
.font-pick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; text-align: left; border-radius: 16px; border: 1.5px solid #b86a97; background: linear-gradient(145deg, #fff7fb, #f6e3ef); box-shadow: var(--clay); color: var(--ink); }
.font-pick-text { flex: 1; min-width: 0; display: grid; }
.font-pick-text strong { font-size: 16px; }
.font-pick-text span { font-size: 15px; color: var(--muted); }
.font-pick .icon { width: 22px; height: 22px; color: #8b4f75; }
.font-box .font-list { margin-top: 10px; }

/* ───── VIP (9 ต.ค. 2569): ปุ่มมุมขวาบน + หน้า /vip ───── */
.vip-badge { display: inline-flex; align-items: center; flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; border: 1px solid #ffffffb3; box-shadow: 0 4px 14px #b0648a24; }
.vip-badge.is-free, .vip-badge.is-renew { color: #3b1530; background: linear-gradient(135deg, #f6c453, #ee7fb5); }
.vip-badge.is-trial { color: #6b4200; background: #fff3d6; border-color: #f3dca4; }
.vip-badge.is-vip { color: #4e3463; background: #f3ecfa; border-color: #e3d4ee; }
.vip-badge:focus-visible { outline: 3px solid #9e3c73; outline-offset: 2px; }
.vip-badge .vb-short { display: none; }
.vip-badge.desk { display: none; }
@media (max-width: 380px) { .vip-badge .vb-long { display: none; } .vip-badge .vb-short { display: inline; } .vip-badge { padding: 0 13px; } }
@media (min-width: 861px) { .vip-badge.desk { display: inline-flex; } }
.vip-status { display: flex; align-items: center; gap: 14px; }
.vip-status .vip-crown { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; font-size: 28px; background: linear-gradient(135deg, #fff1c9, #ffd9ea); }
.vip-status strong { display: block; font-size: 19px; }
.vip-status small { display: block; color: var(--muted); font-size: 14px; }
.vip-usage { display: grid; gap: 10px; margin-top: 14px; }
.vip-meter { display: grid; gap: 4px; font-size: 14px; }
.vip-meter progress { width: 100%; height: 10px; accent-color: #b34e86; }
.vip-compare { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 15px; }
.vip-compare th, .vip-compare td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.vip-compare th { font-size: 13px; color: var(--muted); font-weight: 700; }
.vip-compare td.vip-col { font-weight: 700; color: #7a2d63; }
.vip-plans { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 560px) { .vip-plans { grid-template-columns: 1fr 1fr; } }
.vip-plan { display: grid; gap: 6px; padding: 16px; border-radius: 18px; border: 1.5px solid #ecd9ef; background: linear-gradient(145deg, #fff, #fbf3fd); }
.vip-plan strong { font-size: 18px; }
.vip-plan .vip-price { font-size: 26px; font-weight: 700; color: #7a2d63; }
.vip-plan small { color: var(--muted); font-size: 13px; }
.vip-pay { display: grid; gap: 14px; margin-top: 10px; }
@media (min-width: 700px) { .vip-pay { grid-template-columns: 260px 1fr; align-items: start; } }
.vip-qr { display: grid; justify-items: center; gap: 8px; padding: 14px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.vip-qr img { display: block; width: 100%; max-width: 240px; height: auto; image-rendering: pixelated; }
.vip-qr small { color: var(--muted); font-size: 13px; text-align: center; }
.vip-steps { display: grid; gap: 8px; margin: 0; padding-left: 22px; font-size: 15px; }
.vip-ref { display: inline-block; padding: 2px 10px; border-radius: 9px; background: #f6eefa; font-weight: 700; letter-spacing: .5px; }
.vip-upload { display: grid; gap: 8px; margin-top: 4px; }
.vip-upload input[type="file"] { font-size: 15px; max-width: 100%; }
.vip-wait { padding: 14px; border-radius: 16px; background: #fff7e3; border: 1px solid #f3dca4; color: #6b4200; font-size: 15px; }
.vip-warn { margin-top: 8px; font-size: 13px; color: var(--muted); }
.vip-history { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.vip-history li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: #fbf7fd; font-size: 14px; }
.vip-terms { margin: 6px 0 0; padding-left: 20px; font-size: 14px; color: var(--muted); display: grid; gap: 4px; }

/* ───── ดีไซน์ v2 ชุดแรก (10 ต.ค. 2569): กระดิ่งใบร่าง · ปุ่มเลิกทำ · เลื่อนเตือน · เสร็จวันนี้ ───── */
.top-actions, .head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; flex: none; }
.draft-bell { position: relative; display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 999px; border: 1px solid #f1d9e6; background: linear-gradient(145deg, #fff, #fbeef5); box-shadow: 0 4px 12px #b0648a1f; cursor: pointer; }
.draft-bell .icon { width: 26px; height: 26px; }
.draft-bell:focus-visible { outline: 3px solid #9e3c73; outline-offset: 2px; }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.bell-count[hidden] { display: none; }
.draft-bell.desk { display: none; }
@media (min-width: 861px) { .draft-bell.desk { display: inline-grid; } }
.draft-pick span { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-action { flex: none; min-height: 44px; margin-left: 4px; padding: 6px 14px; border-radius: 12px; border: 1px solid #f5d2e4; background: #fff; color: var(--primary-ink); font: inherit; font-weight: 700; cursor: pointer; }
.toast-action[hidden] { display: none; }
.toast-action:focus-visible { outline: 3px solid #f5d2e4; outline-offset: 2px; }
.snooze-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; margin: 14px 0 6px; }
.snooze-quick .btn { width: 100%; justify-content: flex-start; }
.today-progress { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--ok); }
.today-progress[hidden] { display: none; }
.today-progress progress { width: 120px; height: 10px; accent-color: var(--ok); }
.done-box { margin-top: 22px; }
.done-box > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 16px; font-weight: 700; color: #443349; cursor: pointer; }
.done-box > summary .icon { width: 22px; height: 22px; color: var(--ok); }
.done-box[open] > summary { margin-bottom: 10px; }
.tbl .c-reopen { width: 1%; white-space: nowrap; text-align: right; }

/* ───── Legal pages (privacy / terms) ───── */
.legal { max-width: 760px; margin: 0 auto; padding: 22px 18px 48px; }
.legal .brand { display: inline-flex; margin-bottom: 14px; text-decoration: none; color: inherit; }
.legal h1 { font-size: 26px; line-height: 1.45; }
.legal .lead { margin: 6px 0 18px; font-size: 14px; color: var(--muted); }
.legal .panel h2 { font-size: 17px; margin-bottom: 8px; }
.legal .panel p, .legal .panel li { font-size: 15px; line-height: 1.75; }
.legal .panel ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.legal .panel .note { margin-top: 10px; }
.legal a { color: #8f3f7d; }
.legal-links { margin: 18px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.legal-links a { color: #8f3f7d; }
@media (min-width: 861px) { .legal { padding-top: 36px; } .legal h1 { font-size: 30px; } }

/* ───── ดีไซน์ v2 ชุด 2 (10 ต.ค. 2569) ───── */
.device-list { display: grid; gap: 8px; margin: 10px 0 4px; }
.device-list .label { margin: 0; }
.device-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: #fbf7fd; border: 1px solid var(--line); }
.device-row .grow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.device-row small { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.device-row small.warn { color: var(--danger); }

/* เปิดอยู่ในเบราว์เซอร์ในแอปแชท (ดีไซน์ v2 ชุด 2) */
.inapp-note { display: grid; gap: 6px; margin: 0 0 14px; padding: 12px 14px; border-radius: 16px; border: 1px solid #f3dca4; background: #fff7e3; color: #5b3d00; font-size: 14px; text-align: left; }
.inapp-note strong { font-size: 15px; }
.inapp-note p { margin: 0; }
.inapp-open { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border-radius: 13px; background: #a84077; color: #fff; font-weight: 700; text-decoration: none; }
.inapp-open:focus-visible { outline: 3px solid #9e3c73; outline-offset: 2px; }
.delete-steps { display: grid; gap: 10px; margin: 10px 0 14px; padding-left: 20px; font-size: 14px; }
.delete-steps li { line-height: 1.6; }
.delete-steps .btn { margin: 6px 0 0; }
.delete-steps small { display: block; margin-top: 4px; }
#delete-form { display: grid; gap: 8px; }
.draft-form { display: grid; gap: 14px; }
.df-item { display: grid; gap: 10px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fdfbfe; min-width: 0; }
.df-item legend { padding: 0 6px; font-weight: 700; color: #443349; }
.df-field { display: grid; gap: 4px; min-width: 0; }
.df-field .label { margin: 0; }
.df-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.df-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; }
.df-check input { width: 22px; height: 22px; flex: none; }

/* เวลาเงียบ (ดีไซน์ v2 ชุด 3) */
.quiet-select { width: auto; max-width: 100%; }
.quiet-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.quiet-range .label { margin: 0; }

/* ปฏิทินสัปดาห์ + ส่งออก .ics (ดีไซน์ v2 ชุด 3ข) */
.week-days { display: grid; gap: 14px; }
.week-day { display: grid; gap: 8px; padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.week-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.week-head .day-label { margin: 0; }
.day-label.is-today { color: var(--primary-ink); font-weight: 700; }
.week-empty { margin: 0; }
.cal-export { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 22px 0 0; padding: 12px 14px; border-radius: 16px; background: #fbf7fd; border: 1px solid var(--line); font-size: 14px; }
.cal-export .icon { width: 24px; height: 24px; }
.cal-export span { flex: 1 1 200px; }
.qty { margin-left: 6px; font-weight: 600; color: var(--muted); font-size: 0.9em; white-space: nowrap; }
/* ตารางแยกหมวด ระยะ 2–3: ติ๊กหลายรายการ · ประวัติการคืน */
#bulk { margin-left: auto; }
.bulk-head { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.bulk-list { display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; padding: 2px; }
.bulk-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 10px; padding: 10px 12px; border-radius: 14px; background: #fbf7fd; border: 1px solid var(--line); cursor: pointer; min-width: 0; }
.bulk-row input { width: 20px; height: 20px; accent-color: #b45f92; }
.bulk-row span { overflow-wrap: anywhere; }
.bulk-row small { grid-column: 2; color: var(--muted); }
.bulk-row:focus-within { outline: 2px solid #b45f92; outline-offset: 2px; }
.pay-history { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.pay-history li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 12px; background: #fbf7fd; border: 1px solid var(--line); }
