/* =====================================================================
   Smart School Design System
   สีหลักจากแบนเนอร์และโลโก้: coral / blush / navy + สี IEP (ส้ม-เขียว-ม่วง)
   ===================================================================== */
:root {
  --coral-50:#fff4f1; --coral-100:#fde6e1; --coral-200:#fbcfc6; --coral-300:#f6a99b;
  --coral-400:#f08a78; --coral-500:#e9705e; --coral-600:#d4553f; --coral-700:#b04230;
  --navy-500:#2a5d93; --navy-600:#1f4c7d; --navy-700:#173a61; --navy-900:#0e2440;
  --iep-orange:#f08a2c; --iep-green:#5fa83a; --iep-purple:#8a4fb3; --iep-pink:#d9577e; --iep-teal:#3fa9b8;

  --bg:#fffaf8; --bg-soft:#fdeeea; --surface:#ffffff; --surface-2:#fff6f3;
  --text:#2b2230; --text-2:#5f5463; --text-3:#8f8492;
  --line:#f0e1dc; --line-strong:#e3cdc6;
  --primary:var(--coral-500); --primary-ink:#fff; --primary-soft:var(--coral-100);
  --accent:var(--navy-600);
  --ok:#2f9e6a; --ok-soft:#e3f5ec; --warn:#d48a0a; --warn-soft:#fdf2dc; --bad:#d64545; --bad-soft:#fde7e7; --info:#2f7dc4; --info-soft:#e4f0fb;

  --font-display:"Mali", "Anuphan", system-ui, sans-serif;
  --font-body:"Anuphan", "Sarabun", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-sm:10px; --radius:16px; --radius-lg:24px; --radius-xl:32px;
  --shadow-sm:0 1px 2px rgba(120,60,50,.06), 0 1px 3px rgba(120,60,50,.06);
  --shadow:0 4px 14px rgba(150,70,55,.08), 0 2px 4px rgba(150,70,55,.05);
  --shadow-lg:0 18px 40px rgba(150,70,55,.14);
  --header-h:72px; --sidebar-w:264px; --container:1200px;
  --ease:cubic-bezier(.2,.8,.2,1);
  color-scheme:light;
}
:root[data-theme="dark"] {
  --bg:#17131a; --bg-soft:#211b24; --surface:#1f1a22; --surface-2:#271f2a;
  --text:#f4ecef; --text-2:#c9bcc4; --text-3:#9a8d96; --line:#33293a; --line-strong:#44374b;
  --primary:#f0846f; --primary-soft:#3a2427; --accent:#8fb6e8;
  --ok-soft:#173226; --warn-soft:#352914; --bad-soft:#3a1c1e; --info-soft:#172b40;
  --shadow-sm:0 1px 2px rgba(0,0,0,.3); --shadow:0 4px 14px rgba(0,0,0,.35); --shadow-lg:0 18px 40px rgba(0,0,0,.45);
  color-scheme:dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#17131a; --bg-soft:#211b24; --surface:#1f1a22; --surface-2:#271f2a;
    --text:#f4ecef; --text-2:#c9bcc4; --text-3:#9a8d96; --line:#33293a; --line-strong:#44374b;
    --primary:#f0846f; --primary-soft:#3a2427; --accent:#8fb6e8;
    --ok-soft:#173226; --warn-soft:#352914; --bad-soft:#3a1c1e; --info-soft:#172b40;
    --shadow-sm:0 1px 2px rgba(0,0,0,.3); --shadow:0 4px 14px rgba(0,0,0,.35); --shadow-lg:0 18px 40px rgba(0,0,0,.45);
    color-scheme:dark;
  }
}

/* ---------- Base ---------- */
*,*::before,*::after { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
body { margin:0; font-family:var(--font-body); font-size:16px; line-height:1.65; color:var(--text); background:var(--bg); -webkit-font-smoothing:antialiased; }
img,svg { display:block; max-width:100%; }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; text-underline-offset:3px; }
h1,h2,h3,h4 { font-family:var(--font-display); line-height:1.25; margin:0 0 .5em; color:var(--text); font-weight:600; letter-spacing:-.005em; }
h1 { font-size:clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); }
h2 { font-size:clamp(1.4rem, 1.1rem + 1.3vw, 2rem); }
h3 { font-size:1.15rem; }
p { margin:0 0 1em; }
:focus-visible { outline:3px solid var(--coral-300); outline-offset:2px; border-radius:6px; }
.icon { width:1.25em; height:1.25em; flex:none; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.skip-link { position:absolute; left:-999px; top:8px; z-index:100; background:var(--primary); color:#fff; padding:8px 16px; border-radius:8px; }
.skip-link:focus { left:8px; }
.container { width:100%; max-width:var(--container); margin:0 auto; padding:0 16px; }
@media (min-width:768px){ .container { padding:0 24px; } }
.muted { color:var(--text-2); } .small { font-size:.875rem; } .tiny { font-size:.78rem; }
.stack > * + * { margin-top:var(--gap, 16px); }
.row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.spacer { flex:1; }
.grid { display:grid; gap:20px; }
@media (min-width:640px){ .grid-2 { grid-template-columns:repeat(2,1fr); } }
@media (min-width:900px){ .grid-3 { grid-template-columns:repeat(3,1fr); } .grid-4 { grid-template-columns:repeat(4,1fr); } }
@media (min-width:640px) and (max-width:899px){ .grid-3,.grid-4 { grid-template-columns:repeat(2,1fr); } }

/* ---------- Buttons ---------- */
.btn { --b:var(--primary); display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:10px 20px; border-radius:999px; border:1.5px solid transparent; font:600 .95rem/1 var(--font-body); cursor:pointer; transition:transform .15s var(--ease), box-shadow .2s, background .2s; white-space:nowrap; text-decoration:none !important; }
.btn:active { transform:translateY(1px) scale(.99); }
.btn-primary { background:var(--b); color:#fff; box-shadow:0 6px 16px -6px color-mix(in srgb, var(--b) 70%, transparent); }
.btn-primary:hover { background:var(--coral-600); }
.btn-danger { background:var(--bad); color:#fff; box-shadow:0 6px 16px -6px color-mix(in srgb, var(--bad) 70%, transparent); }
.btn-danger:hover { background:color-mix(in srgb, var(--bad) 85%, #000); }
/* กล่องยืนยัน / กล่องข้อความ (dialog) */
.cfm { border:0; padding:0; background:transparent; max-width:min(420px, calc(100vw - 32px)); width:100%; overflow:visible; }
.cfm::backdrop { background:rgba(30,18,24,.45); backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px); }
.cfm[open] { animation:cfm-in .18s ease-out; }
@keyframes cfm-in { from { opacity:0; transform:translateY(10px) scale(.97); } to { opacity:1; transform:none; } }
.cfm-box { background:var(--surface); color:var(--text); border-radius:22px; box-shadow:var(--shadow-lg); padding:26px 22px 18px; text-align:center; display:grid; gap:14px; border:1px solid var(--line); }
.cfm-icon { width:58px; height:58px; margin:0 auto; border-radius:50%; display:grid; place-items:center; font-size:1.6rem; background:var(--primary-soft); }
.cfm.is-bad .cfm-icon { background:var(--bad-soft); }
.cfm.is-ok .cfm-icon { background:var(--ok-soft); }
.cfm-title { font-size:1.08rem; font-weight:700; margin:0; }
.cfm-msg { font-size:1rem; line-height:1.55; color:var(--text); white-space:pre-line; overflow-wrap:anywhere; }
.cfm-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:4px; }
.cfm-actions .btn { justify-content:center; min-height:46px; font-size:1rem; }
.cfm-actions.one { grid-template-columns:1fr; }
.cfm-cred { display:grid; gap:8px; text-align:left; background:var(--surface-2); border:1px solid var(--line); border-radius:14px; padding:12px 14px; }
.cfm-cred div { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.cfm-cred code { font-size:1.2rem; font-weight:700; letter-spacing:.04em; user-select:all; }
.btn-navy { background:var(--navy-600); color:#fff; } .btn-navy:hover { background:var(--navy-700); }
.btn-outline { background:var(--surface); color:var(--text); border-color:var(--line-strong); }
.btn-outline:hover { border-color:var(--primary); color:var(--primary); }
.btn-ghost { background:transparent; color:var(--text-2); }
.btn-ghost:hover { background:var(--primary-soft); color:var(--primary); }
.btn-sm { min-height:36px; padding:6px 14px; font-size:.875rem; }
.btn-lg { min-height:52px; padding:14px 28px; font-size:1.05rem; }
.btn-block { width:100%; }
.btn-icon { width:44px; padding:0; }

/* ---------- Cards / badges ---------- */
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-sm); padding:20px; }
.card-lg { padding:28px; border-radius:var(--radius-lg); }
.card-head { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.card-head h2,.card-head h3 { margin:0; font-size:1.1rem; }
.card-link { display:block; color:inherit; transition:transform .2s var(--ease), box-shadow .2s; }
.card-link:hover { transform:translateY(-3px); box-shadow:var(--shadow); text-decoration:none; }
.badge { display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:999px; font-size:.78rem; font-weight:600; background:var(--primary-soft); color:var(--coral-700); white-space:nowrap; }
:root[data-theme="dark"] .badge { color:var(--coral-300); }
.badge-ok { background:var(--ok-soft); color:var(--ok); } .badge-warn { background:var(--warn-soft); color:var(--warn); }
.badge-bad { background:var(--bad-soft); color:var(--bad); } .badge-info { background:var(--info-soft); color:var(--info); }
.badge-muted { background:var(--bg-soft); color:var(--text-2); }
.chip-icon { width:44px; height:44px; border-radius:14px; display:grid; place-items:center; flex:none; background:var(--primary-soft); color:var(--primary); }
.chip-icon .icon { width:22px; height:22px; }
.c-orange { background:#fdeddc; color:#c76a12; } .c-green { background:#e6f3dd; color:#3f7f22; }
.c-purple { background:#efe3f7; color:#7440a0; } .c-teal { background:#ddf1f4; color:#21828f; } .c-navy { background:#e1ebf6; color:var(--navy-600); }
:root[data-theme="dark"] .c-orange,:root[data-theme="dark"] .c-green,:root[data-theme="dark"] .c-purple,:root[data-theme="dark"] .c-teal,:root[data-theme="dark"] .c-navy { background:var(--surface-2); }

.alert { display:flex; gap:10px; padding:12px 16px; border-radius:var(--radius-sm); background:var(--info-soft); color:var(--text); border:1px solid transparent; }
.alert-success { background:var(--ok-soft); } .alert-warning { background:var(--warn-soft); } .alert-error { background:var(--bad-soft); }
.demo-ribbon { background:repeating-linear-gradient(-45deg, var(--warn-soft) 0 12px, transparent 12px 24px); border:1px dashed var(--warn); color:var(--text-2); font-size:.8rem; padding:4px 12px; border-radius:999px; display:inline-flex; gap:6px; align-items:center; }

/* ---------- Forms ---------- */
.field { display:block; margin-bottom:16px; }
.field > span { display:block; font-weight:600; font-size:.9rem; margin-bottom:6px; color:var(--text-2); }
.input, select.input, textarea.input { width:100%; min-height:48px; padding:12px 16px; border:1.5px solid var(--line-strong); border-radius:var(--radius-sm); background:var(--surface); color:var(--text); font:inherit; transition:border-color .2s, box-shadow .2s; }
.input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 4px var(--primary-soft); }
.input-icon { position:relative; } .input-icon .icon { position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--text-3); }
.input-icon .input { padding-left:44px; }
.check { display:flex; align-items:center; gap:8px; font-size:.9rem; color:var(--text-2); cursor:pointer; }
.check input { width:18px; height:18px; accent-color:var(--primary); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); -webkit-overflow-scrolling:touch; }
.table { width:100%; border-collapse:collapse; font-size:.92rem; }
.table th, .table td { padding:12px 14px; text-align:left; border-bottom:1px solid var(--line); vertical-align:middle; }
.table thead th { background:var(--surface-2); font-weight:600; color:var(--text-2); font-size:.82rem; white-space:nowrap; position:sticky; top:0; z-index:1; }
.table tbody tr:hover { background:var(--surface-2); }
.table tbody tr:last-child td { border-bottom:0; }
.table .num { text-align:center; font-variant-numeric:tabular-nums; }
.grade-pill { display:inline-grid; place-items:center; min-width:40px; height:30px; padding:0 8px; border-radius:10px; font-weight:700; font-variant-numeric:tabular-nums; background:var(--ok-soft); color:var(--ok); }
.grade-pill[data-g="3"],.grade-pill[data-g="3.5"] { background:var(--info-soft); color:var(--info); }
.grade-pill[data-g="2"],.grade-pill[data-g="2.5"] { background:var(--warn-soft); color:var(--warn); }
.grade-pill[data-g="1"],.grade-pill[data-g="1.5"],.grade-pill[data-g="0"] { background:var(--bad-soft); color:var(--bad); }
/* ตารางบนมือถือ: เปลี่ยนเป็นการ์ด */
@media (max-width:640px){
  .table-stack thead { display:none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display:block; width:100%; }
  .table-stack tr { padding:12px 14px; border-bottom:1px solid var(--line); }
  .table-stack td { border:0; padding:3px 0; display:flex; justify-content:space-between; gap:12px; text-align:right; }
  .table-stack td::before { content:attr(data-label); color:var(--text-3); font-size:.82rem; text-align:left; }
  .table-stack td.num { text-align:right; }
}

/* =====================================================================
   PUBLIC LAYOUT
   ===================================================================== */
.site-header { position:sticky; top:0; z-index:50; background:color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter:saturate(1.4) blur(14px); -webkit-backdrop-filter:saturate(1.4) blur(14px); border-bottom:1px solid var(--line); }
.site-header .container { display:flex; align-items:center; gap:16px; height:var(--header-h); }
.brand { display:flex; align-items:center; gap:10px; color:var(--text); text-decoration:none !important; min-width:0; }
.brand img { width:46px; height:46px; object-fit:contain; }
.brand b { display:block; font-family:var(--font-display); font-size:1.15rem; line-height:1.1; color:var(--coral-600); }
.brand small { display:block; font-size:.74rem; color:var(--text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.main-nav { display:none; gap:4px; margin-left:auto; }
.main-nav a { padding:8px 14px; border-radius:999px; color:var(--text-2); font-weight:500; text-decoration:none; }
.main-nav a:hover, .main-nav a.is-active { color:var(--primary); background:var(--primary-soft); }
.header-actions { display:flex; align-items:center; gap:6px; margin-left:auto; }
.lang-switch { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px; border:1.5px solid var(--line-strong); color:var(--text-2); font-weight:600; font-size:.85rem; text-decoration:none !important; min-height:38px; }
.lang-switch:hover { border-color:var(--primary); color:var(--primary); }
.nav-toggle { display:inline-grid; }
@media (min-width:1000px){ .main-nav { display:flex; } .header-actions { margin-left:12px; } .nav-toggle { display:none; } }
@media (max-width:420px){ .brand small { display:none; } .header-actions .btn-login span { display:none; } .header-actions .btn-login { width:44px; padding:0; } }

.mobile-drawer { position:fixed; inset:0; z-index:80; visibility:hidden; }
.mobile-drawer.open { visibility:visible; }
.mobile-drawer .scrim { position:absolute; inset:0; background:rgba(30,15,20,.4); opacity:0; transition:opacity .25s; }
.mobile-drawer.open .scrim { opacity:1; }
.mobile-drawer .panel { position:absolute; right:0; top:0; bottom:0; width:min(320px, 86vw); background:var(--surface); padding:20px; transform:translateX(100%); transition:transform .3s var(--ease); display:flex; flex-direction:column; gap:4px; overflow-y:auto; }
.mobile-drawer.open .panel { transform:none; }
.mobile-drawer .panel a.nav-item { display:flex; gap:12px; align-items:center; padding:12px 14px; border-radius:12px; color:var(--text); font-weight:500; text-decoration:none; }
.mobile-drawer .panel a.nav-item:hover, .mobile-drawer .panel a.nav-item.is-active { background:var(--primary-soft); color:var(--primary); }

/* Hero */
.hero { position:relative; overflow:hidden; background:linear-gradient(180deg, var(--hero-tint, #fde3dd) 0%, var(--bg) 100%); }
:root[data-theme="dark"] .hero { background:linear-gradient(180deg, var(--hero-tint, #2a1d22) 0%, var(--bg) 100%); }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .hero { background:linear-gradient(180deg, #2a1d22 0%, var(--bg) 100%); } :root:not([data-theme="light"]) .auth-wrap { background:var(--bg); } :root:not([data-theme="light"]) .badge { color:var(--coral-300); } }
.hero-banner { position:relative; width:100%; max-width:1920px; margin:0 auto; aspect-ratio:1920/480; background:url("../img/banner.webp") center/cover no-repeat; }
.hero-banner h1 { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
@media (max-width:640px){ .hero-banner { aspect-ratio:16/7; background-size:cover; background-position:50% 50%; } }
.hero-body { padding:28px 0 8px; text-align:center; }
.hero-body p.lead { font-size:clamp(1rem, .9rem + .5vw, 1.2rem); color:var(--text-2); max-width:640px; margin:0 auto 22px; }
.hero-cta { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }

.section { padding:56px 0; }
.section-sm { padding:32px 0; }
.section-head { display:flex; align-items:end; gap:16px; margin-bottom:24px; flex-wrap:wrap; }
.section-head h2 { margin:0; }
.section-head .kicker { display:block; font-family:var(--font-display); color:var(--primary); font-size:.95rem; margin-bottom:2px; }
.section-alt { background:var(--bg-soft); }

.service-card { padding:24px; height:100%; }
.service-card h3 { margin:14px 0 6px; }
.service-card p { color:var(--text-2); font-size:.93rem; margin:0; }
.service-card .go { margin-top:14px; display:inline-flex; align-items:center; gap:6px; color:var(--primary); font-weight:600; font-size:.9rem; }

.stat-band { display:grid; grid-template-columns:repeat(2,1fr); gap:16px; }
@media (min-width:800px){ .stat-band { grid-template-columns:repeat(4,1fr); } }
.stat-band .stat { text-align:center; padding:22px 12px; border-radius:var(--radius-lg); background:var(--surface); border:1px solid var(--line); }
.stat-band .stat b { display:block; font-family:var(--font-display); font-size:clamp(1.8rem, 1.4rem + 1.5vw, 2.6rem); line-height:1.1; color:var(--coral-600); }
.stat-band .stat:nth-child(2) b { color:var(--iep-green); } .stat-band .stat:nth-child(3) b { color:var(--iep-purple); } .stat-band .stat:nth-child(4) b { color:var(--navy-500); }

.news-card { overflow:hidden; padding:0; height:100%; display:flex; flex-direction:column; }
.news-card .thumb { aspect-ratio:16/10; background:linear-gradient(135deg, var(--coral-100), #e9eef9); display:grid; place-items:center; color:var(--coral-300); }
.news-card .thumb .icon { width:48px; height:48px; }
.news-card .body { padding:18px 20px 20px; display:flex; flex-direction:column; gap:6px; flex:1; }
.news-card h3 { margin:0; font-size:1.05rem; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.skeleton { background:linear-gradient(90deg, var(--bg-soft) 0%, var(--surface-2) 50%, var(--bg-soft) 100%); background-size:200% 100%; animation:shimmer 1.6s infinite; border-radius:8px; height:12px; }
@keyframes shimmer { to { background-position:-200% 0; } }

.why-item { display:flex; gap:16px; align-items:flex-start; }
.why-item h3 { margin:0 0 4px; }

.site-footer { background:var(--navy-900); color:#d7dfea; padding:48px 0 calc(24px + env(safe-area-inset-bottom)); margin-top:40px; }
.site-footer a { color:#fff; }
.site-footer h4 { color:#fff; font-size:1rem; margin-bottom:12px; }
.site-footer .grid { gap:32px; }
@media (min-width:800px){ .site-footer .grid { grid-template-columns:2fr 1fr 1fr; } }
.site-footer .brand b { color:#ffb3a5; } .site-footer .brand small { color:#b8c4d6; }
.site-footer ul { list-style:none; padding:0; margin:0; display:grid; gap:8px; }
.site-footer .copy { border-top:1px solid rgba(255,255,255,.12); margin-top:32px; padding-top:18px; font-size:.84rem; color:#9fb0c7; display:flex; gap:12px; flex-wrap:wrap; }

/* PWA install toast */
.install-toast { position:fixed; left:16px; right:16px; bottom:calc(16px + env(safe-area-inset-bottom)); z-index:70; max-width:420px; margin:0 auto; display:none; gap:12px; align-items:center; padding:14px 16px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-lg); }
.install-toast.show { display:flex; animation:pop .35s var(--ease); }
.install-toast img { width:44px; height:44px; border-radius:12px; }
@keyframes pop { from { transform:translateY(20px); opacity:0; } }
.app-shell ~ .install-toast { bottom:calc(84px + env(safe-area-inset-bottom)); }

/* =====================================================================
   AUTH
   ===================================================================== */
.auth-wrap { min-height:calc(100vh - var(--header-h)); display:grid; place-items:center; padding:32px 16px 48px; background:radial-gradient(1200px 500px at 10% -10%, #fde0d9 0%, transparent 60%), radial-gradient(800px 400px at 110% 110%, #e5edf9 0%, transparent 60%), var(--bg); }
:root[data-theme="dark"] .auth-wrap { background:var(--bg); }
.auth-card { width:100%; max-width:440px; }
.auth-card .logo { width:84px; height:84px; margin:0 auto 12px; object-fit:contain; }
.tabs { display:grid; grid-template-columns:1fr 1fr; padding:4px; background:var(--bg-soft); border-radius:999px; margin-bottom:22px; }
.tabs button { min-height:42px; border:0; border-radius:999px; background:transparent; font:600 .9rem var(--font-body); color:var(--text-2); cursor:pointer; display:flex; gap:6px; align-items:center; justify-content:center; }
.tabs button[aria-selected="true"] { background:var(--surface); color:var(--primary); box-shadow:var(--shadow-sm); }
.secure-note { display:flex; gap:8px; align-items:center; justify-content:center; color:var(--text-3); font-size:.78rem; margin-top:18px; text-align:center; }
.demo-box { margin-top:18px; padding:14px; border:1px dashed var(--line-strong); border-radius:var(--radius-sm); }
.demo-box .row { gap:6px; }

/* =====================================================================
   APP SHELL (ระบบหลังบ้าน / ผู้ปกครอง)
   ===================================================================== */
.app-shell { min-height:100vh; display:grid; grid-template-columns:1fr; }
@media (min-width:1024px){ .app-shell { grid-template-columns:var(--sidebar-w) 1fr; } }
.sidebar { display:none; position:sticky; top:0; height:100vh; overflow-y:auto; background:var(--surface); border-right:1px solid var(--line); padding:18px 14px; flex-direction:column; gap:4px; }
@media (min-width:1024px){ .sidebar { display:flex; } }
.sidebar .brand { padding:4px 8px 16px; }
.side-group { font-size:.74rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-3); padding:14px 12px 6px; }
.side-link { display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:12px; color:var(--text-2); font-weight:500; font-size:.94rem; text-decoration:none !important; }
.side-link:hover { background:var(--surface-2); color:var(--text); }
.side-link.is-active { background:var(--primary-soft); color:var(--primary); font-weight:600; }
.side-link .badge { margin-left:auto; }
.side-foot { margin-top:auto; padding-top:16px; }
.term-box { padding:12px; border-radius:12px; background:var(--bg-soft); font-size:.84rem; }

.app-main { min-width:0; display:flex; flex-direction:column; }
.topbar { position:sticky; top:0; z-index:40; display:flex; align-items:center; gap:10px; height:64px; padding:0 16px; background:color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); border-bottom:1px solid var(--line); }
@media (min-width:768px){ .topbar { padding:0 28px; } }
.topbar .brand-mini { white-space:nowrap; display:flex; align-items:center; gap:8px; font-family:var(--font-display); color:var(--coral-600); font-weight:600; }
.topbar .brand-mini img { width:34px; height:34px; object-fit:contain; }
@media (min-width:1024px){ .topbar .brand-mini { display:none; } }
.topbar .page-title { font-family:var(--font-display); font-size:1.1rem; font-weight:600; margin:0; display:none; }
@media (min-width:1024px){ .topbar .page-title { display:block; } }
.avatar { width:38px; height:38px; border-radius:50%; display:grid; place-items:center; background:linear-gradient(135deg, var(--coral-400), var(--iep-purple)); color:#fff; font-weight:700; font-size:.9rem; flex:none; }
.avatar-lg { width:56px; height:56px; font-size:1.2rem; }
.user-chip { display:flex; align-items:center; gap:10px; padding:4px 4px 4px 4px; border-radius:999px; }
.user-chip .meta { display:none; line-height:1.2; }
.user-chip .meta b { display:block; font-size:.88rem; } .user-chip .meta small { color:var(--text-3); font-size:.75rem; }
@media (min-width:768px){ .user-chip .meta { display:block; } }

.content { padding:20px 16px calc(96px + env(safe-area-inset-bottom)); width:100%; max-width:1280px; }
@media (min-width:768px){ .content { padding:28px 28px 48px; } }
.page-head { display:flex; align-items:flex-start; gap:12px; flex-wrap:wrap; margin-bottom:22px; }
.page-head h1 { font-size:clamp(1.4rem, 1.1rem + 1vw, 1.85rem); margin:0; }
.page-head p { margin:4px 0 0; color:var(--text-2); }
.page-head .actions { margin-left:auto; display:flex; gap:8px; flex-wrap:wrap; }
.breadcrumb { display:flex; gap:6px; align-items:center; font-size:.82rem; color:var(--text-3); margin-bottom:6px; flex-wrap:wrap; }
.breadcrumb a { color:var(--text-3); }

/* Bottom tab bar (มือถือ) — ให้ความรู้สึกเหมือนแอป */
.tabbar { position:fixed; left:0; right:0; bottom:0; z-index:60; display:grid; grid-auto-flow:column; grid-auto-columns:1fr; background:color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); border-top:1px solid var(--line); padding:6px 6px calc(6px + env(safe-area-inset-bottom)); }
/* แถบเมนูล่าง: ซ่อนเฉพาะคอมพิวเตอร์ที่ใช้เมาส์ · มือถือ/แท็บเล็ตจอกว้าง (จอสัมผัส) ยังแสดง โดยเริ่มถัดจากเมนูข้าง */
@media (min-width:1024px) and (hover:hover) and (pointer:fine){ .tabbar { display:none; } }
@media (min-width:1024px){ .tabbar { left:var(--sidebar-w); } }
.tabbar a { display:flex; flex-direction:column; align-items:center; gap:2px; padding:6px 2px; border-radius:12px; color:var(--text-3); font-size:.7rem; font-weight:600; text-decoration:none !important; }
.tabbar a .icon { width:24px; height:24px; }
.tabbar a.is-active { color:var(--primary); }
.tabbar a.is-active .icon { filter:drop-shadow(0 4px 8px color-mix(in srgb, var(--primary) 40%, transparent)); }

/* Stat tiles */
.kpis { display:grid; gap:12px; grid-template-columns:repeat(2,1fr); }
@media (min-width:900px){ .kpis { grid-template-columns:repeat(4,1fr); gap:20px; } }
@media (max-width:480px){ .kpis .kpi { flex-direction:column; align-items:flex-start; gap:8px; padding:14px; } .kpis .kpi .val { font-size:1.4rem; } }
.kpi { display:flex; gap:14px; align-items:center; }
.kpi .val { font-family:var(--font-display); font-size:1.7rem; font-weight:600; line-height:1.1; font-variant-numeric:tabular-nums; }
.kpi .lbl { color:var(--text-2); font-size:.85rem; }
.progress { height:8px; border-radius:999px; background:var(--bg-soft); overflow:hidden; }
.progress > i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg, var(--coral-400), var(--coral-600)); }
.progress.ok > i { background:var(--ok); } .progress.warn > i { background:var(--warn); } .progress.bad > i { background:var(--bad); }
/* ติดตามการบันทึกการสอน */
.lp-bar { display:flex; align-items:center; gap:8px; min-width:140px; } .lp-bar .progress { flex:1; } .lp-bar b { min-width:44px; text-align:right; font-variant-numeric:tabular-nums; }
.lp-room { display:flex; align-items:center; gap:12px; flex-wrap:wrap; } .lp-room .lp-bar { flex:1; min-width:160px; max-width:320px; }
.lp-miss td { white-space:nowrap; } .lp-stale { color:var(--bad); font-weight:700; }
.lp-c-ok { color:var(--ok); } .lp-c-warn { color:var(--warn); } .lp-c-bad { color:var(--bad); }
.lp-tabs { display:flex; gap:6px; margin-bottom:8px; align-items:center; flex-wrap:wrap; } .lp-sum { font-variant-numeric:tabular-nums; white-space:nowrap; }
.lp-list { display:grid; gap:8px; } .lp-group { padding:0; overflow:hidden; } .lp-group > .table-wrap { border-top:1px solid var(--line); }
.lp-head { display:grid; grid-template-columns:minmax(max-content,1.4fr) minmax(120px,1fr) 90px minmax(160px,1.2fr); gap:12px; align-items:center; padding:12px 16px; cursor:pointer; list-style:none; }
.lp-head::-webkit-details-marker { display:none; } .lp-head:hover { background:var(--surface-2); }
.lp-name { display:flex; align-items:center; gap:8px; min-width:0; white-space:nowrap; } .lp-name b { white-space:nowrap; }   /* ชื่อบรรทัดเดียว ไม่ตัด */ .lp-no { min-width:1.6em; text-align:right; font-variant-numeric:tabular-nums; }
.lp-caret { width:16px; height:16px; flex:none; color:var(--text-3); transition:transform .15s; } .lp-group[open] .lp-caret { transform:rotate(90deg); }
.lp-meta { font-size:.82rem; color:var(--text-3); white-space:nowrap; font-variant-numeric:tabular-nums; } .lp-miss-n { font-size:.82rem; font-weight:600; white-space:nowrap; text-align:right; }
.lp-head .lp-bar { min-width:0; } .lp-tn { white-space:nowrap; } .lp-table td.lp-sum { white-space:nowrap; } .lp-table th, .lp-table td { padding:7px 12px; } .lp-bar-col { width:200px; }
@media screen and (max-width:720px) { .lp-head { grid-template-columns:1fr auto; gap:4px 10px; } .lp-head .lp-bar { grid-column:1 / -1; } .lp-meta { grid-column:1; } }
@media print {
  .lp-group, .lp-kpis .card { box-shadow:none !important; border:1px solid #bbb !important; } .lp-kpis .card, .lp-group:not([open]) { break-inside:avoid; }
  .lp-head { break-after:avoid; } .lp-table tr { break-inside:avoid; } .lp-table thead { display:table-header-group; }
  .lp-list { gap:3mm; } .lp-head { padding:2mm 3mm; grid-template-columns:max-content 38mm 20mm 1fr; gap:4mm; font-size:10.5pt; } .lp-caret { display:none; }
  .lp-table { font-size:9.5pt; } .lp-table th, .lp-table td { padding:1.2mm 2mm; } .lp-bar-col { width:45mm; }
  .lp-bar .progress, .lp-bar .progress > i, .lp-c-ok, .lp-c-warn, .lp-c-bad { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .lp-kpis { grid-template-columns:repeat(4,1fr) !important; gap:3mm !important; } .lp-kpis .card { padding:2mm 3mm; } .lp-kpis .chip-icon { display:none; }
}
.list { list-style:none; margin:0; padding:0; }
.list li { display:flex; gap:12px; align-items:center; padding:12px 0; border-bottom:1px solid var(--line); }
.list li:last-child { border-bottom:0; }
.empty-state { text-align:center; padding:40px 16px; color:var(--text-3); }
.empty-state .icon { width:44px; height:44px; margin:0 auto 10px; color:var(--coral-300); }

/* Child card (ผู้ปกครอง) */
.child-card { position:relative; overflow:hidden; }
.child-card::after { content:""; position:absolute; right:-40px; top:-40px; width:160px; height:160px; border-radius:50%; background:radial-gradient(circle, var(--coral-100), transparent 70%); opacity:.8; pointer-events:none; }
.child-card .head { display:flex; gap:14px; align-items:center; }
.child-card .mini-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:18px 0; }
.child-card .mini-stats div { background:var(--surface-2); border-radius:12px; padding:10px; text-align:center; }
.child-card .mini-stats b { display:block; font-family:var(--font-display); font-size:1.35rem; color:var(--text); }
.child-card .mini-stats small { color:var(--text-3); font-size:.75rem; }

.seg { display:inline-flex; padding:4px; background:var(--bg-soft); border-radius:999px; gap:2px; }
.seg a, .seg button { padding:6px 14px; border-radius:999px; color:var(--text-2); font-weight:600; font-size:.85rem; border:0; background:none; cursor:pointer; text-decoration:none !important; }
.seg .is-active { background:var(--surface); color:var(--primary); box-shadow:var(--shadow-sm); }
.seg.seg-sm { padding:2px; } .seg.seg-sm a { padding:4px 9px; font-size:.78rem; display:inline-flex; align-items:center; gap:4px; } .seg.seg-sm a:hover { background:var(--surface); color:var(--primary); }

/* Score entry grid */
.score-grid input { width:64px; min-height:38px; padding:6px; text-align:center; border:1.5px solid var(--line-strong); border-radius:8px; background:var(--surface); color:var(--text); font:600 .95rem var(--font-body); font-variant-numeric:tabular-nums; }
.score-grid input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.score-grid input.invalid { border-color:var(--bad); background:var(--bad-soft); }
.score-grid th small { display:block; font-weight:500; color:var(--text-3); }
.score-grid td.sticky, .score-grid th.sticky { position:sticky; left:0; background:var(--surface); z-index:2; }
.score-grid thead th.sticky { z-index:3; background:var(--surface-2); }
.save-state { display:inline-flex; align-items:center; gap:6px; font-size:.82rem; color:var(--ok); }

/* =====================================================================
   PP.6 PRINT — 1 แผ่น A4 (210×297mm)
   ===================================================================== */
.print-toolbar { position:sticky; top:0; z-index:10; display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding:12px 16px; background:var(--surface); border-bottom:1px solid var(--line); }
.print-stage { padding:24px 12px 60px; background:#e9e4e6; min-height:100vh; overflow-x:auto; }
.a4 { --fs:9.5pt; width:210mm; height:297mm; overflow:hidden; margin:0 auto 24px; background:#fff; color:#111; padding:9mm 11mm 8mm;
      box-shadow:0 10px 30px rgba(0,0,0,.15); font-family:"Sarabun", "Anuphan", sans-serif; font-size:var(--fs); line-height:1.3;
      display:flex; flex-direction:column; gap:2.2mm; }
.a4 .en { color:#555; font-size:.82em; font-weight:400; }
.pp6-head { display:grid; grid-template-columns:17mm 1fr 17mm; align-items:center; gap:4mm; border-bottom:1.5px solid #333; padding-bottom:2mm; text-align:center; }
.pp6-head img { width:17mm; height:17mm; }
.pp6-head .t1 { font-size:1.4em; font-weight:700; line-height:1.2; }
.pp6-head .t2 { font-size:.95em; }
.pp6-head .code { border:1.5px solid #333; padding:1.5mm 0; font-weight:700; font-size:1.2em; }
.pp6-info { display:grid; grid-template-columns:2.4fr 1fr 1.2fr .6fr; gap:1mm 4mm; }
.pp6-info .k { color:#444; }
.pp6-table { width:100%; border-collapse:collapse; font-size:.95em; }
.pp6-table th, .pp6-table td { border:1px solid #666; padding:.55mm 1.6mm; line-height:1.25; }
.pp6-table th { background:#f3eeee; font-weight:600; text-align:center; }
.pp6-table td.c { text-align:center; white-space:nowrap; }
.pp6-table td.lv { width:15mm; }
.pp6-table tr.grp td { background:#faf6f6; font-weight:600; }
.pp6-table tr.sum td { font-weight:700; background:#faf6f6; }
.pp6-cols { display:grid; grid-template-columns:1.25fr 1fr 1fr; gap:2.5mm; align-items:start; }
.pp6-cols .pp6-table { font-size:.88em; }
.pp6-comments { display:grid; grid-auto-flow:column; grid-auto-columns:1fr; gap:2.5mm; }
.pp6-comments > div { border:1px solid #666; min-height:17mm; padding:1mm 2mm; }
.pp6-sign { display:grid; grid-template-columns:repeat(3,1fr); gap:5mm; text-align:center; font-size:.92em; margin-top:auto; }
.pp6-sign .line { border-bottom:1px dotted #333; height:9mm; margin-bottom:.8mm; }
.pp6-foot { display:flex; justify-content:space-between; align-items:flex-end; font-size:.8em; color:#555; border-top:1px solid #ddd; padding-top:1.5mm; }
.pp6-qr { width:15mm; height:15mm; border:1px solid #999; display:grid; place-items:center; font-size:7pt; color:#999; }
/* หนังสือราชการตามระเบียบงานสารบรรณ — บนจอ/พิมพ์ใช้ Sarabun ขนาดที่เทียบเท่า TH SarabunPSK 16 pt (ไฟล์ Word ใช้ TH SarabunPSK 16 จริง) */
.a4.ld.ld-letter { --fs:12.5pt; font-size:12.5pt; line-height:1.55; padding:15mm 20mm 15mm 30mm; }
.ld-memo { display:flex; align-items:flex-end; margin-bottom:3mm; } .ld-memo img.ld-krut15 { height:15mm; width:auto; } .ld-memo-t { flex:1; text-align:center; font-weight:700; font-size:2.1em; margin-right:15mm; line-height:1; }
.ld-lab { font-weight:700; font-size:1.35em; }
.ld-krut3c { text-align:center; } img.ld-krut3 { height:30mm; width:auto; display:block; margin:0 auto 2mm; }
.ld-2.ld-lh, .ld-lh { display:grid; grid-template-columns:57% 43%; gap:0; margin-top:0; } .ld-lh p:first-child { white-space:nowrap; } .ld-lh p, .ld-2 p { margin:0; }
.ld-half { margin-left:50% !important; }
.ld-att { display:grid; grid-template-columns:auto 1fr; gap:0 3mm; } .ld-att p { margin:0; }
.ld-close { width:50%; margin:6mm 0 0 45%; text-align:center; line-height:1.5; }
.ld-foot { margin-top:12mm !important; font-size:.95em; }
.ld .fill:not(:empty) { border-bottom:0; padding:0; }
@media print { .ld-ex { display:none !important; } }
/* เอกสารโครงการอาหารกลางวัน (แบบตามคู่มือ สพฐ. 2569) */
.a4.ld { --fs:12.5pt; font-size:12.5pt; line-height:1.5; display:block; padding:12mm 15mm 10mm 25mm; }
.a4.ld.ld-md { --fs:12.5pt; font-size:12.5pt; line-height:1.42; padding:10mm 14mm 8mm 20mm; } .ld-md .ld-sig { margin:2mm 0 0 auto; } .ld-md .ld-cols { margin-top:2mm; }
.a4.ld.ld-ct { --fs:12pt; font-size:12pt; line-height:1.38; padding:9mm 14mm 8mm 20mm; } .ld-ct .ld-sig { margin:1.5mm 0 0 auto; } .ld-ct .ld-box { margin-top:2mm; padding:1.5mm 3mm; } .ld-ct .ld-box .ld-sig { margin-top:1mm; }
.a4.ld.ld-ct.ld-xs { --fs:11pt; font-size:11pt; line-height:1.34; }
.a4.ld.ld-sm { --fs:10.5pt; font-size:10.5pt; line-height:1.35; padding:8mm 9mm; } .a4.ld.ld-xs { --fs:9.5pt; font-size:9.5pt; line-height:1.3; padding:7mm 9mm; }
.a4.ld.ld-sheet { --fs:10pt; font-size:10pt; line-height:1.32; padding:7mm 8mm; }
.ld-cols.sm .ld-sig, .ld-insp > div { white-space:nowrap; font-size:.94em; }
.ld-insp { display:grid; grid-template-columns:1fr auto; gap:0 2mm; align-items:center; margin:1mm 0; } .ld-insp > div { grid-column:1; } .ld-insp > span { grid-column:2; grid-row:1 / span 3; font-size:.85em; text-align:center; }
.ld p { margin:1.2mm 0; } .ld .c { text-align:center; } .ld .r { text-align:right; white-space:nowrap; } .ld .tiny { font-size:.8em; }
.ld-p { text-indent:25mm; text-align:left; }
.ld-ex { text-align:right; font-size:.72em; color:#777; }
.ld-title { text-align:center; font-weight:700; font-size:1.3em; margin:1mm 0 3mm; line-height:1.35; }
.ld-topright { text-align:right; margin-bottom:2mm; }
.ld-memo { display:flex; align-items:flex-end; gap:0; margin-bottom:2mm; } .ld-memo img { height:15mm; width:auto; } .ld-memo b { flex:1; text-align:center; font-size:1.75em; margin-right:15mm; }
.ld-row { margin:.6mm 0; } .ld-2 { display:flex; gap:8mm; } .ld-2 > span:first-child { flex:1; }
.ld-hr { border:0; border-top:1px solid #333; margin:1.5mm 0 2mm; }
.fill { display:inline-block; border-bottom:1px dotted #333; padding:0 1.5mm; min-height:1.2em; line-height:1.25; text-indent:0; }
.ld-sig { display:flex; align-items:flex-start; text-align:center; margin:3mm 0 1mm auto; width:fit-content; line-height:1.55; white-space:nowrap; } .ld-sig.sm { margin:1.5mm auto; }
/* ชื่อ/ตำแหน่ง กึ่งกลางใต้เส้นประ: เส้นประยืดตามบรรทัดชื่อ · บรรทัดตำแหน่ง/วันที่ จัดกลางโดยไม่ขยายเส้น */
.ld-sig .sg-mid { display:inline-flex; flex-direction:column; align-items:center; } .ld-sig .sg-mid > .fill { align-self:stretch; margin-bottom:.35em; }
.ld-sig .sg-o { width:0; display:flex; justify-content:center; } .ld-cols .ld-sig { margin-left:auto; margin-right:auto; } .ld-sig .sg-pre, .ld-sig .sg-post { flex:none; }
.ld-cols { display:grid; grid-template-columns:1fr 1fr; gap:6mm; margin-top:3mm; } .ld-cols > div { border-top:1px solid #999; padding-top:2mm; }
.ld-cols.sm > div { border:0; padding:0; } .ld-cols3 { display:grid; grid-template-columns:repeat(3,1fr); gap:3mm; margin-top:4mm; }
.ld-box { border:1px solid #999; padding:2mm 3mm; margin-top:3mm; }
.ld-note { font-size:.75em; color:#444; margin-top:4mm; border-top:1px solid #ccc; padding-top:1.5mm; }
.ld-t { width:100%; border-collapse:collapse; margin:2mm 0; } .ld-t th, .ld-t td { border:1px solid #555; padding:.8mm 1.6mm; vertical-align:top; } .ld-t th { background:#f3f3f3; font-weight:600; text-align:center; vertical-align:middle; }
.ld-t.sm { font-size:.92em; } .ld-t.sm th, .ld-t.sm td { padding:.4mm 1.2mm; }
.ld-quad { display:grid; grid-template-columns:1fr 1fr; grid-template-rows:auto auto; border:1px solid #333; }
.ld-q { padding:2mm 2.5mm; border-right:1px solid #333; border-bottom:1px solid #333; } .ld-q:nth-child(2n) { border-right:0; } .ld-q:nth-child(n+3) { border-bottom:0; }
.ld-q p { margin:1mm 0; text-indent:0; } .ld-q .ld-sig { min-width:0; margin:1.5mm auto; }
@page { size:A4 portrait; margin:0; }
@media print {
  html, body { background:#fff !important; width:210mm; }
  .print-toolbar, .no-print { display:none !important; }
  .print-stage { padding:0; background:#fff; min-height:0; overflow:visible; }
  .a4 { margin:0; box-shadow:none; break-after:page; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}

/* Utility */
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:32px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.text-center{text-align:center}.w-100{width:100%}
@media (max-width:767px){ .hide-sm{display:none !important} }
@media (min-width:768px){ .show-sm-only{display:none !important} }
.grade-list { list-style:none; margin:0; } .grade-list li { display:flex; gap:12px; align-items:center; padding:12px 0; border-bottom:1px solid var(--line); } .grade-list li:last-child { border-bottom:0; }
@media (prefers-reduced-motion: reduce){ *{ animation:none !important; transition:none !important; scroll-behavior:auto !important; } }
@media (max-width:440px){
  .topbar { gap:4px; padding:0 10px; }
  .topbar .bm-text, .topbar .brand-mini .brand-school { display:none; }   /* จอแคบ: โลโก้โรงเรียนอยู่ในเมนูซ้าย (☰) — คงกระดิ่งแจ้งเตือนไว้ */
  .topbar .lang-switch { padding:6px 10px; }
}
.flip { transform:scaleX(-1); }

/* Workflow stepper */
.stepper { list-style:none; margin:0 0 24px; padding:0; display:grid; grid-template-columns:repeat(5,1fr); gap:6px; counter-reset:s; }
.stepper li { position:relative; display:flex; flex-direction:column; align-items:center; gap:6px; text-align:center; color:var(--text-2); }
.stepper li:not(:last-child)::after { content:""; position:absolute; top:22px; left:calc(50% + 26px); right:calc(-50% + 26px); height:2px; background:var(--line-strong); }
.stepper .dot { width:44px; height:44px; border-radius:50%; display:grid; place-items:center; background:var(--primary-soft); color:var(--primary); }
.stepper li:nth-child(3) .dot { background:var(--primary); color:#fff; }
@media (max-width:560px){ .stepper .small { font-size:.7rem; line-height:1.25; } .stepper .dot { width:36px; height:36px; } .stepper li:not(:last-child)::after { top:18px; left:calc(50% + 20px); right:calc(-50% + 20px); } }

/* Timetable grid */
.tt-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.tt { width:100%; min-width:860px; border-collapse:separate; border-spacing:0; font-size:.84rem; }
.tt th, .tt td { border-bottom:1px solid var(--line); border-right:1px solid var(--line); padding:6px; vertical-align:top; }
.tt thead th { background:var(--surface-2); font-weight:600; color:var(--text-2); text-align:center; white-space:nowrap; }
.tt thead th small { display:block; font-weight:500; color:var(--text-3); font-size:.72rem; }
.tt th.day { position:sticky; left:0; z-index:1; background:var(--surface-2); width:84px; text-align:left; }
.tt td.brk { background:repeating-linear-gradient(-45deg, var(--bg-soft) 0 6px, transparent 6px 12px); color:var(--text-3); text-align:center; vertical-align:middle; font-size:.72rem; writing-mode:vertical-rl; text-orientation:sideways; -webkit-text-orientation:sideways; letter-spacing:0; white-space:nowrap; padding:4px 2px; width:28px; }
.tt th.tt-sum, .tt td.tt-sum { width:56px; text-align:center; vertical-align:middle; background:var(--surface-2); } .tt td.tt-sum b { font-size:1.15rem; color:var(--coral-600); }
.tt .cell { display:block; border-radius:10px; padding:6px 8px; min-height:58px; background:var(--a-bg, var(--primary-soft)); color:var(--text); text-decoration:none !important; border:1.5px solid transparent; }
.tt .cell b { display:block; font-size:.82rem; line-height:1.25; }
.tt .cell small { display:block; color:var(--text-2); font-size:.72rem; }
.tt .cell.sub { border-color:var(--warn); background:var(--warn-soft); }
.tt .cell.conflict { border-color:var(--bad); background:var(--bad-soft); }
.tt .cell.empty { background:transparent; border:1.5px dashed var(--line-strong); color:var(--text-3); display:grid; place-items:center; }
.a-ท { --a-bg:#fde7e3 } .a-ค { --a-bg:#e3eefb } .a-ว { --a-bg:#e3f4ea } .a-ส { --a-bg:#fbf0dc } .a-พ { --a-bg:#e6f6f7 } .a-ศ { --a-bg:#f1e6f8 } .a-ง { --a-bg:#eef0e0 } .a-อ { --a-bg:#ffe9d6 } .a-ก { --a-bg:#ececec }
:root[data-theme="dark"] .tt .cell:not(.empty) { --a-bg:var(--surface-2); }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .tt .cell:not(.empty) { --a-bg:var(--surface-2); } }
.legend { display:flex; flex-wrap:wrap; gap:8px; }
.legend span { display:inline-flex; align-items:center; gap:6px; font-size:.78rem; color:var(--text-2); }
.legend i { width:12px; height:12px; border-radius:4px; background:var(--a-bg); display:inline-block; }
/* Mobile timetable: รายวัน */
.tt-day { display:none; }
@media (max-width:767px){ .tt-wrap.has-day { display:none; } .tt-day { display:block; } }
.tt-day .list li { align-items:stretch; }
.tt-day .time { width:64px; flex:none; font-size:.75rem; color:var(--text-3); font-variant-numeric:tabular-nums; }
.tt-day .cell { flex:1; }
@media (min-width:641px){ .table-wrap .table { min-width:720px; } .table td { white-space:normal; } }

/* Today list + now highlight */
.today-list li { gap:12px; }
.today-list .time { width:64px; flex:none; font-size:.75rem; color:var(--text-3); font-variant-numeric:tabular-nums; line-height:1.3; }
.today-list li.is-now { background:var(--ok-soft); border-radius:12px; padding-left:10px; padding-right:10px; border-bottom-color:transparent; }
.today-list li.lunch { padding:6px 0; background:repeating-linear-gradient(-45deg, var(--bg-soft) 0 6px, transparent 6px 12px); border-radius:8px; }
.tt .cell.now { box-shadow:0 0 0 2.5px var(--ok); }
.tt .cell.now::before { content:"● NOW"; display:block; font-size:.62rem; font-weight:700; color:var(--ok); letter-spacing:.04em; }
.hours-grid input { width:52px; min-height:36px; text-align:center; border:1.5px solid var(--line-strong); border-radius:8px; background:var(--surface); color:var(--text); font:600 .95rem var(--font-body); }
.hours-grid input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.hours-grid tfoot th { background:var(--surface-2); border-top:1px solid var(--line); }
.area-dot { display:inline-block; width:10px; height:10px; border-radius:3px; background:var(--a-bg); margin-right:8px; vertical-align:middle; box-shadow:inset 0 0 0 1px rgba(0,0,0,.08); }
/* Backfill timeline */
.bf-timeline { display:grid; gap:12px; grid-template-columns:repeat(2,1fr); }
@media (min-width:700px){ .bf-timeline { grid-template-columns:repeat(3,1fr); } }
@media (min-width:1100px){ .bf-timeline { grid-template-columns:repeat(6,1fr); } }
.bf-step { padding:14px; display:flex; flex-direction:column; }
.bf-step .btn { margin-top:auto; }
[data-ptab-panel][hidden] { display:none !important; }
.bf-step.is-link { color:inherit; text-decoration:none !important; cursor:pointer; transition:border-color .15s; } .bf-step.is-link:hover { border-color:var(--primary); }
.bf-step.is-sel { border-color:var(--primary) !important; box-shadow:0 0 0 2px var(--primary-soft) !important; }
.bf-step.is-current { border-color:var(--iep-purple); box-shadow:0 0 0 2px color-mix(in srgb, var(--iep-purple) 25%, transparent); }
/* Settings */
.set-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); font-size:.92rem; }
.switch-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); cursor:pointer; font-size:.92rem; }
.switch-row input { position:absolute; opacity:0; width:1px; height:1px; }
.switch-row i { flex:none; width:44px; height:26px; border-radius:999px; background:var(--line-strong); position:relative; transition:background .2s; }
.switch-row i::after { content:""; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:#fff; box-shadow:var(--shadow-sm); transition:transform .2s var(--ease); }
.switch-row input:checked + i { background:var(--ok); }
.switch-row input:checked + i::after { transform:translateX(18px); }
.switch-row input:focus-visible + i { outline:3px solid var(--coral-300); outline-offset:2px; }
.score-grid th.term-head { background:var(--primary-soft); color:var(--coral-700); }

/* School map */
.map-frame { position:relative; aspect-ratio:16/10; background:linear-gradient(135deg, #e6efe3, #e3ecf7); }
.map-frame iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
.map-facade { position:absolute; inset:0; display:flex; flex-direction:column; gap:8px; align-items:center; justify-content:center; border:0; cursor:pointer; color:var(--navy-600); font:600 .95rem var(--font-body);
  background:radial-gradient(circle at 50% 45%, rgba(255,255,255,.9) 0 70px, transparent 71px), repeating-linear-gradient(0deg, rgba(31,76,125,.06) 0 1px, transparent 1px 28px), repeating-linear-gradient(90deg, rgba(31,76,125,.06) 0 1px, transparent 1px 28px), linear-gradient(135deg, #e6efe3, #e3ecf7); }
.map-facade .icon { width:36px; height:36px; color:var(--primary); }
.map-facade:hover span { text-decoration:underline; }
.structure-grid input { width:64px; min-height:36px; text-align:center; border:1.5px solid var(--line-strong); border-radius:8px; background:var(--surface); color:var(--text); font:600 .95rem var(--font-body); }
.structure-grid input[readonly] { background:var(--surface-2); color:var(--text-2); border-style:dashed; }
.structure-grid th.term-head { background:var(--primary-soft); color:var(--coral-700); }
/* Import */
.dropzone { display:flex; flex-direction:column; align-items:center; gap:6px; padding:36px 16px; border:2px dashed var(--line-strong); border-radius:var(--radius); background:var(--surface-2); cursor:pointer; text-align:center; position:relative; }
.dropzone:hover, .dropzone:focus-within { border-color:var(--primary); background:var(--primary-soft); }
.dropzone .icon { width:36px; height:36px; color:var(--primary); }
.dropzone input { position:absolute; inset:0; opacity:0; cursor:pointer; }
.dropzone.has-file b { color:var(--ok); }
tr.imp-error td { background:color-mix(in srgb, var(--bad-soft) 55%, transparent); }
/* Student profile */
.profile-head { display:flex; gap:18px; align-items:center; flex-wrap:wrap; }
.profile-head .photo { width:84px; height:104px; border-radius:14px; background:linear-gradient(135deg, var(--coral-100), #e3ecf7); display:grid; place-items:center; color:var(--coral-300); flex:none; }
.profile-head .photo .icon { width:40px; height:40px; }
.profile-tabs { overflow-x:auto; max-width:100%; flex-wrap:nowrap; }
.profile-tabs a { white-space:nowrap; display:inline-flex; align-items:center; gap:4px; } .profile-tabs .icon { width:15px; height:15px; }
.kv { display:flex; gap:12px; padding:9px 0; border-bottom:1px solid var(--line); font-size:.9rem; align-items:center; }
.kv:last-child { border-bottom:0; }
.kv > span { width:42%; flex:none; color:var(--text-3); font-size:.84rem; }
.kv > b { font-weight:500; flex:1; min-width:0; display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
section[id^="p-"] { scroll-margin-top:80px; }

/* Attendance */
.hour-tabs { overflow-x:auto; max-width:100%; flex-wrap:nowrap; }
.hour-tabs a { white-space:nowrap; display:inline-flex; align-items:center; gap:4px; }
.att-list { list-style:none; margin:0; }
.att-row { display:flex; align-items:center; gap:10px; padding:10px 4px; border-bottom:1px solid var(--line); flex-wrap:wrap; border-radius:10px; }
.att-row:last-child { border-bottom:0; }
.att-row .no { width:26px; text-align:center; color:var(--text-3); font-size:.8rem; font-variant-numeric:tabular-nums; }
.att-row .who { flex:1; min-width:150px; }
.att-row.st-late { background:var(--warn-soft); } .att-row.st-absent { background:var(--bad-soft); }
.att-row.st-sick, .att-row.st-personal { background:var(--info-soft); }
.att-opts { display:flex; gap:4px; flex-wrap:wrap; }
@media (max-width:640px){ .att-opts { width:100%; padding-left:36px; } .att-opts .opt { flex:1; } }
.att-opts .opt { position:relative; }
.att-opts .opt input { position:absolute; opacity:0; inset:0; cursor:pointer; margin:0; }
.att-opts .opt span { display:block; text-align:center; min-width:52px; padding:7px 10px; border-radius:10px; border:1.5px solid var(--line-strong); font-size:.8rem; font-weight:600; color:var(--text-2); background:var(--surface); }
.att-opts .opt input:focus-visible + span { outline:3px solid var(--coral-300); outline-offset:1px; }
.att-opts .opt-present input:checked + span { background:var(--ok); border-color:var(--ok); color:#fff; }
.att-opts .opt-late input:checked + span { background:var(--warn); border-color:var(--warn); color:#fff; }
.att-opts .opt-sick input:checked + span, .att-opts .opt-personal input:checked + span, .att-opts .opt-leave input:checked + span { background:var(--info); border-color:var(--info); color:#fff; }
.att-opts .opt-absent input:checked + span { background:var(--bad); border-color:var(--bad); color:#fff; }
.att-savebar { position:sticky; bottom:calc(76px + env(safe-area-inset-bottom)); z-index:20; display:flex; align-items:center; gap:10px; margin-top:12px; padding:10px 14px; border-radius:var(--radius); background:color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter:blur(10px); border:1px solid var(--line); box-shadow:var(--shadow); }
@media (min-width:1024px) and (hover:hover) and (pointer:fine){ .att-savebar { bottom:16px; } }
/* Calendar */
.cal { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; text-align:center; }
.cal-h { font-size:.72rem; color:var(--text-3); font-weight:600; }
.cal-d { aspect-ratio:1; display:grid; place-items:center; border-radius:10px; font-size:.85rem; font-weight:600; background:var(--surface-2); color:var(--text-2); }
.cal-present { background:var(--ok-soft) !important; color:var(--ok) !important; } .cal-late { background:var(--warn-soft) !important; color:var(--warn) !important; }
.cal-sick, .cal-personal { background:var(--info-soft) !important; color:var(--info) !important; } .cal-absent { background:var(--bad-soft) !important; color:var(--bad) !important; }
.cal-holiday { background:repeating-linear-gradient(-45deg, var(--bg-soft) 0 5px, transparent 5px 10px) !important; color:var(--text-3) !important; }
.cal-weekend, .cal-future { background:transparent !important; color:var(--text-3) !important; font-weight:400; }
.legend i.cal-present, .legend i.cal-late, .legend i.cal-sick, .legend i.cal-personal, .legend i.cal-absent, .legend i.cal-holiday { width:12px; height:12px; border-radius:4px; }
@media (max-width:640px){
  .att-counts { grid-template-columns:repeat(4,1fr); gap:6px; }
  .att-counts .kpi { padding:10px 6px !important; align-items:center !important; text-align:center; gap:2px !important; }
  .att-counts .chip-icon { display:none; }
  .att-counts .kpi .val { font-size:1.3rem !important; }
  .att-counts .kpi .lbl { font-size:.68rem; line-height:1.2; }
}
@media (max-width:640px){
  .att-opts { display:grid; grid-template-columns:repeat(5,1fr); gap:4px; width:100%; padding-left:0; }
  .att-opts .opt span { min-width:0; padding:8px 2px; font-size:.74rem; }
  .att-row { padding:10px 6px; gap:6px; }
}
/* Permissions */
.perm-card { display:flex; flex-direction:column; }
.avatars { display:flex; align-items:center; }
.avatars .avatar { width:32px; height:32px; font-size:.8rem; border:2px solid var(--surface); margin-left:-8px; }
.avatars .avatar:first-child { margin-left:0; }
.perm-cat { font-size:.74rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-3); padding:14px 0 2px; }
.pick-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:6px 12px; max-height:220px; overflow:auto; padding:10px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface-2); }
.add-member { border-top:1px solid var(--line); padding-top:14px; }
.switch-row input:disabled + i { opacity:.5; }

/* =====================================================================
   ICON SYSTEM v2 — tinted tiles ตามหมวดเมนู (Lucide-based)
   ===================================================================== */
.icon { stroke-width:1.9; }
:root {
  --tone-coral:#e9705e; --tone-coral-bg:#fde8e3;
  --tone-teal:#1f9aa8;  --tone-teal-bg:#dcf2f4;
  --tone-green:#3f9a4a; --tone-green-bg:#e3f3e1;
  --tone-purple:#8a4fb3; --tone-purple-bg:#f0e6f8;
  --tone-navy:#2a5d93;  --tone-navy-bg:#e2ecf8;
}
:root[data-theme="dark"] { --tone-coral-bg:#3a2427; --tone-teal-bg:#173136; --tone-green-bg:#1b3020; --tone-purple-bg:#2d2238; --tone-navy-bg:#1a2a3d; }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) { --tone-coral-bg:#3a2427; --tone-teal-bg:#173136; --tone-green-bg:#1b3020; --tone-purple-bg:#2d2238; --tone-navy-bg:#1a2a3d; } }
.side-link { --t:var(--tone-navy); --tb:var(--tone-navy-bg); gap:11px; padding:7px 10px; }
.side-link.tone-coral  { --t:var(--tone-coral);  --tb:var(--tone-coral-bg); }
.side-link.tone-teal   { --t:var(--tone-teal);   --tb:var(--tone-teal-bg); }
.side-link.tone-green  { --t:var(--tone-green);  --tb:var(--tone-green-bg); }
.side-link.tone-purple { --t:var(--tone-purple); --tb:var(--tone-purple-bg); }
.side-link .si { width:32px; height:32px; border-radius:10px; display:grid; place-items:center; flex:none; background:var(--tb); color:var(--t); transition:background .2s, color .2s, transform .2s var(--ease); }
.side-link .si .icon { width:18px; height:18px; }
.side-link:hover .si { transform:scale(1.06); }
.side-link.is-active { background:var(--tb); color:var(--text); }
.side-link.is-active .si { background:var(--t); color:#fff; box-shadow:0 6px 14px -6px var(--t); }
.side-link.is-active { font-weight:600; }
/* ปุ่มออกจากระบบในแถบข้าง */
.side-foot .side-link > .icon { width:32px; height:18px; color:var(--text-3); }
/* Tab bar มือถือ */
.tabbar a .ti { width:46px; height:30px; border-radius:999px; display:grid; place-items:center; transition:background .2s; }
.tabbar a .ti .icon { width:22px; height:22px; }
.tabbar a.is-active .ti { background:var(--primary-soft); color:var(--primary); }
.tabbar a.is-active .icon { filter:none; }
/* chip-icon ในการ์ด: เส้นบางลงเล็กน้อย ดูเบาขึ้น */
.chip-icon .icon { stroke-width:1.8; }

/* Activation / access */
.steps-mini { list-style:none; display:flex; gap:6px; justify-content:center; padding:0; margin:10px 0 0; font-size:.78rem; }
.steps-mini li { padding:4px 10px; border-radius:999px; background:var(--bg-soft); color:var(--text-3); }
.steps-mini li.on { background:var(--primary); color:#fff; } .steps-mini li.done { background:var(--ok-soft); color:var(--ok); }
.code-input { font:700 1.3rem/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing:.18em; text-align:center; text-transform:uppercase; }
.slip-sheet { width:210mm; margin:0 auto; background:#fff; display:grid; grid-template-columns:1fr 1fr; padding:8mm; gap:0; box-shadow:0 10px 30px rgba(0,0,0,.15); color:#111; font-family:"Sarabun", "Anuphan", sans-serif; }
.slip { border:1px dashed #999; padding:5mm; display:flex; flex-direction:column; gap:3mm; break-inside:avoid; min-height:66mm; }
.slip-head { display:flex; gap:3mm; align-items:center; border-bottom:1px solid #eee; padding-bottom:2mm; }
.slip-head img { width:10mm; height:10mm; } .slip-head b { display:block; font-size:11pt; color:#c4503c; } .slip-head small { font-size:8pt; color:#555; }
.slip-body { display:flex; gap:4mm; align-items:center; }
.slip-qr svg { width:30mm; height:30mm; display:block; }
.slip-title { font-size:8.5pt; color:#555; } .slip-name { font-size:11pt; font-weight:700; line-height:1.25; } .slip-meta { font-size:8.5pt; color:#555; margin-bottom:1.5mm; }
.slip-kv { display:flex; gap:2mm; align-items:baseline; font-size:8.5pt; } .slip-kv span { color:#666; }
.slip-code { font:700 13pt/1.2 ui-monospace, Menlo, monospace; letter-spacing:.08em; }
.slip-steps { margin:0; padding-left:5mm; font-size:8pt; color:#333; line-height:1.4; }
.slip-foot { display:flex; justify-content:space-between; align-items:center; font-size:7.5pt; color:#777; margin-top:auto; }
.line-btn { background:#06c755; color:#fff !important; min-height:28px; padding:4px 10px; }
@media print { .slip-sheet { box-shadow:none; padding:6mm; } }
@media (max-width:860px){ .slip-sheet { width:100%; grid-template-columns:1fr; } }
/* Profile */
.profile-top { display:flex; gap:16px; align-items:center; flex-wrap:wrap; }
.avatar-xl { width:84px; height:84px; font-size:2rem; border-radius:50%; object-fit:cover; box-shadow:var(--shadow); }
img.avatar { object-fit:cover; background:var(--surface-2); }
.user-chip { text-decoration:none !important; color:inherit; border-radius:999px; padding:3px 10px 3px 3px; }
.user-chip:hover { background:var(--primary-soft); }

/* Safari/iOS ไม่ใช้ <style> ภายในไฟล์ sprite ภายนอก — กำหนดสไตล์เส้นที่ตัว <svg> (สืบทอดเข้า <use> ได้ทุกเบราว์เซอร์) */
.icon { fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }

/* Room chips */
.room-chips { display:flex; gap:8px; flex-wrap:wrap; }
.room-chips .chip { display:inline-flex; align-items:baseline; gap:6px; padding:8px 14px; border-radius:999px; border:1.5px solid var(--line-strong); background:var(--surface); color:var(--text-2); font-weight:600; font-size:.88rem; text-decoration:none !important; }
.room-chips .chip b { color:var(--text); } .room-chips .chip small { color:var(--text-3); font-weight:500; font-size:.72rem; }
.room-chips .chip.is-active { background:var(--primary); border-color:var(--primary); color:#fff; } .room-chips .chip.is-active b, .room-chips .chip.is-active small { color:#fff; }
/* Student photos */
.stu-photo { width:40px; height:40px; border-radius:12px; object-fit:cover; flex:none; background:var(--surface-2); box-shadow:0 0 0 1px var(--line); }
.stu-initial { display:inline-grid; place-items:center; color:#fff; font-weight:700; font-family:var(--font-display);
  background:linear-gradient(135deg, hsl(var(--h) 65% 62%), hsl(calc(var(--h) + 40) 60% 52%)); box-shadow:none; }
.stu-cell { display:flex; align-items:center; gap:10px; color:inherit; text-decoration:none !important; }
.stu-cell:hover b { color:var(--primary); }
.profile-head .stu-photo { width:104px; height:104px; border-radius:18px; }
.photo-box { position:relative; flex:none; }
.photo-actions { position:absolute; right:-8px; bottom:-8px; display:flex; gap:4px; }
.photo-actions .btn { min-height:32px; width:32px; padding:0; border-radius:10px; background:var(--surface); box-shadow:var(--shadow-sm); }
.form-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:0 16px; }
.form-grid .span-2, .form-grid .span-3 { grid-column:1/-1; }
@media (min-width:760px){ .form-grid { grid-template-columns:repeat(4,1fr); } .form-grid .span-2 { grid-column:span 2; } .form-grid .span-3 { grid-column:span 3; } }
@media (max-width:520px){ .form-grid { grid-template-columns:1fr; } }
.table tr.row-off td { opacity:.5; }
.table tr.row-total td { background:var(--surface-2); }
.table tr.row-subtotal td { font-size:.85rem; font-weight:600; border-bottom:2px solid var(--line); }
.table tr.row-group td { background:var(--surface-2); font-weight:700; font-size:.8rem; color:var(--text-2); }

/* ===== ข่าวสาร ===== */
.news-card .thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.news-card .thumb { position:relative; overflow:hidden; }
.news-card a.stretch { color:inherit; text-decoration:none; }
.news-card a.stretch::after { content:""; position:absolute; inset:0; }
.news-card { position:relative; transition:transform .15s, box-shadow .15s; }
.news-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-lg, 0 10px 30px rgba(0,0,0,.08)); }
.news-card .meta { display:flex; gap:8px; align-items:center; flex-wrap:wrap; font-size:.82rem; color:var(--text-3); margin-top:auto; }
.news-card p { margin:0; color:var(--text-3); font-size:.92rem; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.pin-flag { position:absolute; top:10px; left:10px; background:var(--coral-500, #e8836b); color:#fff; border-radius:999px; padding:3px 10px; font-size:.78rem; display:inline-flex; gap:4px; align-items:center; z-index:1; }
.pin-flag .icon { width:14px; height:14px; }
.img-count { position:absolute; right:10px; bottom:10px; background:rgba(0,0,0,.55); color:#fff; border-radius:999px; padding:2px 9px; font-size:.78rem; display:inline-flex; gap:4px; align-items:center; }
.img-count .icon { width:13px; height:13px; }
.article { max-width:820px; margin:0 auto; }
.article h1 { font-size:clamp(1.5rem, 3.4vw, 2.2rem); line-height:1.3; margin:.3em 0 .4em; }
.article .cover { border-radius:var(--radius-lg, 18px); overflow:hidden; margin:18px 0 22px; background:var(--coral-100); }
.article .cover img { width:100%; height:auto; display:block; }
.article .content { font-size:1.06rem; line-height:1.85; }
.article .content p { margin:0 0 1em; }
.article .content a { word-break:break-all; }
.album { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:8px; margin:12px 0 24px; }
.album a, .album figure { display:block; margin:0; border-radius:10px; overflow:hidden; aspect-ratio:16/10; background:var(--surface-2, #f3f3f3); position:relative; }
.album img { width:100%; height:100%; object-fit:cover; display:block; transition:transform .2s; }
.album a:hover img { transform:scale(1.04); }
.lightbox { border:0; padding:0; background:transparent; max-width:100vw; max-height:100vh; width:100vw; height:100vh; }
.lightbox::backdrop { background:rgba(10,10,15,.92); }
.lightbox .lb-wrap { position:relative; width:100%; height:100%; display:grid; place-items:center; padding:56px 12px 70px; }
.lightbox img { max-width:100%; max-height:100%; object-fit:contain; border-radius:6px; }
.lightbox .lb-bar { position:fixed; left:0; right:0; bottom:0; padding:14px 18px; color:#eee; display:flex; gap:12px; align-items:center; font-size:.95rem; }
.lightbox .lb-btn { position:fixed; top:50%; transform:translateY(-50%); background:rgba(255,255,255,.12); color:#fff; border:0; width:46px; height:46px; border-radius:50%; display:grid; place-items:center; cursor:pointer; }
.lightbox .lb-btn:hover { background:rgba(255,255,255,.24); }
.lightbox [data-lb-prev] { left:12px; } .lightbox [data-lb-next] { right:12px; }
.lightbox [data-lb-close] { top:28px; right:12px; transform:none; }
.lightbox [data-lb-prev] .icon { transform:rotate(180deg); }
.album-edit { display:grid; grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); gap:12px; }
.album-edit .ph { border:1px solid var(--line, #e7e7e7); border-radius:12px; overflow:hidden; background:var(--surface, #fff); }
.album-edit .ph img { width:100%; aspect-ratio:16/10; object-fit:cover; display:block; }
.album-edit .ph .ctl { padding:8px; display:grid; gap:6px; font-size:.82rem; }
.album-edit .ph .ctl .input { padding:6px 8px; font-size:.85rem; min-height:auto; }
.album-edit .ph.is-cover { outline:3px solid var(--coral-500, #e8836b); }
/* เขียนข่าวด่วน (มือถือ) */
.nq { max-width:640px; margin-inline:auto; }
.nq-pick, .nq-go { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.nq-pick .btn, .nq-go .btn-primary { flex:1 1 200px; justify-content:center; }
.nq-go { margin-top:14px; }
.nq-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-top:1px solid var(--line, #e7e7e7); color:inherit; text-decoration:none; }
.nq-row img { border-radius:6px; object-fit:cover; }
.nq-row .nq-t { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.album-new { margin:0; border-radius:10px; overflow:hidden; position:relative; aspect-ratio:16/10; }
.album-new img { width:100%; height:100%; object-fit:cover; }
.album-new figcaption { position:absolute; right:6px; bottom:6px; background:rgba(0,0,0,.6); color:#fff; font-size:.72rem; border-radius:6px; padding:1px 6px; }
.album-new.is-bad { outline:3px solid #d33; }
.drop-zone { border:2px dashed var(--line, #ddd); border-radius:14px; padding:18px; text-align:center; display:block; cursor:pointer; color:var(--text-3); }
.drop-zone:hover { border-color:var(--coral-300, #f2b2a2); }
.drop-zone input { display:block; margin:10px auto 0; max-width:100%; }
.status-pending { background:var(--warn-soft); } .status-returned { background:var(--bad-soft); } .status-published { background:var(--ok-soft); }
.review-note { border-left:4px solid #d9654b; padding:10px 14px; background:var(--bad-soft); border-radius:8px; }
.preview-bar { background:#2b2b38; color:#fff; padding:10px 16px; border-radius:10px; display:flex; gap:10px; align-items:center; margin-bottom:16px; }.form-sec { font-size:1.05rem; display:flex; gap:8px; align-items:center; margin:22px 0 10px; font-weight:700; }
.form-sec .icon { width:20px; height:20px; color:var(--coral-500); flex:none; }
.form-sec small { font-weight:400; }
details > summary.form-sec { list-style:none; } details > summary.form-sec::-webkit-details-marker { display:none; }
details > summary.form-sec::after { content:"▾"; color:var(--text-3); font-size:.9em; }

/* ===== คู่มือการใช้งาน ===== */
.help-card { display:flex; gap:14px; align-items:flex-start; color:inherit; text-decoration:none; padding:20px; transition:transform .15s, box-shadow .15s; }
.help-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-lg); }
.help-card h2 { font-size:1.08rem; margin:0 0 4px; }
.help-card p { margin:0 0 6px; color:var(--text-2); font-size:.92rem; }
.help-layout { display:grid; gap:20px; }
@media (min-width:1000px) { .help-layout { grid-template-columns:250px 1fr; align-items:start; } .help-toc { position:sticky; top:84px; } }
.help-toc { padding:16px; display:grid; gap:6px; font-size:.9rem; }
.help-toc a { color:var(--text-2); text-decoration:none; padding:3px 0; display:flex; gap:6px; align-items:center; }
.help-toc a:hover { color:var(--primary); }
.help-toc .icon { width:16px; height:16px; flex:none; }
.help-toc hr { border:0; border-top:1px solid var(--line); width:100%; margin:6px 0; }
.help-body { display:grid; gap:16px; min-width:0; }
.help-sec { scroll-margin-top:84px; }
.help-sec h2 { font-size:1.12rem; display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin:0 0 10px; }
.help-no { width:28px; height:28px; border-radius:50%; background:var(--primary-soft); color:var(--primary-ink); display:grid; place-items:center; font-size:.9rem; flex:none; }
.help-steps { margin:0; padding-left:22px; display:grid; gap:8px; line-height:1.7; }
.help-steps li::marker { color:var(--coral-500); font-weight:700; }
.help-steps code, .help-tips code { background:var(--surface-2); padding:1px 6px; border-radius:6px; }
.help-tips { margin-top:12px; background:var(--info-soft); border-radius:12px; padding:10px 14px; }
.help-tips p { margin:4px 0; font-size:.92rem; display:flex; gap:8px; align-items:flex-start; }
.help-tips .icon { width:16px; height:16px; flex:none; margin-top:4px; }
@media print {
  .sidebar, .topbar, .tabbar, .site-header, .site-footer, .help-toc, .install-toast { display:none !important; }
  .app-shell, .app-main { display:block !important; margin:0 !important; padding:0 !important; }
  .help-layout { display:block; } .help-sec { break-inside:avoid; box-shadow:none; border:1px solid #ddd; margin-bottom:10px; }
}
.help-other { display:grid; gap:6px; }

/* ===== เกี่ยวกับ IEP ===== */
.about-hero { background:linear-gradient(180deg, var(--hero-tint, #fde3dd) 0%, var(--bg) 100%); padding:48px 0 28px; }
:root[data-theme="dark"] .about-hero { background:linear-gradient(180deg, #2a1d22 0%, var(--bg) 100%); }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .about-hero { background:linear-gradient(180deg, #2a1d22 0%, var(--bg) 100%); } }
.about-hero .kicker { font-family:var(--font-display); color:var(--primary); }
.about-hero h1 { font-size:clamp(1.6rem, 3.6vw, 2.5rem); margin:.2em 0 .3em; line-height:1.25; }
.about-hero .lead { font-size:clamp(1rem, .95rem + .4vw, 1.15rem); color:var(--text-2); max-width:820px; line-height:1.7; }
.about-badges { display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.about-badges .badge { font-size:.9rem; padding:6px 12px; }
.about h2 { font-size:clamp(1.25rem, 2.4vw, 1.6rem); }
.about h3 { font-size:1.02rem; margin:8px 0 4px; }
.about p { line-height:1.8; }
.about-grid { display:grid; gap:24px; }
@media (min-width:900px) { .about-grid { grid-template-columns:1.6fr 1fr; align-items:start; } }
.about-vision .lead-quote { font-family:var(--font-display); font-size:1.15rem; color:var(--coral-600); line-height:1.6; margin:6px 0 0; }
.about-list { gap:14px; }
@media (min-width:700px) { .grid-2 { grid-template-columns:repeat(2, 1fr); } }
.about-item { display:flex; gap:14px; align-items:flex-start; padding:14px 16px; border-radius:var(--radius); background:var(--surface); border:1px solid var(--line); }
.about-item .chip-icon { flex:none; }
.about-item p { margin:0; color:var(--text-2); font-size:.95rem; line-height:1.7; }
.about-item h3 { margin:0 0 2px; }
.wcss { gap:12px; }
@media (min-width:700px) { .grid-5 { grid-template-columns:repeat(3, 1fr); } }
@media (min-width:1000px) { .grid-5 { grid-template-columns:repeat(5, 1fr); } }
.wcss-item { padding:18px; text-align:center; }
.wcss-item .chip-icon { margin:0 auto; }
.wcss-item p { font-size:.88rem; color:var(--text-2); margin:0; line-height:1.6; }
.chips-inline { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }
.about-cta { display:flex; gap:16px; align-items:center; justify-content:space-between; flex-wrap:wrap; background:linear-gradient(135deg, var(--coral-50, #fff4f1), var(--surface)); }
.ev-grid select.ev-sel { width:52px; padding:4px 2px; min-height:auto; text-align:center; }
.ev-grid td input { width:64px; }
.tt-edit .tt-sel { width:100%; min-width:110px; padding:6px 4px; font-size:.82rem; min-height:auto; }
.cal-none { background:transparent !important; color:var(--text-2) !important; font-weight:400; outline:1px dashed var(--line); }
a.cal-d { text-decoration:none; cursor:pointer; } a.cal-d:hover { filter:brightness(.95); } .cal-d.is-sel { outline:2px solid var(--primary) !important; outline-offset:1px; }
.pp6-qr svg { width:100%; height:100%; display:block; } .pp6-qr { border:0; }
.bell-dot { position:absolute; top:2px; right:2px; min-width:18px; height:18px; padding:0 5px; border-radius:999px; background:var(--coral-500); color:#fff; font-size:.68rem; font-weight:700; display:grid; place-items:center; line-height:1; }
.list li.is-unread { background:var(--primary-soft); border-radius:10px; }

/* ===== รายงานการมาเรียน (ช่วงเวลา + พิมพ์ 1 หน้า) ===== */
.att-period { display:flex; gap:10px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.att-period .seg { flex-wrap:wrap; }
.att-nav { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.att-nav form { margin:0; }
.att-matrix th.att-bk { font-size:.75rem; line-height:1.2; white-space:nowrap; }
.att-matrix td, .att-matrix th { white-space:nowrap; }
.att-matrix tfoot th { background:var(--surface-2); }
.att-c-good { background:rgba(22,163,74,.12); } .att-c-mid { background:rgba(234,179,8,.18); } .att-c-low { background:rgba(220,38,38,.16); color:#991b1b; font-weight:600; }
:root[data-theme="dark"] .att-c-low { color:#fca5a5; }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .att-c-low { color:#fca5a5; } }
.att-c-none { color:var(--text-3); }
.att-rep .att-sum { display:grid; grid-auto-flow:column; grid-auto-columns:1fr; border:1px solid #666; }
.att-rep .att-sum > div { display:flex; flex-direction:column; align-items:center; padding:1mm; border-left:1px solid #ccc; }
.att-rep .att-sum > div:first-child { border-left:0; background:#f3eeee; }
.att-rep .att-sum span { font-size:.85em; color:#444; } .att-rep .att-sum b { font-size:1.35em; }
.att-rep .att-note { margin:0; font-size:.8em; color:#555; }
.att-rep .att-tbl th.att-bk { font-size:.85em; line-height:1.15; font-weight:600; }
.att-rep .att-tbl tfoot td { font-weight:700; background:#faf6f6; }
.att-rep .att-names { font-size:.9em; line-height:1.3; } .att-rep .att-names span { margin-right:2mm; }
.att-rep .att-sub { font-weight:700; margin-top:1mm; }
.att-rep .att-legend { display:flex; gap:2mm; font-size:.8em; } .att-rep .att-legend span { padding:.3mm 2mm; border:1px solid #ccc; }
.att-rep .att-c-low { color:#991b1b; }
@media print { .att-rep .att-c-good, .att-rep .att-c-mid, .att-rep .att-c-low { -webkit-print-color-adjust:exact; print-color-adjust:exact; } }
.sub-rep .sub-tbl td { height:2.5em; }
.sub-rep.is-compact { gap:1.6mm; }
.sub-rep.is-compact .pp6-table th, .sub-rep.is-compact .pp6-table td { padding:.3mm 1.2mm; line-height:1.18; }
.sub-rep.is-compact .sub-tbl td { height:auto; }
.sub-rep.is-compact .att-sum b { font-size:1.15em; }
.sub-rep.is-compact .pp6-sign .line { height:6mm; }
/* จัดตาราง: ช่องที่เลือกแล้ว / ชั่วโมงหลักสูตรทั่วไป */
.tt-edit td.tt-set .tt-sel { background:var(--primary-soft); border-color:var(--primary); }
.tt-edit .tt-sel option:disabled { color:#b4a9ac; }
.tt .cell.ext { background:repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--bg-soft) 6px 12px); color:var(--text-2); }
.tt-edit .tt-ext { width:100%; min-width:110px; padding:6px; font-size:.8rem; min-height:auto; }
.tt-edit td.iep { background:var(--primary-soft); font-size:.78rem; line-height:1.25; padding:6px; }
.tt-edit td.iep b { display:block; }

/* ===== พิมพ์ตารางเรียน / ตารางสอน (A4 แนวนอน) ===== */
@page land { size:A4 landscape; margin:0; }
.a4.a4l { width:297mm; height:210mm; padding:8mm 10mm 7mm; page:land; gap:2.6mm; }
@media print { body:has(.a4l) { width:297mm !important; } }
.ttp-head { display:grid; grid-template-columns:16mm 1fr auto; align-items:center; gap:4mm; border-bottom:2px solid #c8102e; padding-bottom:2mm; }
.ttp-head img { width:16mm; height:16mm; }
.ttp-head .t1 { font-size:1.55em; font-weight:700; line-height:1.2; color:#7a0c1e; } .ttp-head .t1 span { color:#111; }
.ttp-head .t2 { font-size:.95em; color:#333; }
.ttp-badge { border:2px solid #c8102e; color:#c8102e; border-radius:3mm; padding:1.5mm 4mm; font-weight:700; font-size:1.25em; white-space:nowrap; }
.ttp-grid { width:100%; border-collapse:separate; border-spacing:1.1mm; table-layout:fixed; margin:-1mm; width:calc(100% + 2mm); }
.ttp-grid th { background:#7a0c1e; color:#fff; font-weight:600; padding:1.2mm .5mm; border-radius:1.6mm; font-size:.95em; line-height:1.15; }
.ttp-grid th small { display:block; font-weight:400; font-size:.78em; opacity:.9; }
.ttp-grid th.d { width:19mm; } .ttp-grid th.brk, .ttp-grid td.brk { width:7mm; }
.ttp-grid tbody th.d { background:#fbeaec; color:#7a0c1e; font-size:1.05em; }
.ttp-grid tbody th.dd-1 { border-left:2mm solid #f2c400; } .ttp-grid tbody th.dd-2 { border-left:2mm solid #e86fa6; } .ttp-grid tbody th.dd-3 { border-left:2mm solid #3aa655; }
.ttp-grid tbody th.dd-4 { border-left:2mm solid #f08a24; } .ttp-grid tbody th.dd-5 { border-left:2mm solid #2f7fd0; }
.ttp-grid td { height:15.5mm; border-radius:1.6mm; padding:1mm 1.2mm; vertical-align:middle; text-align:center; background:var(--a-bg, #f6f3f4); line-height:1.15; overflow:hidden; }
.ttp-grid td b { display:block; font-size:.98em; font-weight:700; }
.ttp-grid td small { display:block; font-size:.76em; color:#444; } .ttp-grid td small.who { color:#7a0c1e; font-weight:600; }
.ttp-grid td.empty { background:#fff; border:1px dashed #ddd; }
.ttp-grid td.ext { background:repeating-linear-gradient(135deg, #eeeeee 0 2mm, #f8f8f8 2mm 4mm); }
.ttp-grid td.brk { background:#f3eeee; color:#7a0c1e; font-size:.8em; padding:0; }
.ttp-grid td.brk span { writing-mode:vertical-rl; text-orientation:sideways; -webkit-text-orientation:sideways; letter-spacing:0; white-space:nowrap; display:inline-block; }   /* ตัวอักษรไทยต่อกันทั้งคำ (ไม่แยกสระ/วรรณยุกต์) */
.ttp-foot { display:grid; grid-template-columns:1fr 52mm; gap:3mm 4mm; align-items:start; margin-top:auto; }
.ttp-foot.room { grid-template-columns:1fr; }
.ttp-cols { display:grid; grid-template-columns:1fr 1fr; gap:3mm; align-items:start; }
.ttp-sum { width:100%; border-collapse:collapse; font-size:.86em; }
.ttp-sum th, .ttp-sum td { border:1px solid #bbb; padding:.5mm 1.4mm; line-height:1.2; }
.ttp-sum th { background:#7a0c1e; color:#fff; font-weight:600; }
.ttp-sum td.c { text-align:center; } .ttp-sum tr.gen td { background:#f4f4f4; font-style:italic; }
.ttp-sum tfoot td { font-weight:700; background:#fbeaec; }
.ttp-sum td.a-ท, .ttp-sum td.a-ค, .ttp-sum td.a-ว, .ttp-sum td.a-ส, .ttp-sum td.a-พ, .ttp-sum td.a-ศ, .ttp-sum td.a-ง, .ttp-sum td.a-อ, .ttp-sum td.a-ก { background:var(--a-bg); }
.ttp-total { border:2px solid #7a0c1e; border-radius:2.5mm; overflow:hidden; font-size:.95em; }
.ttp-total .h { background:#7a0c1e; color:#fff; font-weight:700; text-align:center; padding:1.2mm; }
.ttp-total .r { display:flex; justify-content:space-between; align-items:baseline; padding:1mm 2.5mm; border-top:1px solid #eee; }
.ttp-total .r b { font-size:1.15em; } .ttp-total .r.all { background:#fbeaec; } .ttp-total .r.all b { font-size:1.5em; color:#7a0c1e; }
.ttp-sign { display:grid; gap:5mm; text-align:center; font-size:.9em; }
.ttp-sign .line { border-bottom:1px dotted #333; height:9mm; margin-bottom:.8mm; }
.ttp-foot .ttp-sign { grid-column:1 / -1; grid-template-columns:repeat(auto-fit, minmax(50mm, 1fr)); gap:2mm 4mm; }
.ttp-sign .sgc { line-height:1.35; } .ttp-sign .sgc-r { min-height:9mm; display:inline-flex; align-items:flex-end; }
.ttp-integ { font-size:.85em; padding:1mm 0; }
.badge.tt-hrs { min-width:9.5em; justify-content:center; text-align:center; }
.ttp-esig { max-width:297mm; margin:0 auto 2mm; display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.ttp, .ttp * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.ttp-grid td { height:15mm; }
.ttp-grid th.brk { font-size:.62em; padding:1mm 0; word-break:break-all; }
.ttp-grid th.sumc, .ttp-grid td.sumc { width:13mm; } .ttp-grid td.sumc { background:#fbeaec; color:#7a0c1e; } .ttp-grid td.sumc b { font-size:1.3em; }
.hr-table select.input { min-width:180px; min-height:38px; padding:6px 8px; }
.hr-table tr.hr-level td { background:var(--surface-2); padding:6px 12px; }
.hr-table tr.hr-empty td:first-child b { color:var(--warn); }

/* ===== ปพ.5 (แบบ LSS) ===== */
.a4.p5 { position:relative; gap:2.4mm; }
.p5-code { position:absolute; top:9mm; right:11mm; border:1.5px solid #333; padding:1.5mm 4mm; font-weight:700; font-size:1.25em; }
.p5-cover-head { text-align:center; display:grid; justify-items:center; gap:.6mm; margin-top:2mm; }
.p5-cover-head img { width:24mm; height:24mm; margin-bottom:1.5mm; }
.p5-cover-head .t1 { font-size:1.75em; font-weight:700; }
.p5-cover-head .t2 { font-size:1.1em; } .p5-cover-head .t3 { font-size:.95em; color:#444; }
.p5-info { display:grid; grid-template-columns:repeat(3, 1fr); gap:1.4mm 4mm; border:1.5px solid #333; border-radius:2mm; padding:2.5mm 4mm; margin-top:2mm; }
.p5-info > div { display:flex; gap:2mm; align-items:baseline; flex-wrap:wrap; } .p5-info .w2 { grid-column:span 2; } .p5-info .w3 { grid-column:1 / -1; }
.p5-info span { color:#555; } .p5-info span.en { color:#777; font-size:.85em; }
.p5-h { font-weight:700; font-size:1.08em; border-left:2mm solid #c8102e; padding-left:2mm; margin-top:1.5mm; }
.p5-dist th, .p5-dist td { text-align:center; }
.p5-kpi { display:grid; grid-template-columns:repeat(4, 1fr); gap:2mm; }
.p5-kpi > div { border:1px solid #999; border-radius:1.5mm; padding:1.2mm 2mm; text-align:center; } .p5-kpi span { display:block; font-size:.85em; color:#555; } .p5-kpi b { font-size:1.2em; }
.p5-sigs { display:grid; grid-template-columns:1fr 1fr; gap:3mm 8mm; margin-top:1mm; } .p5-sigs.one { grid-template-columns:1fr; justify-items:center; } .p5-sigs.two { margin-top:auto; }
.p5-sig { text-align:center; } .p5-sig .note { margin-bottom:1mm; font-size:.92em; } .p5-sig .line { margin-top:5mm; text-align:left; padding-left:8mm; border-bottom:1px dotted #333; height:5mm; }
.p5-sig .nm { margin-top:.8mm; } .p5-sig .rl { font-weight:600; }
.p5-date { text-align:center; margin-top:1mm; }
.p5-mini { display:flex; justify-content:space-between; border-bottom:1.5px solid #333; padding-bottom:1.2mm; font-size:.95em; }
.p5-title { text-align:center; font-weight:700; font-size:1.3em; }
.p5-tbl { font-size:.9em; } .p5-tbl td.nm { white-space:nowrap; } .p5-tbl th.m { font-size:.85em; font-weight:600; line-height:1.15; }
.p5-tbl th.sum, .p5-tbl td.sum { background:#f6efef; }
.p5-note { margin:0; font-size:.82em; color:#444; }
.p5-legend { font-size:.82em; display:grid; gap:.8mm; } .p5-legend span { margin-right:3mm; white-space:nowrap; }
.p5, .p5 * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.a4.p5 > * { flex-shrink:0; }

/* ===== แบนเนอร์สไลด์ + แถบประกาศ (ตกแต่งเว็บไซต์) ===== */
.hero-slider { position:relative; max-width:1920px; margin:0 auto; aspect-ratio:1920/480; overflow:hidden; }
.hero-slider .slide { position:absolute; inset:0; opacity:0; visibility:hidden; transition:opacity .7s var(--ease), visibility .7s; }
.hero-slider .slide.is-active { opacity:1; visibility:visible; }
.hero-slider .slide .hero-banner { height:100%; aspect-ratio:auto; }
.hero-slider picture, .hero-slider img { display:block; width:100%; height:100%; object-fit:cover; }
.slide-text { position:absolute; inset:0; display:flex; align-items:center; color:#fff; }
.slide-text .container { display:flex; flex-direction:column; gap:10px; align-items:flex-start; max-width:var(--container); }
.slide-text.align-center .container { align-items:center; text-align:center; } .slide-text.align-right .container { align-items:flex-end; text-align:right; }
.slide-text.has-overlay { background:linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,0) 75%); }
.slide-text.has-overlay.align-center { background:rgba(0,0,0,.35); } .slide-text.has-overlay.align-right { background:linear-gradient(270deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 75%); }
.slide-title { font-family:var(--font-display); font-size:clamp(1.3rem, 3.2vw, 2.6rem); line-height:1.2; margin:0; text-shadow:0 2px 12px rgba(0,0,0,.35); max-width:780px; color:#fff; }
.slide-sub { margin:0; font-size:clamp(.9rem, 1.3vw, 1.15rem); max-width:640px; text-shadow:0 1px 8px rgba(0,0,0,.4); }
.slide-text:not(.has-overlay) { color:var(--text); } .slide-text:not(.has-overlay) .slide-title { color:var(--text); text-shadow:none; } .slide-text:not(.has-overlay) .slide-sub { text-shadow:none; }
.slider-nav { position:absolute; top:50%; transform:translateY(-50%); width:40px; height:40px; border-radius:50%; border:0; background:rgba(255,255,255,.75); color:#333; display:grid; place-items:center; cursor:pointer; z-index:2; box-shadow:var(--shadow-sm); }
.slider-nav.prev { left:12px; } .slider-nav.next { right:12px; } .slider-nav:hover { background:#fff; }
.slider-dots { position:absolute; bottom:10px; left:0; right:0; display:flex; justify-content:center; gap:8px; z-index:2; }
.slider-dots button { width:10px; height:10px; border-radius:999px; border:0; background:rgba(255,255,255,.65); cursor:pointer; padding:0; transition:width .3s; box-shadow:0 0 0 1px rgba(0,0,0,.15); }
.slider-dots button.is-active { width:26px; background:var(--primary); }
@media (max-width:640px){ .hero-slider { aspect-ratio:16/7; } .slider-nav { display:none; } .slide-sub { display:none; } .slide-text .btn { min-height:36px; padding:6px 14px; font-size:.85rem; } }
@media (prefers-reduced-motion: reduce){ .hero-slider .slide { transition:none; } }
.announce-bar { font-size:.9rem; padding:8px 0; } .announce-bar .container { display:flex; gap:8px; align-items:center; justify-content:center; flex-wrap:wrap; text-align:center; }
.announce-bar a { color:inherit; font-weight:700; text-decoration:underline; display:inline-flex; align-items:center; gap:2px; }
.announce-bar.is-primary { background:var(--primary); color:var(--primary-ink); } .announce-bar.is-info { background:var(--info-soft); color:var(--info); }
.announce-bar.is-warn { background:var(--warn-soft); color:#8a5a00; } .announce-bar.is-dark { background:var(--navy-900); color:#fff; }
/* หน้าตกแต่งเว็บไซต์ */
.site-tabs { margin-bottom:16px; flex-wrap:wrap; }
.preset-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:10px; }
.preset { position:relative; border:2px solid var(--line); border-radius:var(--radius); padding:10px; cursor:pointer; background:var(--surface); display:flex; flex-direction:column; gap:8px; }
.preset input { position:absolute; opacity:0; } .preset:has(input:checked) { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.preset .sw { display:flex; height:28px; border-radius:8px; overflow:hidden; } .preset .sw i { flex:1; }
.theme-preview { border:1px solid var(--line); border-radius:var(--radius-lg); overflow:hidden; background:var(--pv-bg, var(--bg)); }
.theme-preview .pv-head { display:flex; align-items:center; gap:10px; padding:10px 14px; background:var(--surface); border-bottom:1px solid var(--line); }
.theme-preview .pv-hero { padding:22px 16px; background:linear-gradient(180deg, var(--pv-tint, var(--primary-soft)), transparent); }
.theme-preview .pv-title { font-family:var(--pv-font, var(--font-display)); font-size:1.35rem; font-weight:700; margin:0 0 6px; }
.theme-preview .pv-btn { display:inline-block; padding:8px 16px; border-radius:var(--pv-r, 999px); background:var(--pv-p, var(--primary)); color:#fff; font-weight:600; margin-right:6px; }
.theme-preview .pv-btn.o { background:transparent; color:var(--pv-a, var(--accent)); border:2px solid var(--pv-a, var(--accent)); }
.theme-preview .pv-cards { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; padding:14px 16px 18px; }
.theme-preview .pv-card { background:var(--surface); border:1px solid var(--line); border-radius:var(--pv-rc, 16px); padding:10px; font-size:.82rem; }
.theme-preview .pv-chip { width:30px; height:30px; border-radius:10px; background:var(--pv-soft, var(--primary-soft)); margin-bottom:6px; }
.banner-list .bn { display:grid; grid-template-columns:200px 1fr auto; gap:14px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.banner-list .bn img { width:200px; aspect-ratio:4/1; object-fit:cover; border-radius:10px; background:var(--surface-2); }
.banner-list .bn.off { opacity:.55; }
@media (max-width:720px){ .banner-list .bn { grid-template-columns:1fr; } .banner-list .bn img { width:100%; } }
.sec-order li { display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; margin-bottom:8px; background:var(--surface); }

/* ===== ย่อเมนูด้านข้าง (เฉพาะจอกว้าง) — จำค่าไว้ในเครื่อง ===== */
.sb-toggle { display:none; }
@media (min-width:1024px){
  .sb-toggle { display:inline-grid; }
  .app-shell { transition:grid-template-columns .2s var(--ease); }
  html.sb-mini .app-shell { grid-template-columns:76px 1fr; }
  html.sb-mini .sidebar { padding:14px 10px; overflow-x:hidden; }
  html.sb-mini .sidebar .brand span, html.sb-mini .side-group, html.sb-mini .side-link .sl, html.sb-mini .term-box { display:none; }
  html.sb-mini .sidebar .brand { justify-content:center; padding:4px 0 12px; }
  html.sb-mini .side-link { justify-content:center; padding:9px 0; position:relative; }
  html.sb-mini .side-link .badge { position:absolute; top:2px; right:4px; margin:0; padding:1px 5px; font-size:.65rem; min-width:0; }
  html.sb-mini .side-group + .side-link, html.sb-mini .side-link + .side-group { margin-top:6px; }
  html.sb-mini .side-foot { padding-top:10px; border-top:1px solid var(--line); }
}
/* ประเมินผ่าน/ไม่ผ่าน */
.pf-seg { display:inline-flex; } .pf-seg label { padding:6px 12px; border-radius:999px; cursor:pointer; font-weight:600; font-size:.85rem; color:var(--text-2); }
.pf-seg input { position:absolute; opacity:0; pointer-events:none; }
.pf-seg label.is-active.pf-p { background:var(--ok-soft); color:var(--ok); } .pf-seg label.is-active.pf-f { background:var(--bad-soft); color:var(--bad); }
.pf-seg label.is-active.pf-n { background:var(--surface); box-shadow:var(--shadow-sm); }
.pf-seg label:focus-within { outline:2px solid var(--primary); outline-offset:1px; }
.tt-teacher { width:auto; max-width:230px; min-height:36px; padding:5px 8px; font-size:.82rem; }
.a4.pp6 .pp6-sign { grid-template-columns:repeat(3,1fr); gap:6mm; }
.a4.pp6 { position:relative; }
/* ปพ.6 เต็มแผ่น A4: ตารางผลการเรียนและช่องความคิดเห็นยืดเต็มพื้นที่ที่เหลือ */
.a4.pp6 > * { flex-shrink:0; }
.a4.pp6 > .pp6-grow { flex:3 0 auto; display:block; }
.a4.pp6 .pp6-grow > .pp6-table { height:100%; }
.a4.pp6 > .pp6-comments { flex:1 0 auto; }
.pp6-draft { position:absolute; inset:0; display:grid; place-items:center; pointer-events:none; font-size:64pt; font-weight:800; color:rgba(200,16,46,.08); letter-spacing:4px; overflow:hidden; }
.pp6-draft span { transform:rotate(-28deg); white-space:nowrap; }
.a4.pp6 .pp6-info > div, .a4.pp6 .pp6-grades th { white-space:nowrap; }
.att-tbl .att-home { font-size:.72em; font-weight:400; color:#555; line-height:1.1; white-space:normal; }
/* ชื่อผู้ลงนาม: 1 บรรทัดเสมอ (ย่ออัตโนมัติถ้ายาว — app.js fitNames) */
.sig-nm { display:block; white-space:nowrap; overflow:hidden; }
/* ชื่ออยู่ 1 บรรทัดเสมอ (ย่อตัวอักษรด้วย app.js เมื่อยาวเกินช่อง) */
.nm1 { display:inline-block; max-width:100%; white-space:nowrap; overflow:hidden; vertical-align:bottom; }
td:has(> .nm1), th:has(> .nm1) { white-space:nowrap; }
/* โลโก้โรงเรียน + โลโก้โปรแกรมพิเศษ IEP (หัวเว็บ · หัวรายงาน) */
.brand .brand-school { margin-right:-2px; }
.topbar .brand-mini .brand-school { margin-right:-2px; }
.logo-pair { display:inline-flex; gap:10px; justify-content:center; }
.pp6-head { grid-template-columns:32mm 1fr 32mm; gap:3mm; }
.pp6-head .hd-logos img { width:15mm; height:15mm; }
.pp6-head .t1 { white-space:nowrap; font-size:1.32em; }
.pp6-head .hd-logos, .ttp-head .hd-logos { display:flex; gap:2.5mm; align-items:center; }
.pp6-head .code { justify-self:end; width:17mm; text-align:center; }
.ttp-head { grid-template-columns:auto 1fr auto; }
.p5-logos { display:flex; gap:5mm; justify-content:center; }
@media (max-width:420px){ .site-header .brand .brand-school { display:none; } }
.logo-pair .logo { margin:0 0 12px; }
.print-note { max-width:210mm; margin:0 auto 12px; padding:8px 12px; border-radius:10px; background:var(--warn-soft, #fff4d6); font-size:.85rem; }
@media print { .print-note { display:none !important; } }
/* ===== แอปที่ติดตั้งบนมือถือ (standalone): หน้าเข้าสู่ระบบไม่แสดงเมนูเว็บไซต์ ===== */
@media (display-mode: standalone) {
  body.page-auth .site-header nav, body.page-auth .site-header .header-actions .btn-login, body.page-auth .site-header .nav-toggle, body.page-auth .site-footer, body.page-auth .announce-bar, body.page-auth .bottom-nav { display:none !important; }
  body.page-auth .site-header .brand { pointer-events:none; }
  body.page-auth .site-header { position:static; box-shadow:none; background:transparent; }
}
/* ===== ข่าวสารในแอป: ฟีดแนวตั้งแบบมือถือ ===== */
.news-chips { flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.news-chips::-webkit-scrollbar { display:none; }
.news-chips .chip { flex:0 0 auto; }
.news-feed { display:grid; gap:12px; grid-template-columns:repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.nf-item { display:flex; gap:12px; padding:10px; text-decoration:none !important; color:var(--text); align-items:stretch; }
.nf-item:active { transform:scale(.99); }
.nf-img { flex:0 0 108px; height:96px; border-radius:12px; overflow:hidden; background:var(--bg-soft); display:grid; place-items:center; color:var(--text-2); }
.nf-img img { width:100%; height:100%; object-fit:cover; display:block; }
.nf-body { display:flex; flex-direction:column; gap:4px; min-width:0; flex:1; }
.nf-meta { display:flex; gap:4px; flex-wrap:wrap; }
.nf-meta .badge { font-size:.68rem; }
.nf-title { font-size:.98rem; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.nf-ex { font-size:.82rem; color:var(--text-2); line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.nf-date { margin-top:auto; font-size:.74rem; color:var(--text-2); display:flex; align-items:center; gap:4px; }
.nf-date .icon { width:13px; height:13px; }
.nf-hero { flex-direction:column; grid-column:1 / -1; padding:0; overflow:hidden; }
.nf-hero .nf-img { flex:none; width:100%; height:auto; aspect-ratio:16/9; border-radius:0; }
.nf-hero .nf-body { padding:4px 14px 14px; }
.nf-hero .nf-title { font-size:1.12rem; }
@media (min-width:900px) { .nf-hero { flex-direction:row; } .nf-hero .nf-img { width:48%; aspect-ratio:auto; min-height:220px; } .nf-hero .nf-body { padding:16px; } }
.app-article .article { max-width:820px; margin:0 auto; }
@media (max-width:640px) { .app-article .article h1 { font-size:1.35rem; } .app-article .article .cover { margin-left:-16px; margin-right:-16px; border-radius:0; } }
/* ===== ปฏิทินโรงเรียน ===== */
.cal-months { display:grid; gap:14px; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); }
.cal-month { border:1px solid var(--line); border-radius:12px; padding:10px; }
.cal-month.is-focus { border-color:var(--primary); box-shadow:0 0 0 2px var(--primary-soft); }
.cal-grid { display:grid; grid-template-columns:repeat(7, 1fr); gap:3px; margin-top:6px; text-align:center; font-size:.78rem; }
.cal-grid span { padding:4px 0; border-radius:6px; position:relative; }
.cal-grid .cal-h { color:var(--text-2); font-weight:600; font-size:.7rem; }
.cl-school { background:var(--bg-soft); }
.cl-closed { background:var(--bad-soft); color:var(--bad); font-weight:700; }
.cl-makeup { background:var(--ok-soft); color:var(--ok); font-weight:700; }
.cl-weekend { color:var(--text-2); opacity:.55; }
.cl-break { color:var(--text-2); opacity:.35; text-decoration:line-through; }
.cal-grid .is-today { outline:2px solid var(--primary); }
.cal-grid .has-dot::after, .cal-legend .cl-dot::before { content:""; position:absolute; bottom:2px; left:50%; width:4px; height:4px; margin-left:-2px; border-radius:50%; background:var(--primary); }
.cal-legend { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.cal-legend span { padding:2px 8px; border-radius:6px; position:relative; }
.cal-legend .cl-dot { padding-left:14px; } .cal-legend .cl-dot::before { left:6px; top:50%; bottom:auto; margin-top:-2px; }
.att-datebar { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.field[hidden] { display:none !important; }
.room-link { display:inline-flex; align-items:center; gap:2px; color:inherit; text-decoration:none !important; }
.room-link .icon { width:14px; height:14px; color:var(--text-2); }
.room-link:hover b, .room-link.is-active b { color:var(--primary); text-decoration:underline; }

/* ===================== คู่มือฉบับเล่ม (help/book) — A4 · ปก · สารบัญ · บท · ภาพหน้าจอ ===================== */
.bk-flip { transform:rotate(180deg); }
.bk-stage { --tone:#1d3f72; --ink:#1d2433; --soft:#6b7280; --line:#e6e1e3; --mark:#e11d48;
  background:#e9e4e6; padding:24px 12px 60px; min-height:100vh; color:var(--ink); font-family:var(--font-body); }
.bk-stage img { display:block; }
.bk-sheet, .bk-cover { width:210mm; max-width:100%; margin:0 auto 24px; background:#fff; box-shadow:0 6px 28px rgba(0,0,0,.12); box-sizing:border-box; }
.bk-sheet { padding:16mm 15mm 18mm; font-size:10.5pt; line-height:1.6; }
/* ปก */
.bk-cover { position:relative; height:297mm; overflow:hidden; padding:16mm 15mm 14mm; display:flex; flex-direction:column; gap:8mm;
  background:radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, var(--tone) 22%, #fff) 0%, transparent 60%),
             radial-gradient(90% 50% at 0% 100%, color-mix(in srgb, var(--primary, #e0613f) 18%, #fff) 0%, transparent 60%), #fffdfb; }
.bk-cover::before { content:""; position:absolute; inset:auto -30mm -40mm auto; width:150mm; height:150mm; border-radius:50%; background:color-mix(in srgb, var(--tone) 10%, transparent); }
.bk-cover::after { content:""; position:absolute; left:0; top:0; bottom:0; width:7mm; background:linear-gradient(var(--tone), color-mix(in srgb, var(--tone) 55%, var(--primary, #e0613f))); }
.bk-cv-top { display:flex; align-items:center; gap:4mm; position:relative; z-index:1; }
.bk-logos { display:flex; gap:3mm; }
.bk-logos img { width:18mm; height:18mm; object-fit:contain; }
.bk-cv-top b { display:block; font:600 13pt/1.3 var(--font-display); color:var(--tone); }
.bk-cv-top span { font-size:10pt; color:var(--soft); }
.bk-cv-title { position:relative; z-index:1; margin-top:6mm; }
.bk-kicker { display:inline-flex; align-items:center; gap:2mm; padding:1.6mm 4mm; border-radius:99px; background:var(--tone); color:#fff; font-weight:600; font-size:10.5pt; }
.bk-kicker .icon { width:4.5mm; height:4.5mm; }
.bk-cv-title h1 { font:700 32pt/1.2 var(--font-display); color:var(--ink); margin:5mm 0 3mm; letter-spacing:-.01em; }
.bk-cv-title p { font-size:12pt; color:var(--soft); margin:0; max-width:160mm; }
.bk-cv-art { position:relative; z-index:1; flex:1; min-height:0; display:flex; align-items:flex-end; justify-content:center; padding-bottom:4mm; }
.bk-laptop { width:166mm; position:relative; margin-right:14mm; }
.bk-laptop .bk-browser { border-radius:3mm 3mm 0 0; border:2.2mm solid #2a2f3a; border-bottom:0; box-shadow:0 10mm 20mm -8mm rgba(0,0,0,.35); }
.bk-laptop .bk-bar { display:none; }
.bk-base { display:block; height:5mm; margin:0 -12mm; background:linear-gradient(#cfd3da, #9aa0aa); border-radius:0 0 6mm 6mm; }
.bk-cv-art .bk-phone { width:50mm; position:absolute; right:0; bottom:0; }
.bk-cv-art.is-phones { gap:8mm; align-items:center; }
.bk-cv-art.is-phones .bk-phone { position:relative; right:auto; bottom:auto; width:66mm; }
.bk-cv-art.is-phones .bk-phone:nth-child(2) { transform:translateY(10mm) rotate(3deg); }
.bk-cv-art.is-phones .bk-phone:first-child { transform:rotate(-3deg); }
.bk-cv-foot { position:relative; z-index:1; display:flex; justify-content:space-between; align-items:flex-end; border-top:.4mm solid color-mix(in srgb, var(--tone) 30%, transparent); padding-top:4mm; }
.bk-cv-foot b { display:block; font:600 13pt/1.3 var(--font-display); color:var(--tone); }
.bk-cv-foot span { font-size:9.5pt; color:var(--soft); }
.bk-url { display:flex; align-items:center; gap:2mm; font-weight:700; color:var(--tone); font-size:12pt; }
/* กรอบอุปกรณ์ */
.bk-browser { background:#fff; border:1px solid #d9d4d6; border-radius:2.4mm; overflow:hidden; box-shadow:0 2mm 6mm rgba(0,0,0,.08); }
.bk-browser img { width:100%; height:auto; }
.bk-bar { display:flex; align-items:center; gap:1.4mm; padding:1.6mm 2.4mm; background:#f3f0f1; border-bottom:1px solid #e3dee0; }
.bk-bar i { width:2.2mm; height:2.2mm; border-radius:50%; background:#f1695d; }
.bk-bar i:nth-child(2) { background:#f6bd3b; } .bk-bar i:nth-child(3) { background:#5ac35a; }
.bk-bar span { margin-left:2mm; flex:1; background:#fff; border-radius:99px; padding:.4mm 3mm; font-size:7.5pt; color:#6b7280; }
.bk-phone { position:relative; background:#1f2430; border-radius:7mm; padding:2.2mm; box-shadow:0 3mm 10mm rgba(0,0,0,.22); }
.bk-phone img { width:100%; height:auto; border-radius:5mm; }
.bk-notch { position:absolute; top:3.4mm; left:50%; transform:translateX(-50%); width:14mm; height:2.6mm; border-radius:2mm; background:#1f2430; z-index:2; }
.bk-paper { background:#fff; box-shadow:0 1mm 5mm rgba(0,0,0,.18); border:1px solid #e5e5e5; }
.bk-paper img { width:100%; height:auto; }
/* สารบัญ */
.bk-h { font:700 17pt/1.3 var(--font-display); color:var(--tone); margin:0 0 4mm; display:flex; align-items:center; gap:3mm; }
.bk-h::after { content:""; flex:1; height:.4mm; background:linear-gradient(90deg, color-mix(in srgb, var(--tone) 35%, transparent), transparent); }
.bk-h.mt { margin-top:9mm; }
.bk-how { display:grid; grid-template-columns:1fr 1fr; gap:3mm 6mm; margin-top:4mm; }
.bk-how-item { display:flex; gap:3mm; align-items:flex-start; padding:3mm; border-radius:3mm; background:#faf7f8; }
.bk-how-item b { display:block; font-size:10.5pt; }
.bk-how-item p { margin:.5mm 0 0; font-size:9.5pt; color:var(--soft); line-height:1.5; }
.bk-dot, .bk-marks li::before { flex:none; width:6.4mm; height:6.4mm; border-radius:50%; background:var(--mark); color:#fff; font:700 9.5pt/6.4mm system-ui; text-align:center; box-shadow:0 .6mm 1.4mm rgba(225,29,72,.35); }
.bk-ico { flex:none; width:6.4mm; height:6.4mm; border-radius:2mm; display:grid; place-items:center; background:color-mix(in srgb, var(--tone) 12%, #fff); color:var(--tone); }
.bk-ico .icon { width:4mm; height:4mm; }
.bk-toc { list-style:none; padding:0; margin:0; columns:2; column-gap:8mm; }
.bk-toc > li { break-inside:avoid; margin-bottom:4mm; }
.bk-toc-ch { display:flex; align-items:center; gap:2.5mm; padding-bottom:1.2mm; border-bottom:.3mm solid var(--line); margin-bottom:1.2mm; }
.bk-toc-ch b { font-size:11pt; }
.bk-toc-no { width:7mm; height:7mm; border-radius:2mm; background:var(--tone); color:#fff; display:grid; place-items:center; font-weight:700; font-size:10pt; flex:none; }
.bk-toc ol { list-style:none; padding:0; margin:0; }
.bk-toc ol li { font-size:9.5pt; color:#374151; padding:.5mm 0 .5mm 9.5mm; text-indent:-9.5mm; line-height:1.45; }
.bk-toc ol li span { display:inline-block; width:9.5mm; text-indent:0; color:var(--tone); font-weight:600; }
/* บท */
.bk-ch-head { display:flex; align-items:center; gap:5mm; margin:-16mm -15mm 8mm; padding:12mm 15mm 9mm; color:#fff;
  background:linear-gradient(120deg, var(--tone), color-mix(in srgb, var(--tone) 70%, var(--primary, #e0613f))); position:relative; overflow:hidden; }
.bk-ch-head::after { content:""; position:absolute; right:-18mm; top:-22mm; width:70mm; height:70mm; border-radius:50%; background:rgba(255,255,255,.08); }
.bk-ch-no { flex:none; width:20mm; height:20mm; border-radius:5mm; background:rgba(255,255,255,.16); display:grid; place-content:center; text-align:center; font:700 22pt/1 var(--font-display); }
.bk-ch-no small { display:block; font:500 8pt/1.2 var(--font-body); opacity:.85; margin-bottom:1mm; }
.bk-ch-head h2 { color:#fff; font:700 19pt/1.25 var(--font-display); margin:0 0 1.5mm; }
.bk-ch-head p { margin:0; opacity:.92; font-size:10pt; line-height:1.5; }
.bk-ch-ico { margin-left:auto; flex:none; opacity:.28; position:relative; z-index:1; } .bk-ch-ico .icon { width:18mm; height:18mm; }
.bk-sec { margin-bottom:8mm; }
.bk-sec h3 { display:flex; align-items:baseline; gap:3mm; font:700 13pt/1.35 var(--font-display); color:var(--ink); margin:0 0 3mm; padding-bottom:1.6mm; border-bottom:.35mm solid color-mix(in srgb, var(--tone) 25%, transparent); break-after:avoid; }
.bk-sec h3 span { color:var(--tone); font-size:11.5pt; min-width:9mm; }
.bk-steps { counter-reset:st; list-style:none; padding:0; margin:0 0 4mm; }
.bk-steps li { counter-increment:st; position:relative; padding:0 0 0 9mm; margin-bottom:2.2mm; }
.bk-steps li::before { content:counter(st); position:absolute; left:0; top:.4mm; width:6mm; height:6mm; border-radius:50%; border:.4mm solid var(--tone); color:var(--tone); font:700 8.5pt/5.4mm system-ui; text-align:center; box-sizing:border-box; }
.bk-steps strong { color:var(--tone); }
.bk-steps code { font-size:.9em; background:#f3f0f1; padding:0 1mm; border-radius:1mm; }
.bk-fig { margin:3mm 0 6mm; break-inside:avoid; }
.bk-fig figcaption { margin-top:2.4mm; font-size:9pt; color:var(--soft); text-align:center; }
.bk-fig figcaption b { color:var(--ink); margin-right:1mm; }
.bk-fig.is-paper .bk-paper { width:62%; margin:0 auto; }
.bk-fig.is-paper img { max-height:185mm; object-fit:contain; }
.bk-marks { list-style:none; counter-reset:mk; padding:2.6mm 3mm; margin:2.4mm 0 0; background:#fdf6f7; border:.3mm solid #f6d4da; border-radius:2.4mm; display:grid; grid-template-columns:1fr 1fr; gap:1.6mm 5mm; font-size:9pt; line-height:1.45; }
.bk-marks li { counter-increment:mk; display:flex; gap:2mm; align-items:flex-start; }
.bk-marks li::before { content:counter(mk); width:5mm; height:5mm; font-size:8pt; line-height:5mm; }
.bk-phones { display:flex; gap:7mm; justify-content:center; align-items:flex-start; margin:3mm 0 6mm; break-inside:avoid; }
.bk-phones .bk-fig { margin:0; width:46mm; }
.bk-phones.n1 .bk-fig { width:auto; display:grid; grid-template-columns:48mm 1fr; gap:3mm 7mm; align-items:start; }
.bk-phones.n1 .bk-fig .bk-phone { grid-row:span 2; }
.bk-phones.n1 .bk-fig figcaption { text-align:left; margin-top:0; }
.bk-phones.n1 .bk-marks { grid-template-columns:1fr; margin:0; align-self:start; }
.bk-phones .bk-fig:not(:only-child) .bk-marks { grid-template-columns:1fr; }
.bk-phones .bk-fig:not(:only-child) .bk-phone img { max-height:none; }
.bk-tips { background:color-mix(in srgb, var(--tone) 7%, #fff); border-left:1.2mm solid var(--tone); border-radius:0 2.4mm 2.4mm 0; padding:2.6mm 4mm; margin-top:2mm; break-inside:avoid; }
.bk-tips p { display:flex; gap:2mm; margin:0 0 1mm; font-size:9.5pt; line-height:1.5; } .bk-tips p:last-child { margin:0; }
.bk-tips .icon { flex:none; width:4mm; height:4mm; margin-top:.8mm; color:var(--tone); }
/* ปกหลัง */
.bk-back { min-height:297mm; display:grid; place-items:center; text-align:center; background:linear-gradient(160deg, #fff, color-mix(in srgb, var(--tone) 8%, #fff)); }
.bk-back-in { max-width:120mm; display:grid; justify-items:center; gap:4mm; }
.bk-back h2 { font:700 18pt/1.3 var(--font-display); color:var(--tone); margin:2mm 0 0; }
.bk-back p { margin:0; color:var(--soft); }
.bk-qr { display:flex; align-items:center; gap:5mm; text-align:left; padding:4mm 6mm; border-radius:4mm; background:#fff; box-shadow:0 2mm 8mm rgba(0,0,0,.08); font-weight:700; color:var(--tone); }
.bk-qr small { font-weight:400; color:var(--soft); }
@media screen and (max-width: 820px) {
  .bk-sheet { padding:16px; font-size:15px; } .bk-ch-head { margin:-16px -16px 18px; padding:20px 16px; }
  .bk-cover { height:auto; min-height:120vw; } .bk-how, .bk-marks { grid-template-columns:1fr; } .bk-toc { columns:1; }
  .bk-phones { flex-wrap:wrap; } .bk-phones.n1 .bk-fig { grid-template-columns:1fr; } .bk-fig.is-paper .bk-paper { width:100%; }
  .bk-cv-art .bk-phone { width:28%; } .bk-laptop { width:88%; }
}
@page bk { size:A4 portrait; margin:14mm 0 16mm; @bottom-center { content:counter(page); font:9pt system-ui; color:#9ca3af; } }
@page bkcover { size:A4 portrait; margin:0; }
@media print {
  .bk-stage { padding:0; background:#fff; min-height:0; }
  .bk-cover { page:bkcover; margin:0; box-shadow:none; height:297mm; break-after:page; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .bk-sheet { page:bk; width:auto; margin:0; box-shadow:none; padding:0 15mm; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .bk-ch, .bk-front { break-before:page; }
  .bk-ch-head { margin:0 -15mm 7mm; padding:9mm 15mm; }
  .bk-back { page:bkcover; break-before:page; min-height:0; height:297mm; padding:0; }
}
/* ภาพหน้าจอในหน้าคู่มือออนไลน์ */
.help-figs { --tone:#1d3f72; --mark:#e11d48; --soft:var(--muted, #6b7280); --ink:var(--text); margin:14px 0 4px; }
.help-figs .bk-fig { margin:10px 0 18px; }
.help-figs .bk-fig.is-desk { max-width:860px; }
.help-figs .bk-fig.is-paper .bk-paper { width:min(100%, 420px); }
.help-figs .bk-phones { justify-content:flex-start; }
.help-figs .bk-phones .bk-fig { width:min(46%, 230px); }
.help-figs .bk-phones.n1 .bk-fig { width:auto; grid-template-columns:min(46vw, 230px) 1fr; }
.help-figs .bk-marks { background:var(--surface-2, #fdf6f7); border-color:var(--line); }
.help-figs figcaption { text-align:left; }
@media (max-width: 640px) { .help-figs .bk-marks { grid-template-columns:1fr; } .help-figs .bk-phones.n1 .bk-fig { grid-template-columns:1fr; } .help-figs .bk-phones.n1 .bk-phone { max-width:240px; } }
.help-books { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap:14px; margin-bottom:22px; }
.help-book { display:flex; gap:14px; align-items:center; padding:16px; border-radius:var(--radius, 16px); color:#fff !important; text-decoration:none !important;
  background:linear-gradient(130deg, var(--tone), color-mix(in srgb, var(--tone) 65%, var(--primary))); box-shadow:0 6px 18px color-mix(in srgb, var(--tone) 25%, transparent); transition:transform .15s; }
.help-book:hover { transform:translateY(-2px); }
.help-book .bkc { flex:none; width:52px; height:68px; border-radius:4px 8px 8px 4px; background:rgba(255,255,255,.18); display:grid; place-items:center; box-shadow:inset 4px 0 0 rgba(255,255,255,.35); }
.help-book .bkc .icon { width:24px; height:24px; }
.help-book b { display:block; font-family:var(--font-display); font-size:1.02rem; line-height:1.35; }
.help-book small { display:block; opacity:.88; font-size:.8rem; line-height:1.45; margin-top:2px; }
.help-book .go { margin-left:auto; flex:none; display:flex; align-items:center; gap:4px; font-size:.8rem; font-weight:600; background:rgba(255,255,255,.2); padding:6px 10px; border-radius:99px; }
.h-sec { display:flex; align-items:center; gap:8px; font-size:1.1rem; margin:6px 0 6px; } .h-sec .icon { color:var(--primary); }
/* ตั้งค่าการแสดงโลโก้ที่หน้าเว็บ (ตั้งค่าระบบ) — เอกสารพิมพ์ไม่เกี่ยว */
.no-logo-school .brand-school, .no-logo-iep .brand-iep { display:none !important; }
.logo-toggle { display:flex; align-items:center; gap:10px; margin-top:10px; padding:10px 12px; border-radius:12px; background:var(--surface-2); }
.logo-toggle input { width:20px; height:20px; accent-color:var(--primary); }
/* รายวิชาที่สอน — จัดกลุ่มตามห้อง (แถวกะทัดรัด) */
.crs-room { padding:0; overflow:hidden; }
.crs-head { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:16px 18px; border-bottom:1px solid var(--line); background:var(--surface-2); }
.crs-head h2 { margin:0; font-size:1.15rem; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.crs-sum { display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-top:4px; }
.crs-type { padding:10px 18px 4px; font-weight:700; color:var(--text-2); letter-spacing:.02em; }
.crs-row { display:grid; grid-template-columns:minmax(0,1fr) 150px 150px auto; gap:12px; align-items:center; padding:10px 18px; border-top:1px solid var(--line); border-left:4px solid transparent; }
.crs-row:hover { background:var(--surface-2); }
.crs-row.st-approved { border-left-color:var(--ok, #2f9e5b); } .crs-row.st-submitted { border-left-color:var(--warn, #e0a100); } .crs-row.st-returned { border-left-color:var(--bad, #d64545); }
.crs-main { display:flex; flex-direction:column; min-width:0; color:inherit; text-decoration:none !important; }
.crs-main b { font-size:.98rem; line-height:1.35; }
.crs-prog { display:flex; align-items:center; gap:8px; } .crs-prog .progress { flex:1; }
.crs-st { display:flex; gap:4px; justify-content:flex-end; flex-wrap:wrap; }
.crs-act { display:flex; gap:4px; justify-content:flex-end; }
@media (max-width: 900px) {
  .crs-row { grid-template-columns:minmax(0,1fr) auto; gap:6px 10px; }
  .crs-prog { grid-column:1; } .crs-st { grid-column:2; grid-row:1; } .crs-act { grid-column:2; grid-row:2; }
  .crs-tools { width:100%; }
}
@media (max-width: 640px) {
  .crs-row { grid-template-columns:minmax(0,1fr) auto; padding:12px 14px; }
  .crs-main { grid-column:1 / -1; grid-row:1; }
  .crs-prog { grid-column:1; grid-row:2; } .crs-st { grid-column:2; grid-row:2; }
  .crs-act { grid-column:1 / -1; grid-row:3; justify-content:flex-start; }
  .crs-head { padding:14px; } .crs-type { padding:10px 14px 4px; }
}
/* ช่องค้าง “ร” (ขาดสอบ/ขาดส่งงาน) — ช่องดำ */
.score-grid input.pending { background:#000 !important; color:#fff !important; border:2px solid #000 !important; font-weight:800; font-size:1.05rem; }
:root[data-theme="dark"] .score-grid input.pending { border-color:#9aa3b2 !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .score-grid input.pending { border-color:#9aa3b2 !important; } }
.score-grid input.pending:focus { box-shadow:0 0 0 3px rgba(31,36,48,.35); }
.pend-chip { display:inline-block; min-width:20px; padding:0 6px; border-radius:5px; background:#1f2430; color:#fff; font-weight:700; text-align:center; }
.grade-pill[data-g="ร"] { background:#1f2430; color:#fff; }
/* รูปนักเรียน: กดดูรูปใหญ่ */
.stu-photo.is-zoomable { cursor:zoom-in; }
.stu-photo.is-zoomable:hover { box-shadow:0 0 0 2px var(--primary); }
.photo-zoom { border:0; padding:0; background:transparent; max-width:min(92vw, 520px); width:100%; overflow:visible; }
.photo-zoom::backdrop { background:rgba(10,12,18,.78); backdrop-filter:blur(2px); }
.photo-zoom figure { margin:0; background:var(--surface); border-radius:18px; overflow:hidden; box-shadow:0 20px 60px rgba(0,0,0,.45); }
.photo-zoom img { display:block; width:100%; height:auto; max-height:76vh; object-fit:contain; background:#000; cursor:zoom-out; }
.photo-zoom figcaption { padding:12px 16px; font-weight:700; text-align:center; color:var(--text); }
.photo-zoom .pz-close { position:absolute; top:-14px; right:-14px; background:var(--surface); box-shadow:0 4px 14px rgba(0,0,0,.3); width:40px; height:40px; min-height:40px; border-radius:50%; }
.score-grid td.sticky .stu-cell { display:flex; align-items:center; gap:8px; }
.pp6-contact { white-space:nowrap; font-size:inherit; font-weight:700; }
/* ===== จอแคบ: เมนูด้านซ้ายแบบลิ้นชัก (ปุ่ม ☰ มุมซ้ายบน) ===== */
.sb-scrim { display:none; }
@media (max-width:1023.98px) {
  .sb-toggle { display:inline-grid; }
  .sidebar { display:flex; position:fixed; left:0; top:0; bottom:0; height:auto; width:min(300px, 84vw); z-index:95; transform:translateX(-105%); transition:transform .28s var(--ease); box-shadow:none; padding-top:calc(18px + env(safe-area-inset-top)); padding-bottom:calc(18px + env(safe-area-inset-bottom)); }
  html.sb-open .sidebar { transform:none; box-shadow:0 0 40px rgba(0,0,0,.25); }
  html.sb-open .sb-scrim { display:block; position:fixed; inset:0; z-index:94; background:rgba(20,12,16,.45); }
  html.sb-open body { overflow:hidden; }
  html.sb-mini .sidebar .brand span, html.sb-mini .side-group, html.sb-mini .side-link .sl, html.sb-mini .term-box { display:revert; }
  .topbar .sb-toggle { margin-right:-4px; }
}
/* สรุปรายวัน (ภาพรวมการมาเรียน) */
.att-daily td, .att-daily th { padding:6px 10px; }
.att-daily tr.att-off td { background:var(--surface-2); color:var(--text-3); }
.att-daily tr.att-today td { background:var(--ok-soft); }
.att-daily tr.att-today td:first-child { box-shadow:inset 3px 0 0 var(--ok); }
/* ตารางรายห้อง (การมาเรียนวันนี้) — พอดีความกว้าง ไม่ล้นขอบ */
.table-wrap .table.att-rooms, .table-wrap .table.att-daily { min-width:0; }
.att-rooms th, .att-rooms td { padding:10px 8px; }
.att-rooms td:first-child { white-space:nowrap; }
.att-rooms .badge { white-space:nowrap; }
@media (min-width:641px) and (max-width:900px){ .att-daily th, .att-daily td { padding:6px 5px; font-size:.82rem; } }
.table-wrap .table.att-matrix { min-width:0; }
.att-matrix td, .att-matrix th { padding:8px 6px; }
/* ปพ.6 แบบระบบเดิม (Pp6Sheet) */
.p6s { font-size:var(--fs); gap:2.5mm; }
.p6s-head { display:flex; align-items:center; justify-content:center; gap:4mm; text-align:center; line-height:1.35; }
.p6s-head img { width:16mm; height:16mm; object-fit:contain; }
.p6s-head .t1 { font-weight:700; font-size:1.2em; }
.p6s-head .muted { color:#444; }
.p6s-who { display:flex; flex-wrap:wrap; gap:1mm 7mm; }
.p6s-tbl { width:100%; border-collapse:collapse; }
.p6s-tbl th, .p6s-tbl td { border:1px solid #555; padding:.6mm 1.6mm; text-align:center; line-height:1.25; }
.p6s-tbl th { background:#f2f2f2; font-weight:600; }
.p6s-tbl .l { text-align:left; }
.p6s-tbl .b { font-weight:700; }
.p6s-tbl td.grp { background:#f7f7f7; }
.p6s-foot { display:grid; grid-template-columns:3fr 2fr; gap:6mm; align-items:end; margin-top:auto; }
.p6s-sign { display:flex; flex-direction:column; gap:6mm; text-align:center; font-size:.95em; }
/* ปพ.5 ทั้งเล่ม (Pp5Book) */
.p5b { font-size:var(--fs); gap:2mm; }
.p5b-title { display:flex; flex-direction:column; align-items:center; text-align:center; line-height:1.35; }
.p5b-title b { font-size:1.15em; }
.p5b-title span { color:#333; font-size:.92em; }
.p5b-cover-head { display:flex; flex-direction:column; align-items:center; text-align:center; line-height:1.4; gap:.5mm; }
.p5b-cover-head img { width:22mm; height:22mm; object-fit:contain; }
.p5b-cover-head .t1 { font-size:1.35em; font-weight:700; }
.p5b-cover-head .t2 { font-weight:600; }
.p5b-2col { display:flex; flex-direction:column; gap:2.5mm; }
.p5b-approve { margin-top:auto; display:grid; grid-template-columns:2fr 1fr; gap:4mm; align-items:end; }
.p5b-signs { display:flex; flex-wrap:wrap; justify-content:space-around; gap:4mm 8mm; text-align:center; font-size:.95em; margin-top:auto; padding-top:3mm; }
.p5b-director { text-align:center; border:1px solid #777; padding:2mm; line-height:1.6; }
.p6s-tbl .nw { white-space:nowrap; }
.p5b-att th, .p5b-att td { padding:.4mm .5mm; font-size:.85em; }
.p5b-att .off { background:#e9e9e9; }
.p5b-att td.v span, .p5b-vert th.v span { writing-mode:vertical-rl; transform:rotate(180deg); white-space:nowrap; display:inline-block; }
.p5b-vert th.v { vertical-align:bottom; height:30mm; padding:1mm .5mm; font-weight:500; font-size:.85em; }
.p5b-chart { width:100%; max-height:120mm; }
/* ปพ.5 ทั้งเล่ม: ทุกข้อความอยู่บรรทัดเดียว (ไม่ตัดบรรทัด) — ย่อตัวอักษรให้พอดีแผ่น A4 แนวตั้งแทน */
.p5b .p6s-tbl th, .p5b .p6s-tbl td, .p5b-title b, .p5b-title span, .p5b-cover-head > div, .p5b-signs > div > div, .p5b-director > div, .p5b .tiny { white-space:nowrap; }
.p5b .p6s-tbl { width:auto; min-width:100%; }
.p5b-att th, .p5b-att td { padding:.3mm .35mm; }
.p5b .tiny { font-size:.85em; max-width:100%; overflow:hidden; text-overflow:ellipsis; }   /* บรรทัดหมายเหตุ/ตัวชี้วัด: บรรทัดเดียว ยาวเกินตัดด้วย … (ไม่ดันให้ทั้งหน้าย่อ) */

/* ระบบเอกสาร ปพ. — หน้ารวม · แดชบอร์ดผลการเรียน · ปพ.7 */
.pp-grid { display:grid; gap:12px; grid-template-columns:1fr; }
@media (min-width:640px){ .pp-grid { grid-template-columns:repeat(2,1fr); } }
@media (min-width:1000px){ .pp-grid { grid-template-columns:repeat(3,1fr); } .pp-grid-4 { grid-template-columns:repeat(4,1fr); } }
.pp-tool { display:flex; flex-direction:column; gap:6px; padding:16px; color:var(--text); text-decoration:none; transition:transform .15s, box-shadow .15s; }
.pp-tool:hover, .pp-dash:hover { transform:translateY(-2px); box-shadow:0 8px 24px rgba(0,0,0,.08); }
.pp-tool .chip-icon { margin-bottom:4px; }
.pp-dash { display:flex; align-items:center; gap:14px; padding:16px; color:var(--text); text-decoration:none; transition:transform .15s, box-shadow .15s; }
.pp-dash .grow { flex:1; display:flex; flex-direction:column; gap:2px; min-width:0; }
.pp-steps { display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; padding:14px 16px; font-size:.88rem; }
.pp-steps span:not(.muted) { background:var(--surface-2); border-radius:8px; padding:3px 9px; }
.pp-steps span.ok { background:#e2f4e8; color:#1e6b3a; font-weight:600; }
.rs-g { background:#dcfce7; color:#166534; } .rs-w { background:#fef3c7; color:#92400e; } .rs-d { background:#fee2e2; color:#991b1b; } .rs-na { color:var(--text-3); }
.rs-pill { border-radius:6px; padding:1px 6px; font-size:.78rem; }
.rs-cell { display:block; border-radius:8px; padding:3px 0; font-weight:700; text-decoration:none; font-variant-numeric:tabular-nums; }
a.rs-cell:hover { outline:2px solid var(--coral-400); }
.rs-tbl th, .rs-tbl td { padding:8px 6px; } .rs-tbl tfoot th { background:var(--surface-2); }
.rs-bad { color:#c0392b; font-weight:700; } .rs-up { color:#1e6b3a; }
.rs-chip { display:inline-flex; align-items:center; font-size:.78rem; padding:3px 10px; border-radius:999px; border:1px solid var(--line-strong); color:var(--text-2); cursor:pointer; user-select:none; text-decoration:none; }
.rs-chip input { display:none; } .rs-chip.on { background:var(--bg-soft); border-color:var(--coral-400); color:var(--coral-700); font-weight:600; }
.rs-cmp { display:grid; grid-template-columns:5.5rem minmax(0,1fr) 6.5rem; gap:10px 12px; align-items:center; }
.rs-bar { height:8px; border-radius:4px; margin:2px 0; } .rs-bar.cur { background:var(--coral-500); } .rs-bar.old0 { background:#b8aeb5; } .rs-bar.old1 { background:#d9d2d6; }
:root[data-theme="dark"] .rs-g { background:#14532d; color:#bbf7d0; } :root[data-theme="dark"] .rs-w { background:#713f12; color:#fde68a; } :root[data-theme="dark"] .rs-d { background:#7f1d1d; color:#fecaca; }
:root[data-theme="dark"] .pp-steps span.ok { background:#14532d; color:#bbf7d0; }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .rs-g { background:#14532d; color:#bbf7d0; } :root:not([data-theme="light"]) .rs-w { background:#713f12; color:#fde68a; } :root:not([data-theme="light"]) .rs-d { background:#7f1d1d; color:#fecaca; } :root:not([data-theme="light"]) .pp-steps span.ok { background:#14532d; color:#bbf7d0; } }






:root[data-theme="dark"] .rs-up { color:#86efac; } :root[data-theme="dark"] .rs-bad { color:#fca5a5; }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .rs-up { color:#86efac; } :root:not([data-theme="light"]) .rs-bad { color:#fca5a5; } }

/* เล่ม ปพ.5 — แผงเลือกห้อง/ภาค/โหมด/การเรียง/หน้า (ตามระบบเดิม) */
.pp5-ctl { max-width:1100px; margin:12px auto; padding:14px 16px; }
.pp5-ctl-row { gap:10px 12px; flex-wrap:wrap; align-items:flex-end; }
.pp5-ctl-row .grow { flex:1; min-width:220px; } .pp5-ctl-row .grow select { width:100%; }
.pp5-xl { max-width:560px; padding:18px 20px; } .pp5-xl .pp5-xl-sort { display:flex; flex-wrap:wrap; gap:10px 12px; align-items:flex-end; padding:12px; border-radius:12px; background:var(--surface-2, rgba(127,127,127,.08)); } .pp5-xl .pp5-xl-sort .field { flex:1; min-width:180px; }
.pp5-renum { padding-bottom:10px; }
.pp5-pages { border-top:1px solid var(--line); margin-top:12px; padding-top:10px; }
.pp5-pgrid { display:grid; gap:6px; grid-template-columns:repeat(2,minmax(0,1fr)); margin-top:6px; }
@media (min-width:760px){ .pp5-pgrid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (min-width:1000px){ .pp5-pgrid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
.pp5-pgrid .check { background:var(--surface-2); border-radius:8px; padding:5px 8px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.p5b-avg td { background:#eef2ff; font-weight:700; }
.p5b-sub { font-weight:700; margin:3mm 0 1mm; }
.p5b-scover { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:3mm; font-size:14pt; }
.p5b-scover img { width:32mm; height:auto; margin-bottom:4mm; } .p5b-scover .t1 { font-size:22pt; font-weight:700; line-height:1.4; }
.p5b-scover .t2 { font-size:17pt; font-weight:700; margin-top:8mm; } .p5b-scover .t3 { margin-top:8mm; } .p5b-scover .t4 { margin-top:10mm; }

/* เล่ม ปพ.5 — หน้าตาตามระบบเดิม (pp5_book.php) */
.a4.lg { font-family:'Sarabun','TH Sarabun New',sans-serif; color:#0f172a; padding:9mm 10mm 8mm; display:flex; flex-direction:column; font-size:var(--fs, 10.5pt); }
.lg-head { display:flex; align-items:center; justify-content:center; gap:3.5mm; border-bottom:1px solid #e2e8f0; padding-bottom:2mm; margin-bottom:2.5mm; }
.lg-head img { display:block; height:12mm; width:12mm; object-fit:contain; flex-shrink:0; margin:0; }
.lg-head .t { font-weight:800; font-size:1.45em; text-align:center; color:#0f172a; }
.lg-head .s { font-size:.82em; color:#475569; text-align:center; }
.lg-note { text-align:center; font-size:.85em; color:#64748b; margin:0 0 2mm; }
.lg-ind, .lg-foot { font-size:.78em; color:#64748b; border:1px solid #e2e8f0; border-radius:2mm; padding:1.5mm 2mm; margin-bottom:2mm; }
.lg-foot { border:0; padding:1mm 0; }
.lg-sub { font-weight:700; color:#334155; margin:3mm 0 1mm; }
.lg-tbl { width:100%; border-collapse:collapse; }
.lg-tbl th, .lg-tbl td { border:1px solid #cbd5e1; padding:.28em .35em; text-align:center; vertical-align:middle; line-height:1.25; }
.lg-tbl thead th, .lg-tbl tr:first-child > th { background:#f1f5f9; font-weight:700; }
.lg-tbl .l { text-align:left; } .lg-tbl .b { font-weight:700; } .lg-tbl .bad { color:#e11d48; }
.lg-tbl .fit { width:1%; white-space:nowrap; }
.lg-tbl th.vh { height:30mm; width:6mm; max-width:6mm; padding:1mm .5mm; font-size:.82em; font-weight:600; overflow:hidden; }
.lg-tbl th.vh span { writing-mode:vertical-rl; transform:rotate(180deg); white-space:nowrap; display:inline-block; }
.lg-avg td { background:#eef2ff; font-weight:700; }
.lg-cal th, .lg-cal td { padding:.15em .1em; }
.lg-cal th { font-weight:600; } .lg-cal .ab { font-size:.75em; color:#64748b; } .lg-cal .ab.we { color:#e11d48; font-weight:700; }
.lg-cal .wk { background:#e2e8f0 !important; } .lg-cal .hd { background:#fde68a !important; }
.lg-cal td.hol { background:#fde68a; padding:1px; } .lg-cal td.hol span { writing-mode:vertical-rl; transform:rotate(180deg); display:inline-block; font-size:.8em; font-weight:700; color:#b45309; white-space:nowrap; }
.lg-cal td.nc { color:#94a3b8; }
.lg-sign { display:flex; justify-content:space-around; align-items:flex-end; gap:4mm; margin-top:auto; padding-top:5mm; font-size:.92em; text-align:center; }
.lg-sign > div { flex:1; }
.lg-esig { display:inline-block; position:relative; width:32mm; height:1em; vertical-align:baseline; border-bottom:1px dotted #64748b; }
.lg-esig img { position:absolute; left:50%; bottom:-2mm; transform:translateX(-50%); height:12mm; max-width:34mm; object-fit:contain; }
/* ปกรายชั้น */
.lg-cover .pp { text-align:right; font-weight:700; }
.lg-cover .c { text-align:center; } .lg-cover .logo { display:block; margin:0 auto; width:24mm; height:24mm; object-fit:contain; }
.lg-cover .ct { font-size:1.9em; font-weight:800; margin-top:1mm; }
.lg-cover .info { margin-top:4mm; font-size:1.05em; }
.lg-cover .info .r { display:flex; margin-bottom:.6mm; }
.lg-cover .info .lb { font-weight:700; width:42mm; flex-shrink:0; } .lg-cover .info .lb2 { font-weight:700; width:20mm; flex-shrink:0; }
.lg-cover .info .half { width:52mm; } .lg-cover .info .room { width:15mm; }
.lg-cover .two { display:flex; align-items:flex-start; gap:2mm; margin-top:3mm; font-size:.74em; }
.lg-cover .two .ct-l { width:59%; } .lg-cover .two .ct-r { width:41%; } .lg-cover .two .ct-r table + table { margin-top:-1px; }
.lg-cover .cv-sign { display:grid; grid-template-columns:1fr 1fr; gap:4mm 8mm; margin-top:5mm; text-align:center; }
.lg-cover .cv-date { text-align:center; margin-top:5mm; }
.lg-cover .cv-dir { text-align:center; margin:4mm 0 0 38%; }
/* ปกรายวิชา */
.lg-scover { align-items:center; justify-content:center; text-align:center; gap:2.5mm; font-size:14pt; }
.lg-scover img { display:block; width:28mm; height:28mm; object-fit:contain; margin-bottom:4mm; }
.lg-scover .t1 { font-size:22pt; font-weight:800; line-height:1.45; } .lg-scover .t2 { font-size:17pt; font-weight:700; margin-top:8mm; }
.lg-scover .t3 { margin-top:7mm; } .lg-scover .t4 { margin-top:10mm; } .lg-scover .t5 { color:#64748b; font-size:12pt; }
.lg-scover-sign { display:grid; grid-template-columns:1fr 1fr; gap:6mm 10mm; margin-top:14mm; font-size:12pt; width:100%; }

/* ลายเซ็นอิเล็กทรอนิกส์ */
.esig-pad { width:100%; max-width:600px; aspect-ratio:600/220; background:#fff; border:2px dashed var(--line-strong); border-radius:12px; touch-action:none; cursor:crosshair; display:block; }
.esig-preview { background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px; text-align:center; } .esig-preview img { max-width:100%; max-height:120px; }
.esig-bar { display:inline-flex; gap:6px; align-items:center; flex-wrap:wrap; } .esig-form { display:inline; margin:0; }
.esig-line { display:inline-block; position:relative; width:34mm; height:1em; vertical-align:baseline; border-bottom:1px dotted #64748b; }
.esig-line img { position:absolute; left:50%; bottom:1mm; transform:translateX(-50%); height:11mm; max-width:36mm; object-fit:contain; }   /* อยู่เหนือเส้นจุด ไม่ทับเส้น */
.p5-sig .line .esig-line, .pp6-sign .line .esig-line, .p6s-sign .esig-line { border-bottom:0; } .pp6-sign .line { position:relative; }
/* ปพ.6: เว้นระยะระหว่างคำว่า “ลงชื่อ” กับลายเซ็น (ลายเซ็นตัดขอบแล้วจึงชิดคำ) */
.p6s-sign .esig-line { width:46mm; margin-left:1mm; } .p6s-sign .esig-line img { height:11mm; max-width:36mm; bottom:1mm; }


/* ข้อมูลบุคลากร: วิชาที่สอนได้ · งานที่รับผิดชอบ */
.chip-tag { display:inline-block; background:var(--surface-2); border:1px solid var(--line); border-radius:999px; padding:2px 10px; margin:2px 4px 2px 0; font-size:.85em; }
.ts-areas { display:flex; flex-direction:column; gap:6px; }
.ts-area { border:1px solid var(--line); border-radius:10px; padding:6px 10px; background:var(--surface); }
.ts-area summary { cursor:pointer; font-weight:600; font-size:.92rem; }
.ts-grid { display:grid; gap:4px 12px; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); margin-top:6px; }
.asg-list { display:grid; gap:4px 16px; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); margin-top:6px; }
.asg-row { display:flex; align-items:center; gap:8px; font-size:.88rem; } .asg-row span { flex:1; min-width:0; }
.asg-row select { width:auto; min-height:34px; padding:4px 8px; }

/* ปพ.6 แบบรายงานของโรงเรียน: TH/EN · คาดลายน้ำก่อนประกาศผล · QR ตรวจสอบ */
.a4.p6s { position:relative; }
.p6s .en { color:#555; font-size:.8em; font-weight:400; margin-left:.2em; }
.p6s th .en { display:block; margin-left:0; } .p6s .p6s-head .en { font-size:.72em; }
.p6s-verify { display:flex; justify-content:space-between; align-items:center; gap:4mm; margin-top:2mm; padding-top:1.5mm; border-top:1px solid #ccc; font-size:.82em; }
.p6s-verify .qr svg { width:18mm; height:18mm; display:block; } .p6s-verify.draft { color:#b02a37; display:block; }
.pp6-grid th.vh { height:5.5em; } .pp6-grid th.vh span { writing-mode:vertical-rl; transform:rotate(180deg); white-space:nowrap; font-size:.78rem; }
.pp6-grid td.num, .pp6-grid th.num { padding:6px 6px; text-align:center; } .pp6-grid td.nw { white-space:nowrap; }

.p6s-head { position:relative; } .p6s-qr { margin-left:auto; text-align:center; font-size:.68em; line-height:1.25; min-width:22mm; }
.p6s-qr svg { width:19mm; height:19mm; display:block; margin:0 auto 1mm; } .p6s-qr .code { font-family:monospace; font-size:.95em; }
.p6s-qr.draft { color:#b02a37; border:1.5px solid #b02a37; border-radius:2mm; padding:1.5mm 2mm; max-width:30mm; }
.input.en-sug { border-color:#e0a32e; background:#fff9ec; } :root[data-theme="dark"] .input.en-sug { background:var(--surface-2); }
.en-sug-note { color:#b07a12; margin-top:2px; }

/* จัดการเวลาเรียน (ปพ.5) */
.tg-card { padding:14px 16px; }
.tg-note { margin-bottom:8px; line-height:1.7; }
.tg-key { padding:0 6px; border-radius:4px; } .tg-key.wk { background:rgba(148,163,184,.25); } .tg-key.hol { background:rgba(245,158,11,.25); } .tg-key.nc { background:var(--bg-soft); }
.tg-grid { border-collapse:collapse; font-size:12px; width:100%; }
.tg-grid th, .tg-grid td { border:1px solid var(--line); padding:2px 3px; text-align:center; min-width:22px; }
.tg-grid th { font-weight:600; background:var(--surface-2); } .tg-grid .ab { font-size:.75em; color:var(--text-3); } .tg-grid .ab.we { color:var(--bad); font-weight:700; }
.tg-grid .nm { text-align:left; white-space:nowrap; position:sticky; left:0; background:var(--surface); z-index:1; }
.tg-grid .wk { background:rgba(148,163,184,.22); } .tg-grid th.nc { background:var(--bg-soft); color:var(--text-3); }
.tg-grid td.hol, .tg-grid th.hol { background:rgba(245,158,11,.22); } .tg-grid td.hol span { writing-mode:vertical-rl; transform:rotate(180deg); display:inline-block; font-size:.8em; font-weight:700; color:var(--warn); white-space:nowrap; }
.tg-grid td.ac { cursor:pointer; user-select:none; } .tg-grid td.ac:hover { outline:2px solid var(--primary); outline-offset:-2px; }
.tg-grid .b { font-weight:700; } .s-none { color:var(--text-3); }
.s-present { color:var(--ok); } .s-late, .s-activity { color:var(--ok); }
.s-sick { color:var(--warn); background:var(--warn-soft); } .s-personal { color:var(--info); background:var(--info-soft); } .s-absent { color:var(--bad); background:var(--bad-soft); font-weight:700; }
b.s-sick, b.s-personal, b.s-absent { padding:0 4px; border-radius:4px; }
.tg-grid td.dirty { outline:2px solid var(--primary); outline-offset:-2px; }
.tg-form { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:10px 12px; } .tg-form .tg-wide { grid-column:span 2; }
@media (max-width:640px) { .tg-form .tg-wide { grid-column:auto; } }

/* ปพ.5 หน้าเลือกห้อง/ภาค → เล่มทั้งห้อง / รายวิชา */
.pp5-pick { padding:12px 14px; display:flex; flex-direction:column; gap:10px; }
.pp5-pick-term { gap:10px 14px; align-items:center; flex-wrap:wrap; }
.pp5-cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(320px, 1fr)); gap:12px; }
.pp5-card { padding:14px 16px; display:flex; gap:12px; align-items:flex-start; flex-wrap:wrap; }
.pp5-card .grow { flex:1; min-width:200px; }
.pp5-card-act { display:flex; gap:6px; flex-wrap:wrap; width:100%; justify-content:flex-end; }
.pp5-courses tr.is-empty td { color:var(--text-3); }
.pp5-skip { max-width:210mm; margin:12px auto; padding:10px 14px; }
.pp7-set { padding:12px 16px; } .pp7-set summary { cursor:pointer; }

/* ปพ.7 หนังสือรับรอง — ระเบียบงานสารบรรณ ข้อ 24 (แบบที่ 10): ขอบซ้าย 3 ซม. ขวา 2 ซม. · ครุฑสูง 3 ซม. · TH Sarabun 16pt */
.a4.pp7 { height:297mm; position:relative; padding:15mm 20mm 20mm 30mm; font-family:'TH Sarabun New','Sarabun',sans-serif; font-size:16pt; line-height:1.55; color:#111; }
.pp7-garuda { display:block; height:30mm; width:auto; margin:0 auto; }
/* “ที่” (ซ้าย) และส่วนราชการ (ขวา) บรรทัดแรกอยู่แนวตีนครุฑ — ดึงขึ้น 1 บรรทัดให้ตรงฐานครุฑ */
.pp7-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10mm; margin:-1.55em 0 10mm; } .pp7-head .no { max-width:38%; } .pp7-head .r { text-align:left; width:40%; }
.a4.pp7 h1 { text-align:center; font-size:18pt; font-weight:700; margin:0 0 8mm; color:#111; }
.pp7-body { text-indent:2.5cm; text-align:justify; margin:0; }
.pp7-given { margin:8mm 0 0; padding-left:50%; }
.pp7-foot { display:flex; justify-content:flex-end; align-items:flex-end; gap:10mm; margin-top:4mm; } .pp7-foot.has-photo { justify-content:space-between; align-items:flex-start; }
.pp7-sign { width:50%; text-align:center; } .pp7-sign p, .pp7-photo p { margin:0; } .pp7-sign .line { min-height:20mm; display:flex; align-items:flex-end; justify-content:center; }
.pp7-sign .line .esig-line { border-bottom:0; width:auto; height:auto; display:block; } .pp7-sign .esig-line img { position:static; transform:none; display:block; height:11mm; width:auto; max-width:40mm; object-fit:contain; margin:0 auto 1mm; }
.pp7-photo { width:45mm; text-align:center; font-size:.85em; } .pp7-photo .box { width:40mm; height:60mm; margin:0 auto 3mm; border:1px dashed #777; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; line-height:1.3; color:#666; }
.pp7-body b.nw { white-space:nowrap; } .pp7-body { text-align:justify; text-align-last:left; text-justify:inter-character; }
.pp7-photo .line { margin-top:6mm; }
.sign-roles { display:flex; flex-direction:column; gap:4px; }

/* อนุมัติผลการเรียน: การ์ดภาคเรียน + ตีกลับจากตารางรายวิชาของห้อง (แบบ IEP) */
.ret-pop { position:relative; } .ret-pop > summary { list-style:none; } .ret-pop > summary::-webkit-details-marker { display:none; }
.ret-pop[open] .ret-form { position:absolute; right:0; top:calc(100% + 6px); z-index:20; display:flex; gap:6px; width:min(420px, 80vw); padding:10px; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow, 0 8px 24px rgba(0,0,0,.15)); }
.ret-pop .ret-form .input { flex:1; min-height:38px; }
.table-wrap.tw-pop { overflow:visible; }   /* ตาราง (ซ้อนเป็นการ์ดบนจอเล็ก) ที่มีกล่องตีกลับ/ยกเลิกอนุมัติ — ไม่ตัดกล่อง */
.ret-pop .ret-form.ret-col { flex-direction:column; align-items:stretch; } .ret-pop .ret-form.ret-col .btn { align-self:flex-end; } .ret-pop .ret-form.ret-col .alert { margin:0; }
.term-cards { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:14px; }
.term-card { display:flex; flex-direction:column; gap:10px; padding:16px 18px; border-radius:18px; background:var(--surface); border:2px solid var(--line); color:var(--text) !important; text-decoration:none !important; transition:border-color .15s, box-shadow .15s, transform .15s; }
.term-card:hover { border-color:color-mix(in srgb, var(--primary) 50%, var(--line)); transform:translateY(-1px); }
.term-card.is-active { border-color:var(--primary); box-shadow:0 0 0 4px var(--primary-soft); }
.tc-head { display:flex; align-items:center; gap:8px; } .tc-head b { font-family:var(--font-display); font-size:1.15rem; } .tc-head small { color:var(--text-3); } .tc-head .badge { margin-left:auto; }
.tc-stats { display:flex; gap:8px; flex-wrap:wrap; }
.tc-stat { display:flex; align-items:baseline; gap:6px; padding:6px 12px; border-radius:12px; background:var(--surface-2); font-size:.85rem; color:var(--text-2); }
.tc-stat b { font-size:1.15rem; color:var(--text); } .tc-stat.is-warn { background:var(--warn-soft, #fff4d6); } .tc-stat.is-warn b { color:var(--warn, #b7791f); } .tc-stat.is-bad b { color:var(--bad); }
.tc-prog { display:flex; align-items:center; gap:10px; } .tc-prog .progress { flex:1; }
@media (max-width:640px) { .term-cards { grid-template-columns:1fr; gap:10px; } .term-card { padding:12px 14px; gap:8px; } }

/* จัดสอนแทน: สถิติแบบระบบเดิม — การ์ดสี 4 ใบ + อันดับซ้าย/ขวา */
.sx-cards { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:14px; }
.sx-card { border-radius:16px; padding:16px 18px; color:#fff; box-shadow:0 6px 18px rgba(0,0,0,.12); }
.sx-card .lbl { font-size:.85rem; opacity:.92; } .sx-card .val { font-size:2rem; font-weight:800; line-height:1.2; } .sx-card .val small { font-size:.9rem; font-weight:500; } .sx-card .sub { font-size:.75rem; opacity:.9; }
.sx-purple { background:linear-gradient(135deg, #6d6be8, #4f46e5); } .sx-orange { background:linear-gradient(135deg, #f59e0b, #f97316); }
.sx-blue { background:linear-gradient(135deg, #1fa2f0, #2563eb); } .sx-green { background:linear-gradient(135deg, #22c55e, #0f9f6e); }
.sx-cols { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:22px; }
.sx-h { display:flex; align-items:center; gap:8px; font-size:1.05rem; margin:0 0 8px; } .sx-ic { display:inline-grid; place-items:center; width:32px; height:32px; border-radius:9px; } .sx-ic.g { background:#e7f8ee; } .sx-ic.r { background:#fdecec; }
.sx-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:4px; }
.sx-list > li, .sx-row { display:flex; align-items:center; gap:12px; padding:9px 10px; border-radius:12px; color:inherit; text-decoration:none !important; }
.sx-row:hover { background:color-mix(in srgb, var(--bad, #d64545) 8%, transparent); }
.sx-list .no { flex:none; display:inline-grid; place-items:center; width:30px; height:30px; border-radius:50%; color:#fff; font-weight:700; font-size:.85rem; }
.sx-list .no.g { background:#22c55e; } .sx-list .no.r { background:#f06a6a; }
.sx-list b.r { color:#c0392b; }
.sx-bar { height:8px; border-radius:99px; background:var(--bg-soft, #eee); margin-top:5px; overflow:hidden; } .sx-bar i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg, #34d399, #10b981); }
.sx-num { flex:none; text-align:right; min-width:70px; line-height:1.15; } .sx-num b { display:block; font-size:1.25rem; } .sx-num span { font-size:.72rem; color:var(--text-3, #888); }
.sx-num.g b { color:#16a34a; } .sx-num.r b { color:#dc2626; }
.sx-tags { display:flex; flex-wrap:wrap; gap:4px; margin:3px 0 2px; } .sx-tags .t { font-size:.72rem; padding:2px 8px; border-radius:99px; font-weight:600; }
.sx-tags .o { background:#fff4e0; color:#c2410c; } .sx-tags .b { background:#e6f1fd; color:#1d4ed8; }
@media (max-width:900px) { .sx-cards { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width:700px) { .sx-cols { grid-template-columns:1fr; } }
.sx-list .grow { flex:1; min-width:0; }

/* จัดตาราง: แถบเครื่องมือ (จัดอัตโนมัติ · ล้างทั้งหมด) */
.tt-tools { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:12px 16px; }
.tt-tools details.tt-auto { flex-basis:100%; order:3; } .tt-tools details.tt-auto:not([open]) { flex-basis:auto; order:0; }
.tt-tools details > summary { list-style:none; display:inline-flex; } .tt-tools details > summary::-webkit-details-marker { display:none; }
.tt-brk-row td { background:color-mix(in srgb, var(--warn, #d48a0a) 8%, transparent); }
.tt-new-row td { background:var(--surface-2, #fafafa); }

/* มอบหมายงานในระบบ: คน × งาน */
.pa-wrap { overflow:auto; max-height:75vh; }
.pa-table th, .pa-table td { vertical-align:middle; }
.pa-table thead th { position:sticky; top:0; z-index:2; background:var(--surface); }
.pa-table .pa-name { position:sticky; left:0; z-index:1; background:var(--surface); min-width:200px; }
.pa-table thead .pa-name { z-index:3; }
.pa-job { text-align:center; font-size:.78rem; line-height:1.25; min-width:84px; max-width:100px; cursor:help; }
.pa-job small { display:block; }
.pa-cell { text-align:center; }
.pa-cell.is-on { background:color-mix(in srgb, var(--ok, #2f9e6a) 12%, transparent); }
.pa-cell.is-sug:not(.is-on) { background:color-mix(in srgb, var(--warn, #d48a0a) 10%, transparent); }
.pa-check { display:inline-flex; flex-direction:column; align-items:center; gap:2px; cursor:pointer; padding:6px; }
.pa-check input { width:20px; height:20px; }
.pa-sug { font-size:.65rem; color:var(--warn, #b7791f); }
.pa-tags { display:flex; flex-wrap:wrap; gap:4px; margin-top:2px; }

/* แดชบอร์ดผู้บริหาร/ครู (ตามระบบเดิม) */
.dash-hello { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
@media (min-width:1100px){ .kpis-7 { grid-template-columns:repeat(7,1fr); gap:12px; } .kpis-7 .kpi { flex-direction:column; align-items:flex-start; gap:8px; padding:14px; } .kpis-7 .kpi .val { font-size:1.45rem; } }
.kpi-alert { border-color:color-mix(in srgb, var(--bad) 45%, var(--line)); }
.text-bad { color:var(--bad); }
.dash-tri { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.dash-box { border:1px solid var(--line); border-radius:12px; padding:10px 12px; background:var(--surface-2); }
.dash-box b { display:block; font-family:var(--font-display); font-size:1.6rem; line-height:1.15; font-variant-numeric:tabular-nums; }
.dash-box span { font-size:.8rem; color:var(--text-2); }
.dash-box.is-bad { background:var(--bad-soft); border-color:transparent; } .dash-box.is-bad b { color:var(--bad); }
.dash-box.is-warn { background:var(--warn-soft); border-color:transparent; } .dash-box.is-warn b { color:var(--warn); }
.dash-box.is-ok { background:var(--ok-soft); border-color:transparent; } .dash-box.is-ok b { color:var(--ok); }
.dash-split { display:flex; height:12px; border-radius:999px; overflow:hidden; background:var(--bg-soft); }
.dash-split i, .dash-dot { background:var(--info); } .dash-split i.is-f, .dash-dot.is-f { background:#d4537e; }
.dash-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:4px; }
.dash-bars { display:flex; align-items:stretch; gap:4px; height:130px; }
.dash-bars > div { flex:1; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; min-width:0; }
.dash-bars i { display:block; width:100%; max-width:26px; background:var(--ok); border-radius:4px 4px 0 0; min-height:2px; }
.dash-bars i.is-warn { background:var(--warn); } .dash-bars i.is-bad { background:var(--bad); } .dash-bars i.is-ok { background:var(--ok); }
.dash-bars small { font-size:.68rem; color:var(--text-3); margin-top:3px; white-space:nowrap; }
.dash-bars.is-pair > div > span { display:flex; gap:2px; align-items:flex-end; height:100%; width:100%; justify-content:center; }
.dash-bars.is-pair i { max-width:12px; }
.dash-big { font-family:var(--font-display); font-size:2.2rem; font-weight:600; line-height:1.1; margin-bottom:6px; }

/* เอกสารหนังสือ/คำสั่งแสดงในหน้า */
.doc-frame { width:100%; height:min(78vh, 900px); border:1px solid var(--line); border-radius:10px; background:#525659; }

/* หน้าหนังสือรับ — จัดตามระบบเดิม (inbox_detail) */
.text-ok { color:var(--ok); } .text-warn { color:var(--warn); } .text-info { color:var(--info); }
.doc-head { display:flex; gap:12px; align-items:flex-start; margin-bottom:16px; }
.doc-regno { color:var(--primary); }
.doc-layout { display:grid; gap:16px; grid-template-columns:minmax(0,1fr); align-items:start; }
@media (min-width:1000px){ .doc-layout { grid-template-columns:minmax(0,1fr) 320px; } .doc-side { position:sticky; top:76px; } }
.doc-steps { list-style:none; margin:0; padding:4px 0 0; display:flex; gap:0; overflow-x:auto; }
.doc-steps li { flex:1; min-width:84px; display:flex; flex-direction:column; align-items:center; gap:6px; position:relative; text-align:center; }
.doc-steps li::before { content:""; position:absolute; top:19px; left:-50%; width:100%; height:3px; background:var(--line); z-index:0; }
.doc-steps li:first-child::before { display:none; }
.doc-steps li.is-done::before, .doc-steps li.is-now::before { background:var(--ok); }
.doc-steps span { width:40px; height:40px; border-radius:50%; display:grid; place-items:center; background:var(--bg-soft); color:var(--text-3); z-index:1; }
.doc-steps .is-done span { background:var(--ok); color:#fff; }
.doc-steps .is-now span { background:#6c5ce7; color:#fff; box-shadow:0 0 0 4px color-mix(in srgb, #6c5ce7 25%, transparent); }
.doc-steps small { font-size:.72rem; color:var(--text-2); line-height:1.25; }
.doc-steps .is-now small { color:var(--text); font-weight:600; }
.doc-people { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.doc-people li { display:flex; gap:10px; align-items:center; padding:10px 12px; border-radius:12px; border:1px solid var(--line); }
.doc-people li.is-ok { background:var(--ok-soft); border-color:transparent; } .doc-people li.is-wait { background:var(--warn-soft); border-color:transparent; }
.doc-people .dot { width:30px; height:30px; border-radius:50%; display:grid; place-items:center; background:var(--surface); color:var(--warn); flex:none; }
.doc-people .is-ok .dot { color:var(--ok); }
.doc-people b { display:block; font-size:.92rem; } .doc-people small { font-size:.78rem; color:var(--text-2); }
.doc-tl { list-style:none; margin:0; padding:0; position:relative; }
.doc-tl::before { content:""; position:absolute; left:19px; top:8px; bottom:8px; width:2px; background:var(--line); }
.doc-tl li { display:flex; gap:14px; padding:6px 0 14px; position:relative; }
.doc-tl .dot { width:40px; height:40px; border-radius:50%; display:grid; place-items:center; background:var(--info); color:#fff; flex:none; z-index:1; }
.doc-tl .t-orange .dot { background:#e8590c; } .doc-tl .t-yellow .dot { background:#f2b705; } .doc-tl .t-purple .dot { background:#6c5ce7; } .doc-tl .t-amber .dot { background:#f59f00; } .doc-tl .t-green .dot { background:var(--ok); }
.doc-tl li > div { flex:1; min-width:0; } .doc-tl b { display:block; } .doc-tl small { display:block; font-size:.78rem; color:var(--text-2); }
.doc-quote { margin-top:8px; padding:10px 12px; border-radius:10px; font-weight:600; }
.doc-quote span { display:block; font-size:.75rem; font-weight:600; margin-bottom:2px; }
.doc-quote.is-warn { background:var(--warn-soft); color:color-mix(in srgb, var(--warn) 70%, var(--text)); }
.doc-quote.is-info { background:color-mix(in srgb, #6c5ce7 12%, var(--surface)); color:color-mix(in srgb, #6c5ce7 75%, var(--text)); }
.doc-info { display:grid; gap:14px 20px; grid-template-columns:repeat(auto-fit, minmax(min(100%,240px),1fr)); }
.doc-info small { display:block; font-size:.75rem; color:var(--text-3); } .doc-info b { font-size:1rem; } .doc-info .span-2 { grid-column:1/-1; }
.doc-files { list-style:none; margin:0 0 12px; padding:0; display:grid; gap:8px; }
.doc-files li { display:flex; gap:8px; align-items:center; padding:10px 12px; border-radius:12px; background:var(--surface-2); flex-wrap:wrap; }
.doc-files .ic { width:36px; height:36px; border-radius:10px; display:grid; place-items:center; background:var(--info-soft); color:var(--info); flex:none; }
.doc-files small { display:block; }
.doc-files a.badge { text-decoration:none; }
.doc-upload { border-top:1px solid var(--line); padding-top:12px; display:grid; gap:8px; }
.doc-done { background:var(--ok); color:#fff; border:0; } .doc-done:hover { filter:brightness(.95); }
.doc-ackbig { text-align:center; margin:4px 0 10px; }
.doc-ackbig b { display:inline-block; font-family:var(--font-display); font-size:2rem; padding:8px 18px; border-radius:14px; background:var(--warn-soft); color:var(--warn); }
.doc-ackbig.is-ok b { background:var(--ok-soft); color:var(--ok); }
.doc-ackbig span { display:block; font-size:.85rem; margin-top:6px; color:var(--text-2); }
.doc-acklist { list-style:none; margin:0; padding:0; display:grid; gap:6px; font-size:.88rem; }
.doc-acklist li { display:flex; gap:6px; align-items:center; }
.doc-tools { display:grid; gap:4px; }
.doc-tools .btn { justify-content:flex-start; }
.doc-edit summary { list-style:none; } .doc-edit summary::-webkit-details-marker { display:none; }
.doc-edit[open] summary { margin-bottom:10px; }
.doc-head h1 { font-size:clamp(1.15rem, 2.2vw, 1.55rem); line-height:1.35; }
.doc-files li > div { min-width:150px; }
.doc-upload > b { display:flex; gap:6px; align-items:center; }
.doc-upload > b .icon { width:16px; height:16px; }

/* ดูผลการเรียนด่วน (เลขประจำตัวประชาชน + วันเกิด) */
.qv-notes { padding-left:18px; line-height:1.6; }
.qv-wrap { padding-top:18px; padding-bottom:28px; }
.qv-bar { display:flex; align-items:center; gap:10px 14px; flex-wrap:wrap; padding:10px 14px; margin-bottom:14px; }
.qv-who { display:flex; align-items:center; gap:8px; flex:1 1 220px; min-width:0; }
.qv-who span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.qv-left { display:inline-flex; align-items:center; gap:4px; }
@media (max-width:560px) { .qv-bar .seg { order:3; flex:1 1 100%; } .qv-bar .seg a { flex:1; text-align:center; } }
.btn-quick { display:flex; align-items:center; justify-content:center; gap:10px; min-height:56px; padding:8px 14px; border-radius:var(--radius, 12px); border:1.5px solid var(--primary); background:color-mix(in srgb, var(--primary) 10%, transparent); color:var(--primary); font-weight:700; text-decoration:none; }
.btn-quick span { display:flex; flex-direction:column; line-height:1.3; text-align:left; }
.btn-quick small { font-weight:400; font-size:.78rem; color:var(--muted, #667); }
.btn-quick:hover { background:color-mix(in srgb, var(--primary) 16%, transparent); }
.qv-toggle { color:var(--ok, #15803d); } .qv-toggle.is-off { color:var(--bad, #b91c1c); }
.btn-quick[hidden] { display:none; }
.qv-pw-help { margin:-4px 0 14px; padding:12px 14px; border-radius:var(--radius-sm); background:var(--info-soft); font-size:.84rem; line-height:1.55; color:var(--text-2); }
.qv-pw-help > b { display:block; color:var(--text); margin-bottom:6px; }
.qv-pw-demo { display:flex; gap:10px; margin:2px 0 8px; }
.qv-pw-demo span { display:inline-flex; flex-wrap:wrap; justify-content:center; gap:3px; width:auto; }
.qv-pw-demo i { display:grid; place-items:center; width:26px; height:32px; border-radius:6px; background:var(--surface); border:1.5px solid var(--line-strong); font-style:normal; font-weight:700; font-variant-numeric:tabular-nums; color:var(--primary); }
.qv-pw-demo small { flex-basis:100%; text-align:center; font-size:.72rem; color:var(--text-3); }
/* ผลการเรียน: ปุ่มบันทึก/แชร์เป็นรูปภาพ */
.rc-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; margin:0 0 14px; }
.rc-actions [hidden] { display:none; }
@media (max-width:560px) { .rc-actions .btn { flex:1 1 100%; } }
@media print { .rc-actions, .qv-bar { display:none !important; } }

/* แฟ้มสะสมผลงานบุคลากร */
.pf-wrap { padding-top:20px; padding-bottom:32px; }
.pf-hero { display:flex; align-items:center; gap:14px; margin-bottom:14px; }
.pf-hero h1 { margin:0; font-size:clamp(1.3rem, 3.5vw, 1.9rem); }
.pf-hero p { margin:0; color:var(--text-2); }
.pf-filter { display:flex; gap:10px; flex-wrap:wrap; align-items:center; padding:12px; margin-bottom:10px; }
.pf-chips { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-bottom:16px; }
.pf-chips a { padding:6px 12px; border-radius:999px; border:1px solid var(--line-strong); color:var(--text-2); text-decoration:none; font-size:.86rem; background:var(--surface); }
.pf-chips a.is-active { background:var(--primary); border-color:var(--primary); color:var(--primary-ink, #fff); }
.pf-chips small { opacity:.75; }
.pf-sep { width:1px; height:22px; background:var(--line-strong); margin:0 4px; }
.pf-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap:16px; }
.pf-card { padding:0; overflow:hidden; display:flex; flex-direction:column; color:inherit; text-decoration:none; transition:transform .15s, box-shadow .15s; }
.pf-card:hover { transform:translateY(-2px); box-shadow:0 10px 24px rgba(0,0,0,.08); }
.pf-cover { position:relative; aspect-ratio:16/9; background:var(--bg-soft); overflow:hidden; }
.pf-cover img { width:100%; height:100%; object-fit:cover; display:block; }
.pf-cover.is-empty { display:grid; place-items:center; color:var(--primary); background:linear-gradient(135deg, var(--bg-soft), var(--surface-2)); }
.pf-cover.is-empty .icon { width:44px; height:44px; opacity:.6; }
.pf-cover.is-lg { border-radius:var(--radius, 14px) var(--radius, 14px) 0 0; }
.pf-feat { position:absolute; top:8px; left:8px; display:inline-flex; gap:4px; align-items:center; background:#f6c445; color:#4a3500; font-size:.72rem; padding:2px 8px; border-radius:999px; }
.pf-feat .icon { width:13px; height:13px; }
.pf-plat { position:absolute; right:8px; bottom:8px; font-style:normal; font-size:.72rem; background:rgba(0,0,0,.6); color:#fff; padding:2px 8px; border-radius:999px; }
.pf-body { display:flex; gap:10px; padding:12px 14px 6px; align-items:flex-start; }
.pf-avatar { flex:0 0 44px; width:44px; height:44px; border-radius:50%; overflow:hidden; display:grid; place-items:center; background:var(--primary-soft); color:var(--primary); font-weight:700; }
.pf-avatar img { width:100%; height:100%; object-fit:cover; }
.pf-avatar.is-lg { flex-basis:96px; width:96px; height:96px; font-size:2rem; border:4px solid var(--surface); margin-top:-56px; box-shadow:0 4px 14px rgba(0,0,0,.12); }
.pf-name { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pf-pos, .pf-title { display:block; color:var(--text-2); font-size:.8rem; line-height:1.4; }
.pf-title { color:var(--text-3); }
.pf-meta { display:flex; gap:6px; align-items:center; flex-wrap:wrap; padding:6px 14px 12px; margin-top:auto; font-size:.78rem; color:var(--text-3); }
.pf-meta > span:first-child { display:inline-flex; gap:3px; align-items:center; margin-right:auto; }
.pf-meta .icon { width:14px; height:14px; }
.pf-back { margin:0 0 10px; } .pf-back a { display:inline-flex; gap:4px; align-items:center; text-decoration:none; }
.pf-back .icon.flip { transform:rotate(180deg); }
.pf-show { padding:0; overflow:hidden; max-width:880px; margin:0 auto; }
.pf-head { display:flex; gap:16px; padding:0 22px; align-items:flex-end; flex-wrap:wrap; }
.pf-who { flex:1; min-width:220px; padding-top:10px; }
.pf-who h1 { margin:0; font-size:clamp(1.25rem, 3vw, 1.7rem); }
.pf-who p { margin:2px 0 0; color:var(--text-2); }
.pf-tags { display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-top:8px !important; }
.pf-h { padding:0 22px; margin:16px 0 0; font-size:1.15rem; }
.pf-open { margin:16px 22px 0; display:flex; justify-content:center; }
.pf-open small { font-weight:400; opacity:.85; }
.pf-intro { padding:0 22px; margin:16px 0 0; color:var(--text-2); }
.pf-facts { display:grid; grid-template-columns:repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap:12px; padding:0 22px; margin-top:16px; }
.pf-facts > div { background:var(--surface-2); border-radius:12px; padding:12px 14px; }
.pf-facts h3 { display:flex; gap:6px; align-items:center; font-size:.92rem; margin:0 0 6px; }
.pf-facts p, .pf-facts ul { margin:0; font-size:.88rem; } .pf-facts ul { padding-left:18px; }
.pf-share { margin:20px 22px 22px; padding-top:16px; border-top:1px solid var(--line); }
.pf-share h3 { display:flex; gap:6px; align-items:center; font-size:.95rem; margin:0 0 10px; }
.pf-share-row { display:flex; gap:18px; flex-wrap:wrap; align-items:flex-start; }
.pf-qr { display:flex; flex-direction:column; align-items:center; gap:4px; }
.pf-qr svg { border:1px solid var(--line); border-radius:10px; background:#fff; }
.pf-share-btns { flex:1; min-width:240px; display:flex; flex-direction:column; gap:10px; }
.pf-link { display:flex; gap:6px; } .pf-link .input { min-width:0; }
.pf-line { background:#06c755; color:#fff; border-color:#06c755; } .pf-fb { background:#1877f2; color:#fff; border-color:#1877f2; }
.pf-slug { display:flex; align-items:center; border:1px solid var(--line-strong); border-radius:var(--radius-sm, 10px); overflow:hidden; background:var(--surface); }
.pf-slug span { padding:0 8px; color:var(--text-3); font-size:.82rem; white-space:nowrap; background:var(--surface-2); align-self:stretch; display:flex; align-items:center; max-width:55%; overflow:hidden; text-overflow:ellipsis; }
.pf-slug .input { border:0; border-radius:0; min-width:0; }
.pf-return summary { list-style:none; cursor:pointer; } .pf-return summary::-webkit-details-marker { display:none; }
@media (max-width:560px) { .pf-head { padding:0 14px; } .pf-h, .pf-intro, .pf-facts { padding:0 14px; } .pf-open { margin:14px 14px 0; } .pf-share { margin:18px 14px; } .pf-link { flex-direction:column; } }
.pf-cover.is-lg.is-empty { aspect-ratio:5/1; }
.pf-cover.is-lg.is-empty .icon { width:34px; height:34px; }
.pf-avatar.is-lg { position:relative; z-index:1; }

/* ผู้อำนวยการดูในมุมมองผู้ใช้ */
.viewas-bar { position:sticky; top:0; z-index:50; display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:8px 14px; margin:0 0 12px; border-radius:12px;
  background:repeating-linear-gradient(135deg, #7c3aed, #7c3aed 14px, #6d28d9 14px, #6d28d9 28px); color:#fff; box-shadow:0 4px 14px rgba(109,40,217,.3); }
.viewas-bar > span { flex:1; min-width:200px; } .viewas-bar small { opacity:.85; }
.viewas-bar .btn { background:#fff; color:#5b21b6; border-color:#fff; }
.term-head td { background:var(--surface-2); border-top:2px solid var(--line-strong); padding-top:10px !important; }
@media (max-width:760px) { .table-stack .term-head td { display:block; } }
/* ฝ่ายงาน (หน้าข้อมูลครูและสิทธิ์การใช้งาน) */
.div-list { display:grid; gap:8px; }
.div-row { display:grid; grid-template-columns:1fr minmax(140px, 180px); gap:6px 12px; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.div-row.is-on { border-color:var(--primary); background:var(--primary-soft); }
.div-main { display:flex; flex-direction:column; min-width:0; }
.div-extra { grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:4px 14px; align-items:center; }
@media (max-width:560px) { .div-row { grid-template-columns:1fr; } }
.div-checks { display:flex; flex-direction:column; gap:2px; }

/* ครูและบุคลากร: ลูกศรเลื่อนลำดับ */
.move-btns { display:flex; justify-content:center; gap:2px; margin-top:4px; }
.move-btns form { margin:0; }
.move-btns .btn { padding:3px 7px; min-height:0; line-height:1; border:1px solid var(--line-strong); color:var(--primary); background:var(--surface); }
.move-btns .btn:hover:not([disabled]) { background:var(--primary-soft); }
.move-btns .btn .icon { width:18px; height:18px; }
.move-btns .btn[disabled] { opacity:.25; cursor:default; }
@media (max-width:760px) { .move-btns { justify-content:flex-end; } }

/* การเข้าใช้ระบบ: ตารางสิทธิ์ของงาน */
.acc-table td, .acc-table th { padding-top:4px; padding-bottom:4px; }
.acc-table .pa-check { padding:4px; }
.acc-table .pa-name { min-width:220px; max-width:320px; white-space:normal; }
.acc-cat { margin-bottom:6px; }
.acc-cat > summary.form-sec { margin:14px 0 6px; cursor:pointer; }

/* ปก ปพ.5: ชื่อผู้ลงนามอยู่กึ่งกลางใต้เส้นประ */
.sig3 { display:inline-grid; grid-template-columns:auto auto auto; column-gap:1mm; align-items:baseline; }
.sig3-line { text-align:center; }
.sig3-mid { grid-column:2; justify-self:center; white-space:nowrap; }
.sig3-line .esig-line { width:100%; min-width:34mm; }
.btn-xs { min-height:26px; padding:2px 8px; font-size:.74rem; border-radius:8px; }
.input.input-sm { min-height:32px; padding:4px 8px; font-size:.82rem; }
.tg-grid .tg-fill { border:1px solid var(--line-strong); background:var(--surface); color:var(--ok); border-radius:6px; font-size:.72rem; line-height:1; padding:2px 4px; margin-top:2px; cursor:pointer; }
.tg-grid .tg-fill:hover { background:var(--ok-soft); }
.tg-grid td.pre, .lg-cal td.pre { background:repeating-linear-gradient(45deg, rgba(148,163,184,.18) 0 4px, transparent 4px 8px); }

/* ---------- เยี่ยมบ้านนักเรียน ---------- */
.hv-rooms { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:8px; }
.hv-room { display:flex; flex-direction:column; gap:4px; padding:10px 12px; border:1.5px solid var(--line); border-radius:14px; color:inherit; text-decoration:none; background:var(--surface); }
.hv-room:hover, .hv-room.is-active { border-color:var(--primary); background:var(--primary-soft); }
.hv-list li { gap:10px; scroll-margin-top:80px; }
.hv-head { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.hv-h { font-size:1rem; margin:0 0 10px; display:flex; align-items:center; gap:6px; }
.hv-q { margin-bottom:12px; }
.qchips { display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.qchips label { position:relative; }
.qchips input { position:absolute; opacity:0; inset:0; margin:0; cursor:pointer; }
.qchips span { display:inline-block; padding:9px 14px; border-radius:999px; border:1.5px solid var(--line-strong); background:var(--surface); font-size:.88rem; font-weight:500; line-height:1.2; transition:background .15s, border-color .15s; }
.qchips input:checked + span { background:var(--primary); border-color:var(--primary); color:#fff; }
.qchips input:focus-visible + span { outline:3px solid var(--coral-300); outline-offset:1px; }
.qchips .lv-ok input:checked + span { background:var(--ok); border-color:var(--ok); }
.qchips .lv-warn input:checked + span { background:var(--warn); border-color:var(--warn); }
.qchips .lv-bad input:checked + span { background:var(--bad, #d64545); border-color:var(--bad, #d64545); }
.hv-map { height:260px; border-radius:14px; overflow:hidden; border:1px solid var(--line); z-index:0; }
.hv-map.tall { height:min(70vh,560px); }
.hv-pin span { display:block; width:26px; height:26px; margin:2px; border-radius:50% 50% 50% 0; transform:rotate(-45deg); background:var(--primary); border:3px solid #fff; box-shadow:0 2px 6px rgba(0,0,0,.35); }
.hv-school span { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#fff; box-shadow:0 2px 8px rgba(0,0,0,.3); font-size:18px; }
.hv-photos { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:10px; }
.hv-ph { display:flex; flex-direction:column; gap:4px; }
.hv-ph-img { aspect-ratio:4/3; border-radius:14px; border:2px dashed var(--line-strong); display:grid; place-items:center; color:var(--text-3); background:var(--surface-2) center/cover no-repeat; }
.hv-ph.has .hv-ph-img { border-style:solid; border-color:var(--primary); }
.hv-ph.has .hv-ph-img .icon { opacity:0; }
.hv-ph-img { cursor:pointer; } .hv-ph-btns { display:flex; gap:6px; flex-wrap:wrap; } .hv-ph-btns .btn { flex:1; min-height:34px; padding:4px 8px; font-size:.78rem; justify-content:center; }
.hv-save { position:sticky; bottom:0; z-index:5; display:flex; align-items:center; gap:10px; padding:12px; margin:0 -4px; background:var(--bg); border-top:1px solid var(--line); }
@media (max-width:640px) { .qchips span { padding:10px 14px; font-size:.92rem; } .hv-save .btn-primary { flex:1; } }
.hv-a4 { height:auto; min-height:297mm; overflow:visible; }
.hv-pt { width:100%; border-collapse:collapse; }
.hv-pt th, .hv-pt td { border:1px solid #999; padding:1.2mm 2mm; text-align:left; vertical-align:top; }
.hv-pt th { width:28mm; background:#f3f3f3; font-weight:600; white-space:nowrap; }
.hv-pq { columns:2; column-gap:5mm; }
.hv-pg { break-inside:avoid; margin-bottom:2mm; border:1px solid #999; }
.hv-pgh { background:#eee; font-weight:700; padding:1mm 2mm; }
.hv-pr { display:flex; gap:2mm; padding:.8mm 2mm; border-top:1px solid #ddd; }
.hv-pr span { flex:0 0 42%; color:#444; }
.hv-pp { display:grid; grid-template-columns:repeat(4,1fr); gap:2mm; }
.hv-pp figure { margin:0; } .hv-pp img { width:100%; aspect-ratio:4/3; object-fit:cover; border:1px solid #999; }
.hv-pp figcaption { text-align:center; font-size:.85em; }
.hv-sign { display:grid; grid-template-columns:1fr 1fr; gap:6mm; text-align:center; margin-top:auto; padding-top:6mm; line-height:1.8; }
@media print { .hv-a4 { min-height:0; } }
@media (max-width:1023px), (hover:none), (pointer:coarse) { body:has(.tabbar) .hv-save { bottom:calc(66px + env(safe-area-inset-bottom)); } }
.hv-save [data-draft-msg] { white-space:nowrap; }
.hvm { display:grid; grid-template-columns:280px 1fr; gap:12px; align-items:start; }
.hvm-side { display:flex; flex-direction:column; gap:8px; position:sticky; top:76px; }
.hvm-map { padding:0; overflow:hidden; height:min(78vh,720px); z-index:0; }
@media (max-width:900px) { .hvm { grid-template-columns:1fr; } .hvm-side { position:static; } .hvm-map { height:70vh; } }
.hvm-pin span { display:block; width:20px; height:20px; margin:2px; border-radius:50% 50% 50% 0; transform:rotate(-45deg); border:2.5px solid #fff; box-shadow:0 2px 5px rgba(0,0,0,.35); background:#9aa1ab; }
.hvm-pin.lv-normal span, .hvm-dot.lv-normal { background:var(--ok); } .hvm-pin.lv-risk span, .hvm-dot.lv-risk { background:var(--warn); } .hvm-pin.lv-problem span, .hvm-dot.lv-problem { background:var(--bad); }
.hvm-pin.approx span { background:transparent !important; border:2.5px dashed #6b7280; box-shadow:none; }
.hvm-legend { display:flex; flex-wrap:wrap; gap:6px 12px; color:var(--text-2); }
.hvm-dot { display:inline-block; width:10px; height:10px; border-radius:50%; background:#9aa1ab; margin-right:4px; vertical-align:-1px; }
.hvm-dot.approx { background:transparent; border:1.5px dashed #6b7280; }
.hvm-ring { color:var(--primary); font-size:11px; font-weight:700; text-align:center; text-shadow:0 0 3px #fff, 0 0 3px #fff; }
.hvm-pop { font-family:var(--font-body); min-width:200px; } .hvm-pop .badge { font-size:.72rem; }
.hvm-pop-act { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; } .hvm-pop-act .btn { min-height:30px; padding:4px 10px; font-size:.78rem; color:inherit; } .hvm-pop-act .btn-primary { color:#fff; }
.hvm-nogeo { display:flex; flex-wrap:wrap; gap:6px; }
/* หมุดรูปนักเรียน: ขอบสีตามระดับการดูแล */
.hvm-face { background:none; border:0; }
.hvm-face img, .hvm-face i, .hvm-pinface img, .hvm-pinface i { display:block; width:38px; height:38px; border-radius:50%; object-fit:cover; border:3px solid #9aa1ab; box-shadow:0 2px 6px rgba(0,0,0,.35); background:#fff; box-sizing:border-box; }
.hvm-face i, .hvm-pinface i, .hvm-pop-face i, .hvm-stu i { font-style:normal; font-weight:700; color:#fff; background:#8a7f8d; display:grid; place-items:center; font-size:15px; }
.hvm-face.lv-normal img, .hvm-face.lv-normal i, .hvm-pinface.lv-normal img, .hvm-pinface.lv-normal i { border-color:var(--ok); }
.hvm-face.lv-risk img, .hvm-face.lv-risk i, .hvm-pinface.lv-risk img, .hvm-pinface.lv-risk i { border-color:var(--warn); }
.hvm-face.lv-problem img, .hvm-face.lv-problem i, .hvm-pinface.lv-problem img, .hvm-pinface.lv-problem i { border-color:var(--bad); }
.hvm-pop-head { display:flex; gap:10px; align-items:center; }
.hvm-pop-face img, .hvm-pop-face i { display:block; width:64px; height:64px; border-radius:12px; object-fit:cover; border:3px solid #9aa1ab; box-sizing:border-box; }
.hvm-pop-face.lv-normal img, .hvm-pop-face.lv-normal i { border-color:var(--ok); } .hvm-pop-face.lv-risk img, .hvm-pop-face.lv-risk i { border-color:var(--warn); } .hvm-pop-face.lv-problem img, .hvm-pop-face.lv-problem i { border-color:var(--bad); }
.hvm-map { position:relative; }
.hvm-map.is-pinning, .hvm-map.is-pinning .leaflet-interactive { cursor:crosshair; }
.hvm-pinbar { position:absolute; z-index:1000; left:50%; top:10px; transform:translateX(-50%); width:max-content; max-width:calc(100% - 110px); display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:12px;
  background:#fff; color:#2b2230; box-shadow:0 4px 16px rgba(0,0,0,.25); font-size:.85rem; }
.hvm-pinbar[hidden] { display:none; }
.hvm-pinbar .hvm-pinface img, .hvm-pinbar .hvm-pinface i { width:34px; height:34px; }
.hvm-pintxt { line-height:1.3; } .hvm-pinbar .btn { min-height:30px; padding:4px 10px; font-size:.78rem; white-space:nowrap; } .hvm-pinbar .btn-ghost { color:#2b2230; }
.hvm-stu { display:inline-flex; align-items:center; gap:6px; padding:3px 10px 3px 3px; border-radius:999px; border:1px solid var(--line); background:var(--surface); color:var(--text); font:inherit; font-size:.8rem; cursor:pointer; }
.hvm-stu:hover { border-color:var(--primary); }
.hvm-stu img, .hvm-stu i { width:28px; height:28px; border-radius:50%; object-fit:cover; font-size:12px; }
@media (max-width:600px) { .hvm-pinbar { position:fixed; left:10px; right:10px; top:auto; bottom:calc(86px + env(safe-area-inset-bottom)); transform:none; max-width:none; width:auto; } }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background-color:color-mix(in srgb, var(--primary) 30%, transparent); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background-color:color-mix(in srgb, var(--primary) 75%, transparent); color:#fff; font-weight:700; }
.hvr-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:12px; }
.hvr-bar { display:grid; grid-template-columns:minmax(110px,44%) 1fr 34px; gap:8px; align-items:center; font-size:.85rem; margin:5px 0; }
.hvr-bar b { text-align:right; }
.hvb-cover { align-items:center; justify-content:center; text-align:center; gap:6mm; }
.hvb-logo { width:42mm; height:42mm; object-fit:contain; margin-bottom:6mm; }
.hvb-title { font-size:26pt; font-weight:700; } .hvb-sub { font-size:15pt; }
.hvb-school { margin-top:30mm; font-size:16pt; font-weight:600; } .hvb-school span { font-size:12pt; font-weight:400; }
.hvb-h { font-size:14pt; margin:0 0 2mm; text-align:center; } .hvb-h3 { font-size:11pt; margin:3mm 0 1mm; } .hvb-meta { text-align:center; margin:0 0 2mm; font-size:.95em; }
.hvb-t th { width:auto; text-align:center; } .hvb-t td { text-align:center; }
.hvb-list td.nm, .hvb-list td.hp { text-align:left; } .hvb-list td.nm { white-space:nowrap; } .hvb-list td, .hvb-list th { padding:.8mm 1.4mm; font-size:.92em; }
.hvb-pics { display:grid; grid-template-columns:repeat(3,1fr); gap:4mm; }
.hvb-pics figure { margin:0; } .hvb-pics img { width:100%; aspect-ratio:4/3; object-fit:cover; border:1px solid #999; }
.hvb-pics figcaption { font-size:.9em; text-align:center; line-height:1.25; } .hvb-pics figcaption span { color:#555; font-size:.9em; }
.hvm-side .hvm-sum { display:none; }
.hvm-side > * + * { margin-top:0; }
@media (max-width:900px) {

  .hvm-side .hvm-sum { display:block; cursor:pointer; font-weight:600; }
  .hvm-side:not([open]) { padding-top:12px; padding-bottom:12px; }
}
.hvm-pop { --surface:#fff; --text:#2b2230; --text-2:#5f5463; --text-3:#8f8492; --line:#e6dcd8; --line-strong:#d8ccc8;
  --ok-soft:#e3f5ec; --warn-soft:#fdf2dc; --bad-soft:#fde7e7; --info-soft:#e4f0fb; --primary-soft:#fdeeea; color:#2b2230; }
.hvm-pop .muted { color:#8f8492; } .hvm-pop .btn-outline { background:#fff; color:#2b2230 !important; border-color:#d8ccc8; }
.hvm-pop .badge-muted { background:#f1eeee; color:#5f5463; }
.hv-win.is-late { border-color:var(--warn); }

/* ---------- ปฏิทิน พ.ศ. ---------- */
.thdp-native { position:absolute !important; width:1px !important; height:1px !important; opacity:0 !important; pointer-events:none !important; padding:0 !important; border:0 !important; min-height:0 !important; }
.thdp-btn { display:inline-flex; align-items:center; justify-content:space-between; gap:8px; text-align:left; cursor:pointer; font:inherit; color:var(--text); }
.thdp-btn.input { width:100%; }
.thdp-btn .icon { width:18px; height:18px; color:var(--text-3); flex:none; }
.thdp-btn.is-empty span { color:var(--text-3); }
.thdp-btn.is-invalid { border-color:var(--bad); }
.thdp-btn:disabled { opacity:.6; cursor:not-allowed; }
.thdp { position:absolute; z-index:1000; width:316px; max-width:calc(100vw - 16px); background:var(--surface); color:var(--text); border:1px solid var(--line); border-radius:16px; box-shadow:0 12px 32px rgba(0,0,0,.18); padding:10px; font-size:.9rem; }
.thdp-head { display:flex; gap:6px; align-items:center; margin-bottom:8px; }
.thdp-head select { flex:1 1 auto; min-width:0; font:inherit; padding:6px 8px; border:1px solid var(--line-strong); border-radius:10px; background:var(--surface); color:var(--text); }
.thdp-nav { width:34px; height:34px; border-radius:10px; border:1px solid var(--line); background:var(--surface-2); color:var(--text); font-size:1.2rem; cursor:pointer; }
.thdp-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; text-align:center; }
.thdp-grid b { font-size:.75rem; color:var(--text-3); padding:4px 0; font-weight:600; }
.thdp-grid button, .thdp-months button { height:36px; border:0; border-radius:10px; background:transparent; color:var(--text); font:inherit; cursor:pointer; }
.thdp-grid button:hover, .thdp-months button:hover { background:var(--primary-soft); }
.thdp-grid button.is-today { box-shadow:inset 0 0 0 1.5px var(--primary); }
.thdp-grid button.is-sel, .thdp-months button.is-sel { background:var(--primary); color:#fff; font-weight:700; }
.thdp-grid button:disabled, .thdp-months button:disabled { opacity:.3; cursor:not-allowed; background:transparent; }
.thdp-months { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.thdp-time { display:flex; align-items:center; gap:8px; margin-top:8px; font-size:.85rem; }
.thdp-time input { flex:1; font:inherit; padding:6px 8px; border:1px solid var(--line-strong); border-radius:10px; background:var(--surface); color:var(--text); }
.thdp-foot { display:flex; gap:6px; justify-content:flex-end; margin-top:8px; border-top:1px solid var(--line); padding-top:8px; }
.thdp-foot button { border:0; background:transparent; color:var(--primary); font:inherit; font-weight:600; cursor:pointer; padding:4px 8px; border-radius:8px; }
.thdp-foot button:hover { background:var(--primary-soft); }
@media print { .thdp, .thdp-btn .icon { display:none; } }
.thdp-head .thdp-m { flex-grow:1.6; }

/* ---------- บันทึกพฤติกรรม ---------- */
.beh-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:8px; }
.beh-st { position:relative; display:flex; gap:10px; align-items:center; padding:10px 12px; border:1.5px solid var(--line); border-radius:16px; background:var(--surface); cursor:pointer; transition:border-color .15s, background .15s, box-shadow .15s; user-select:none; }
.beh-st:hover { border-color:var(--line-strong); }
.beh-st input { position:absolute; opacity:0; pointer-events:none; }
.beh-st:has(input:checked) { border-color:var(--primary); background:var(--primary-soft); box-shadow:0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
.beh-st:has(input:focus-visible) { outline:3px solid var(--coral-300); outline-offset:1px; }
.beh-tick { position:absolute; top:-6px; left:-6px; width:22px; height:22px; border-radius:50%; background:var(--primary); color:#fff; display:none; place-items:center; box-shadow:0 2px 6px rgba(0,0,0,.2); }
.beh-tick .icon { width:14px; height:14px; }
.beh-st:has(input:checked) .beh-tick { display:grid; }
.beh-nm { flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.beh-nm .small { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.beh-bar { position:sticky; bottom:12px; z-index:10; display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding:10px 12px; margin-bottom:12px; border-radius:16px; background:var(--surface); border:1px solid var(--line); box-shadow:0 8px 24px rgba(0,0,0,.12); }
.beh-count { font-weight:600; font-size:.9rem; color:var(--text-2); }
form.has-sel .beh-count { color:var(--primary); }
@media (max-width:1023px), (hover:none), (pointer:coarse) { body:has(.tabbar) .beh-bar { bottom:calc(74px + env(safe-area-inset-bottom)); } }
@media (max-width:640px) { .beh-grid { grid-template-columns:1fr; } .beh-bar .btn-ghost { padding:6px 10px; } }
#beh-form { scroll-margin-top:70px; }
.beh-bar { flex-wrap:nowrap; } .beh-bar .btn { white-space:nowrap; } .beh-count { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
@media (max-width:640px) { .beh-bar { gap:2px; padding:8px 10px; } .beh-bar .btn-ghost { padding:6px 8px; min-height:36px; } .beh-bar .btn-primary { padding:6px 12px; min-height:36px; } .beh-count { font-size:.82rem; } }

/* กล่องข้อความแจ้งทาง LINE */
.line-copy { border:1px solid color-mix(in srgb, #06c755 35%, var(--line)); background:color-mix(in srgb, #06c755 6%, var(--surface)); border-radius:14px; padding:12px; display:grid; gap:8px; }
.line-copy.is-warn { border-color:color-mix(in srgb, var(--warn) 40%, var(--line)); background:color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.line-copy-head { display:flex; gap:8px; align-items:center; font-size:.92rem; }
.line-copy-ico { width:28px; height:28px; border-radius:9px; display:grid; place-items:center; background:#06c755; color:#fff; flex:none; }
.line-copy.is-warn .line-copy-ico { background:var(--warn); }
.line-copy-ico svg { width:16px; height:16px; }
.line-copy-text { font-size:.86rem; line-height:1.55; resize:vertical; min-height:0; font-family:inherit; field-sizing:content; max-height:440px; }
.line-copy-btns { display:flex; gap:6px; flex-wrap:wrap; }
.line-copy-btns .btn { flex:1 1 140px; justify-content:center; }
.line-copy + .line-copy { margin-top:10px; }
/* จุดบอกวันที่มีรายการในปฏิทิน (เช่น วันที่มีการสั่งการ/มอบหมายหนังสือ) */
.thdp-grid button { position:relative; }
.thdp-grid button.has-mark { font-weight:700; }
.thdp-dot { display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--bad); }
.thdp-grid .thdp-dot { position:absolute; left:50%; bottom:3px; transform:translateX(-50%); }
.thdp-grid button.is-sel .thdp-dot { background:#fff; }
.thdp-legend { display:flex; align-items:center; gap:6px; font-size:.78rem; color:var(--muted); padding:6px 4px 0; }

/* แถบเมนูล่าง: ปุ่ม "เมนูทั้งหมด" · ตัวเลขงานที่รอ · ชื่อยาวตัดด้วย … */
.tabbar button { display:flex; flex-direction:column; align-items:center; gap:2px; padding:6px 2px; border:0; border-radius:12px; background:transparent; color:var(--text-3); font:inherit; font-size:.7rem; font-weight:600; cursor:pointer; }
.tabbar button .ti { width:46px; height:30px; border-radius:999px; display:grid; place-items:center; }
.tabbar button .ti .icon { width:22px; height:22px; }
.tabbar a > span:last-child, .tabbar button > span:last-child { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tabbar .ti { position:relative; }
.tab-badge { position:absolute; top:-3px; right:2px; min-width:18px; height:18px; padding:0 5px; border-radius:999px; background:var(--bad); color:#fff; font-size:.66rem; line-height:18px; font-weight:700; text-align:center; box-shadow:0 0 0 2px var(--surface); }

/* หน้าตั้งค่าเมนูมือถือ */
.mm-slots { display:grid; gap:8px; }
.mm-slot { display:flex; gap:10px; align-items:center; }
.mm-slot > b { width:64px; flex:none; font-size:.85rem; color:var(--text-3); }
.mm-slot select { flex:1; }
.mm-preview { display:grid; grid-auto-flow:column; grid-auto-columns:1fr; gap:4px; border:1px solid var(--line); border-radius:16px; padding:8px 6px; background:var(--surface); max-width:420px; }
.mm-preview span { display:flex; flex-direction:column; align-items:center; gap:3px; font-size:.68rem; color:var(--text-3); font-weight:600; text-align:center; min-width:0; }
.mm-preview span .icon { width:22px; height:22px; }
.mm-preview span i { font-style:normal; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
a.dash-box { display:block; color:inherit; text-decoration:none !important; transition:border-color .15s, transform .15s; }
a.dash-box:hover { border-color:var(--primary); transform:translateY(-1px); }
a.dash-box span::after { content:' ›'; color:var(--text-3); }

/* การมาเรียนวันนี้แยกตามชั้น — แถบสีต่อชั้น อ่านง่ายบนมือถือ */
.att-sum { border:1px solid var(--line); border-radius:16px; padding:14px; background:var(--surface-2); }
.att-sum-top { display:flex; gap:16px; align-items:center; }
.att-big { flex:none; width:118px; height:118px; border-radius:50%; display:grid; place-content:center; text-align:center; background:var(--surface); border:8px solid var(--line); }
.att-big b { font-family:var(--font-display); font-size:1.75rem; line-height:1; font-variant-numeric:tabular-nums; }
.att-big b small { font-size:.9rem; margin-left:1px; }
.att-big span { font-size:.68rem; color:var(--text-3); margin-top:4px; line-height:1.2; padding:0 8px; }
.att-big.att-ok { border-color:color-mix(in srgb, var(--ok) 70%, transparent); } .att-big.att-ok b { color:var(--ok); }
.att-big.att-warn { border-color:color-mix(in srgb, var(--warn) 70%, transparent); } .att-big.att-warn b { color:var(--warn); }
.att-big.att-bad { border-color:color-mix(in srgb, var(--bad) 70%, transparent); } .att-big.att-bad b { color:var(--bad); }
.att-sum-meta { flex:1; min-width:0; display:grid; gap:8px; }
.att-bar { display:flex; height:10px; border-radius:999px; overflow:hidden; background:var(--line); }
.att-bar i { display:block; height:100%; }
.ab-p, .ast-p i { background:var(--ok); } .ab-l, .ast-l i { background:var(--warn); } .ab-v, .ast-v i { background:var(--info); }
.ab-a, .ast-a i { background:var(--bad); } .ab-u, .ast-u i { background:color-mix(in srgb, var(--text-3) 35%, transparent); }
.att-stats { display:flex; flex-wrap:wrap; gap:4px 10px; font-size:.78rem; color:var(--text-2); }
.ast { display:inline-flex; align-items:center; gap:4px; white-space:nowrap; }
.ast i { width:8px; height:8px; border-radius:50%; display:inline-block; }
.ast b { color:var(--text); font-variant-numeric:tabular-nums; }
.ast.is-zero { opacity:.45; }
.ast-a:not(.is-zero) b { color:var(--bad); }
.att-levels { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap:10px; margin-top:12px; }
.att-lv { border:1px solid var(--line); border-radius:14px; padding:10px 12px; display:grid; gap:7px; background:var(--surface); }
.att-lv-head { display:flex; align-items:baseline; gap:8px; }
.att-lv-head > b:first-child { font-size:.95rem; }
.att-pct { font-family:var(--font-display); font-size:1.15rem; font-variant-numeric:tabular-nums; }
.att-pct.att-ok { color:var(--ok); } .att-pct.att-warn { color:var(--warn); } .att-pct.att-bad { color:var(--bad); } .att-pct.att-none { color:var(--text-3); }
@media (max-width:420px) { .att-big { width:96px; height:96px; border-width:6px; } .att-big b { font-size:1.4rem; } .att-sum-top { gap:12px; } }
.tabbar { grid-auto-columns:minmax(0, 1fr); }
.tabbar a, .tabbar button { min-width:0; }

/* ส่งแผนการจัดการเรียนรู้ */
.pl-subjects { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap:10px; }
.pl-subj { border:1px solid var(--line); border-radius:14px; padding:10px 12px; display:grid; gap:8px; background:var(--surface-2); }
.pl-subj-h { display:flex; gap:8px; align-items:baseline; }
/* ตรวจแผนการสอน → รายครู */
.pl-tabs { max-width:100%; overflow-x:auto; scrollbar-width:none; } .pl-tabs a { white-space:nowrap; }
.pl-filter a { display:inline-block; padding:8px 14px; border-radius:999px; border:1.5px solid var(--line-strong); background:var(--surface); font-size:.88rem; color:var(--text); text-decoration:none; }
.pl-filter a b { margin-left:4px; }
.pl-filter a.is-active { background:var(--primary); border-color:var(--primary); color:#fff; }
.pl-filter a.pl-f-none:not(.is-active) b { color:var(--bad, #d64545); }
.pl-teachers { display:grid; gap:8px; }
.pl-t { padding:0; overflow:hidden; }
.pl-t > summary { list-style:none; cursor:pointer; display:flex; gap:10px; align-items:center; padding:10px 14px; }
.pl-t > summary::-webkit-details-marker { display:none; }
.pl-t > summary::after { content:"▾"; color:var(--text-3); margin-left:auto; transition:transform .15s; }
.pl-t[open] > summary::after { transform:rotate(180deg); }
.pl-t.is-none { border-left:4px solid var(--bad, #d64545); }
.pl-t-main { display:grid; gap:4px; min-width:0; flex:1; }
.pl-t-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pl-t-badges { gap:4px; flex-wrap:wrap; }
.pl-t-plans { border-top:1px solid var(--line); }
.pl-t-plan { display:flex; gap:10px; align-items:center; justify-content:space-between; padding:9px 14px 9px 60px; color:var(--text); text-decoration:none; border-bottom:1px solid var(--line); }
.pl-t-plan:last-child { border-bottom:0; }
.pl-t-plan:hover { background:var(--surface-2); }
.pl-t-topic { display:grid; gap:2px; min-width:0; }
.pl-t-empty { padding:10px 14px 12px 60px; border-top:1px solid var(--line); }
@media (max-width:600px) { .pl-t-plan, .pl-t-empty { padding-left:14px; } }
.pl-pa { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap:4px 12px; }
.pl-steps { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.pl-steps li { display:flex; gap:10px; align-items:flex-start; }
.pl-steps .dot { width:26px; height:26px; flex:none; border-radius:50%; display:grid; place-items:center; background:var(--line); color:var(--text-3); }
.pl-steps .dot svg { width:14px; height:14px; }
.pl-steps li.is-done .dot { background:var(--ok); color:#fff; }
.pl-steps li.is-now .dot { background:var(--warn); color:#fff; }
.pl-steps li.is-skip { opacity:.5; }
.pl-lv { display:grid; grid-template-columns:1fr auto; gap:6px 10px; align-items:center; }
.pl-lv select { width:auto; min-height:36px; }
[data-kind-only][hidden] { display:none !important; }

/* ขั้นตอนเคสดูแลช่วยเหลือ: เปิดใหม่ → กำลังช่วยเหลือ → ติดตามผล → ปิดแล้ว */
.care-steps { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:6px; }
.care-step { position:relative; display:flex; gap:8px; align-items:center; padding:9px 10px; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:inherit; text-decoration:none !important; min-width:0; }
.care-step:not(:last-child)::after { content:'›'; position:absolute; right:-6px; top:50%; transform:translateY(-50%); color:var(--text-3); font-weight:700; z-index:1; }
.care-step .n { width:24px; height:24px; flex:none; border-radius:50%; display:grid; place-items:center; font-size:.78rem; font-weight:700; background:var(--line); color:var(--text-2); }
.care-step .t { display:grid; min-width:0; }
.care-step .t b { font-size:.86rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.care-step .t small { font-size:.7rem; color:var(--text-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.care-step .c { margin-left:auto; font-family:var(--font-display); font-weight:700; font-size:1.05rem; font-variant-numeric:tabular-nums; }
.care-step.is-on { border-color:var(--primary); background:var(--primary-soft); }
.care-step.is-on .n { background:var(--primary); color:#fff; }
.care-step.is-closed.is-on { border-color:var(--ok); background:var(--ok-soft); } .care-step.is-closed.is-on .n { background:var(--ok); }
@media (max-width:640px) { .care-steps { grid-template-columns:repeat(2, minmax(0, 1fr)); } .care-step:nth-child(2)::after { display:none; } }

/* PA ครู (ว 9/2564) */
.pa-items { display:grid; gap:10px; }
.pa-item { border:1px solid var(--line); border-radius:14px; padding:10px 12px; display:grid; gap:8px; background:var(--surface-2); scroll-margin-top:80px; }
.pa-item-h { display:flex; gap:8px; align-items:baseline; flex-wrap:wrap; font-size:.92rem; }
.pa-item-h > b { color:var(--primary); }
.pa-ev { display:flex; flex-wrap:wrap; gap:6px; }
.pa-chip { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:999px; border:1px dashed var(--line-strong); font-size:.76rem; color:var(--text-3); text-decoration:none !important; background:var(--surface); }
.pa-chip b { font-variant-numeric:tabular-nums; }
.pa-chip.has { border-style:solid; border-color:color-mix(in srgb, var(--ok) 45%, var(--line)); color:var(--text); background:var(--ok-soft); }
.pa-chip.has b { color:var(--ok); }
.pa-chip.is-manual { background:var(--info-soft); border-color:color-mix(in srgb, var(--info) 40%, var(--line)); }
.pa-chip a { color:inherit; }
.pa-targets { display:grid; gap:10px; }
.pa-target { border:1px solid var(--line); border-radius:14px; padding:10px 12px; display:grid; gap:7px; background:var(--surface); }
.pa-target.is-ok { border-color:color-mix(in srgb, var(--ok) 45%, var(--line)); }
.pa-val b { font-family:var(--font-display); font-size:1.15rem; font-variant-numeric:tabular-nums; }

/* อาหารกลางวัน — หน้าจอ */
.lunch-tabs { display:flex; flex-wrap:nowrap; overflow-x:auto; max-width:100%; scrollbar-width:none; } .lunch-tabs a { white-space:nowrap; display:inline-flex; gap:6px; align-items:center; } .lunch-tabs .icon { width:16px; height:16px; }
.lunch-today { display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.lunch-total { display:inline-flex; gap:8px; align-items:baseline; } .lunch-total b { font-size:1.35rem; font-variant-numeric:tabular-nums; }
.lunch-tags { display:flex; flex-wrap:wrap; gap:6px 14px; }
.lunch-people { display:grid; gap:6px; margin-bottom:8px; }
.lunch-items { min-width:760px; } .lunch-items td { padding:4px; } .lunch-items .input { padding:6px 8px; min-height:38px; } .lunch-items td.c { text-align:center; } .lunch-items input.num { text-align:right; max-width:110px; }
.lunch-methods { display:grid; gap:8px; } .lunch-methods .check { align-items:flex-start; padding:10px 12px; border:1px solid var(--line); border-radius:12px; }
.lunch-stage { font-size:.98rem; margin:14px 0 6px; padding-top:10px; border-top:1px solid var(--line); }
.lunch-guide { list-style:decimal; margin:0; padding-left:22px; display:grid; gap:6px; } .lunch-guide li { padding-left:4px; }
.lunch-guide li > div.lg-main { display:inline-block; vertical-align:top; max-width:calc(100% - 180px); } .lunch-guide .lg-act { float:right; display:flex; gap:4px; }
@media (max-width:640px) { .lunch-guide li > div.lg-main { max-width:100%; display:block; } .lunch-guide .lg-act { float:none; margin-top:4px; } }
.lunch-guide li::after { content:""; display:block; clear:both; }
.lunch-part { border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin-top:12px; } .lunch-part-t { margin:0 0 2px; font-size:1.05rem; color:var(--accent); }
.lunch-part .lunch-stage:first-of-type { border-top:0; padding-top:0; } .lunch-part .lunch-ctx { margin-top:6px; }
.lunch-parts { flex-wrap:wrap; }
/* การเงิน-บัญชี */
.fin-ledger td, .fin-ledger th { white-space:nowrap; } .fin-ledger td.small { white-space:normal; min-width:200px; } .fin-ledger .fin-open td { background:var(--surface-2, rgba(0,0,0,.03)); }
.fin-lines .input { min-width:0; }
.ld-date { margin:2mm 0 3mm !important; }
.print-meta { display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; justify-content:center; padding:8px 12px; background:var(--surface); border-bottom:1px solid var(--line); font-size:.9rem; } .print-meta .input { display:inline-block; width:auto; min-height:34px; padding:4px 8px; }
/* หนังสือรับ: ตัวอย่างข้อความ (คลิกใส่) */
.doc-phrases .badge { cursor:pointer; border:1px solid var(--line); background:var(--surface); font-weight:500; }
.doc-phrases .badge:hover { border-color:var(--primary); color:var(--primary); }
/* พิมพ์แผน/บันทึกหลังการจัดการเรียนรู้: ยาวได้หลายหน้า (ไม่ตัดข้อความ) · ความเห็นเต็มความกว้าง ลงนามชิดขวา */
.a4.pl-a4 { height:auto; min-height:297mm; overflow:visible; --fs:13pt; font-size:13pt; line-height:1.5; display:flex; flex-direction:column; gap:2.5mm; padding:12mm 16mm 12mm 20mm; }
.pl-head { text-align:center; } .pl-head img { height:18mm; display:block; margin:0 auto 1mm; } .pl-head .t { font-weight:700; font-size:1.15em; }
.pl-op { break-inside:avoid; margin-top:2mm; } .pl-txt { text-indent:10mm; overflow-wrap:anywhere; } .pl-ev { font-size:.82em; color:#333; }
.pl-sig { width:52%; margin-left:auto; text-align:center; margin-top:2mm; break-inside:avoid; }
/* พิมพ์: แต่ละส่วนเริ่มหน้าใหม่ มีขอบบน-ล่างในตัว (ไม่ใช้ named page — การพิมพ์จากหน้าต่าง Print ของ Chrome เพิ่มหน้าว่าง) · ยาวเกินหน้าก็ไหลต่อ ขอบซ้ำทุกหน้า */
@media print { .a4.pl-a4 { min-height:0; height:auto; padding-top:12mm; padding-bottom:12mm; break-after:auto; -webkit-box-decoration-break:clone; box-decoration-break:clone; } }
/* ช่องลงนาม (sig_block): ลงชื่อ/คำท้ายอยู่นอกเส้น → เส้นประ ชื่อ ตำแหน่ง กึ่งกลางแนวเดียวกัน */
.sgc { text-align:center; break-inside:avoid; }
.sgc-r { position:relative; display:inline-block; white-space:nowrap; }
.sgc-pre { position:absolute; right:100%; padding-right:1.5mm; white-space:nowrap; }
.sgc-post { position:absolute; left:100%; padding-left:1.5mm; white-space:nowrap; }
.pl-h { font-weight:700; margin-top:1mm; }
.pl-dots span { display:block; border-bottom:1px dotted #555; height:7.5mm; }
.pl-a4.pl-p2 { margin-top:24px; } .pl-p2 .pl-op { margin-top:4mm; } .pl-p2 .pl-op:first-child { margin-top:0; }
@media print { .a4.pl-a4.pl-p2 { break-before:page; margin-top:0; } }
/* ข้อความบรรยาย/ความเห็นในแบบบันทึก: จัดเต็มบรรทัดซ้าย-ขวาแบบเอกสารไทย (กระจายระหว่างตัวอักษร · บรรทัดสุดท้ายชิดซ้าย) */
.pl-txt, .pl-just { text-align:justify; text-align-last:left; text-justify:inter-character; }
.pl-li > div { padding-left:17mm; text-indent:-7mm; } .pl-li span { white-space:nowrap; }

/* ปฏิทินการนิเทศ (รายเดือน) */
.svc { display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:6px; }
.svc-h { font-size:.78rem; font-weight:700; color:var(--text-2); text-align:center; padding:4px 0; } .svc-h.we { color:var(--text-3); }
.svc-d { min-height:104px; border:1px solid var(--line); border-radius:12px; padding:6px; background:var(--surface); display:flex; flex-direction:column; gap:4px; min-width:0; }
.svc-d.out { border:0; background:transparent; }
.svc-d.we { background:var(--surface-2); } .svc-d.off { background:repeating-linear-gradient(-45deg, var(--bg-soft) 0 6px, transparent 6px 12px); }
.svc-d.today { outline:2px solid var(--primary); outline-offset:-1px; }
.svc-n { display:flex; align-items:center; justify-content:space-between; font-size:.85rem; }
.svc-add { width:24px; height:24px; border-radius:999px; display:grid; place-items:center; text-decoration:none !important; color:var(--primary); background:var(--primary-soft); font-weight:700; opacity:.55; }
.svc-d:hover .svc-add, .svc-add:focus { opacity:1; }
.svc-off { font-size:.7rem; color:var(--text-3); line-height:1.25; }
.svc-chip { display:block; font-size:.72rem; line-height:1.3; padding:3px 6px; border-radius:7px; text-decoration:none !important; color:var(--text); background:var(--surface-2); border-left:3px solid var(--text-3); overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; word-break:break-word; }
.legend .svc-chip { display:inline-block; -webkit-line-clamp:1; }
.svc-chip.st-scheduled { background:var(--info-soft); border-left-color:var(--info); }
.svc-chip.st-in_progress { background:var(--warn-soft); border-left-color:var(--warn); }
.svc-chip.st-completed { background:var(--primary-soft); border-left-color:var(--primary); }
.svc-chip.st-acknowledged { background:var(--ok-soft); border-left-color:var(--ok); }
@media (max-width:720px) { .svc { grid-template-columns:1fr; } .svc-h, .svc-d.out, .svc-d.we:not(:has(.svc-chip)) { display:none; } .svc-d { min-height:0; } }
/* ฟอร์มนัดนิเทศ: คาบที่ครูสอนในวันที่เลือก */
.sv-slots { display:flex; flex-wrap:wrap; gap:6px; }
.sv-slot { border:1px solid var(--line); border-radius:10px; padding:6px 10px; background:var(--surface); text-align:left; cursor:pointer; font:inherit; font-size:.8rem; line-height:1.3; color:var(--text); }
.sv-slot small { display:block; color:var(--text-3); } .sv-slot.is-sel { outline:2px solid var(--primary); } .sv-slot.busy { border-color:var(--warn); }
/* พิมพ์ปฏิทินการนิเทศ / เอกสารนิเทศ: เอกสารต่อหลายหน้า A4 แนวนอน (หัวตารางซ้ำทุกหน้า · เลขหน้า) */
@page svland { size:A4 landscape; margin:12mm 12mm 14mm; @bottom-center { content:"หน้า " counter(page); font:9pt "Sarabun", sans-serif; color:#555; } }
.svp-doc { width:297mm; min-height:210mm; margin:0 auto 24px; padding:12mm; background:#fff; color:#111; box-shadow:0 10px 30px rgba(0,0,0,.15);
  font-family:"Sarabun", "Anuphan", sans-serif; font-size:13pt; line-height:1.35; }
.svp-head { text-align:center; margin-bottom:4mm; } .svp-head img { height:20mm; display:block; margin:0 auto 2mm; } .svp-head .t1 { font-size:1.2em; font-weight:700; }
.svp-t { width:100%; border-collapse:collapse; table-layout:fixed; font-size:.82em; }
.svp-t th, .svp-t td { border:1px solid #444; padding:1.2mm 1.6mm; vertical-align:top; overflow-wrap:anywhere; }
.svp-t th { background:#eee; text-align:center; vertical-align:middle; font-weight:700; } .svp-t td.c { text-align:center; }
.svp-t thead { display:table-header-group; } .svp-t tr { break-inside:avoid; page-break-inside:avoid; }
.svp-t tr.svp-month td { background:#f6f6f6; font-weight:700; break-after:avoid; page-break-after:avoid; }
.svp-sum { margin:3mm 0 0; font-size:.9em; }
.svp-sign { display:grid; grid-template-columns:1fr 1fr; gap:10mm; margin-top:10mm; break-inside:avoid; page-break-inside:avoid; }
@media print { html:has(.svp-doc), body:has(.svp-doc) { width:auto !important; } .svp-doc { page:svland; width:273mm; min-height:0; margin:0; padding:0; box-shadow:none; } }
.sv-li { padding-left:7mm; text-indent:-5mm; }
.sv-bar { position:relative; display:flex; justify-content:space-between; gap:8px; padding:6px 0 10px; font-size:.88rem; }
.sv-bar i { position:absolute; left:0; bottom:2px; height:5px; width:100%; border-radius:3px; background:var(--bg-soft); }
.sv-bar i::after { content:''; position:absolute; left:0; top:0; bottom:0; width:var(--w); border-radius:3px; background:var(--primary); }
.sv-note { font-size:.85rem; padding:6px 0; border-bottom:1px solid var(--line); } .sv-note:last-child { border-bottom:0; }
/* เล่มแผนการนิเทศ */
.a4.svb-cover { display:flex; flex-direction:column; align-items:center; justify-content:flex-start; text-align:center; padding-top:40mm; font-size:18pt; font-weight:700; }
.svb-cover img { height:38mm; margin-bottom:14mm; } .svb-cover .t { font-size:28pt; margin-bottom:4mm; } .svb-cover .s { margin:1mm 0; } .svb-cover .sp { flex:1; }
.svb-center { text-align:center; } .svb-center.b { font-weight:700; }
.svb-h2 { font-weight:700; margin-left:6mm; }
.svb-toc div { padding:1mm 0 1mm 6mm; border-bottom:1px dotted #bbb; }
.svb-t { margin:2mm 0; }
.svp-sign.svb-right { grid-template-columns:1fr; width:55%; margin-left:auto; }
.pl-a4.svb-page + .pl-a4.svb-next { margin-top:24px; }
@media print { .a4.svb-cover { break-after:page; } .pl-a4.svb-next { break-before:page; margin-top:0; } }

/* ---------- กำหนดการทดสอบทางการศึกษา (นับถอยหลัง) ---------- */
.ex-hero { display:flex; flex-wrap:wrap; align-items:center; gap:18px 28px; background:linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, var(--surface)), var(--surface)); }
.ex-hero-l { flex:1 1 280px; min-width:0; } .ex-hero h2 { margin:4px 0; font-size:1.5rem; }
.ex-eyebrow { font-size:.75rem; letter-spacing:.12em; text-transform:uppercase; color:var(--primary); font-weight:700; }
.ex-cd { display:flex; gap:10px; }
.ex-cd > div { min-width:74px; padding:10px 8px; border-radius:16px; background:var(--surface); border:1px solid var(--line); text-align:center; box-shadow:0 2px 8px rgba(0,0,0,.05); }
.ex-cd b { display:block; font-family:var(--font-display); font-size:2.1rem; line-height:1.05; font-variant-numeric:tabular-nums; color:var(--primary); }
.ex-cd span { font-size:.75rem; color:var(--text-2); }
.ex-today { font-family:var(--font-display); font-size:1.6rem; font-weight:700; color:var(--primary); }
.ex-kind { font-weight:700; }
.ex-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap:14px; }
.ex-card { display:flex; flex-direction:column; gap:8px; } .ex-card[hidden] { display:none; } .ex-card.is-past { opacity:.7; }
.ex-card-h { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.ex-days { font-size:.85rem; color:var(--text-2); } .ex-days b { font-size:1.3rem; color:var(--primary); font-variant-numeric:tabular-nums; }
.ex-dl { display:grid; gap:4px; margin:0; } .ex-dl > div { display:flex; gap:8px; font-size:.86rem; } .ex-dl dt { color:var(--text-2); min-width:104px; } .ex-dl dd { margin:0; font-weight:600; }
.ex-tl ol { list-style:none; margin:0; padding:0 0 0 4px; border-left:2px solid var(--line); }
.ex-tl li { position:relative; padding:0 0 6px 14px; font-size:.82rem; } .ex-tl li span { color:var(--text-2); margin-right:4px; }
.ex-tl li i { position:absolute; left:-7px; top:4px; width:12px; height:12px; border-radius:50%; background:var(--surface); border:2px solid var(--line-strong); }
.ex-tl li.is-done i { background:var(--ok); border-color:var(--ok); } .ex-tl li.is-past i { border-color:var(--warn); } .ex-tl li.is-exam i { background:var(--primary); border-color:var(--primary); } .ex-tl li.is-exam { font-weight:700; }
.ex-targets { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.ex-row { gap:6px; margin-bottom:6px; flex-wrap:nowrap; align-items:center; } .ex-row .check { white-space:nowrap; }
.ex-mini { display:flex; align-items:center; gap:14px; } .ex-mini-t { flex:1; min-width:0; }
.ex-mini-d { text-align:center; line-height:1.05; } .ex-mini-d b { display:block; font-family:var(--font-display); font-size:2rem; color:var(--primary); font-variant-numeric:tabular-nums; } .ex-mini-d span { font-size:.72rem; color:var(--text-2); }
@media (max-width:600px) { .ex-cd { gap:6px; width:100%; } .ex-cd > div { flex:1; min-width:0; padding:8px 4px; } .ex-cd b { font-size:1.6rem; } }
/* จอทีวี */
.ex-tv { position:fixed; inset:0; display:flex; flex-direction:column; background:radial-gradient(circle at 20% 10%, #2c3e66, #101827 70%); color:#fff; padding:3vh 4vw; overflow:hidden; cursor:pointer; }
.ex-tv header { display:flex; align-items:center; gap:16px; } .ex-tv header img { height:8vh; } .ex-tv header b { display:block; font-size:2.6vh; } .ex-tv header span { font-size:2vh; opacity:.75; }
.ex-tv-slide { display:none; flex:1; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:2.4vh; } .ex-tv-slide.is-on { display:flex; animation:exfade .8s ease; }
.ex-tv h1, .ex-tv b { color:#fff; }
.ex-tv-kind { font-size:3.2vh; letter-spacing:.08em; color:#ffd08a; font-weight:700; } .ex-tv h1 { font-size:5vh; margin:0; max-width:80vw; } .ex-tv-date { font-size:3vh; opacity:.85; }
.ex-cd-xl { gap:2vw; } .ex-cd-xl > div { min-width:14vw; padding:2vh 1vw; background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.18); border-radius:3vh; }
.ex-cd-xl b { font-size:14vh; color:#fff; } .ex-cd-xl span { font-size:2.6vh; color:rgba(255,255,255,.8); }
.ex-tv .ex-today { color:#ffd08a; font-size:8vh; }
.ex-tv-targets { font-size:2.6vh; display:flex; gap:12px; flex-wrap:wrap; justify-content:center; } .ex-tv-targets span { padding:.4vh 1.2vw; border-radius:99px; background:rgba(255,255,255,.12); }
.ex-tv-dots { display:flex; justify-content:center; gap:8px; } .ex-tv-dots i { width:10px; height:10px; border-radius:50%; background:rgba(255,255,255,.3); } .ex-tv-dots i.is-on { background:#fff; }
@keyframes exfade { from { transform:translateY(14px); } to { transform:none; } }
/* ผลการเรียนย้อนหลัง: รายชื่อห้อง */
.bf-roster { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap:6px; }
.bf-stu { display:flex; align-items:center; gap:8px; padding:6px 10px; border:1px solid var(--line); border-radius:10px; color:var(--text); text-decoration:none; font-size:.86rem; }
.bf-stu:hover { border-color:var(--primary); } .bf-stu.is-on { border-color:var(--primary); background:color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.bf-no { min-width:22px; color:var(--text-3); text-align:right; font-variant-numeric:tabular-nums; } .bf-nm { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ex-dash li { gap:10px; align-items:center; } .ex-dash .ex-kind { min-width:62px; justify-content:center; }

/* ---------- ลงเวลาปฏิบัติราชการ ---------- */
.st-punch { display:flex; flex-direction:column; gap:12px; max-width:520px; margin-inline:auto; }
.st-clock { text-align:center; } .st-clock b { display:block; font-family:var(--font-display); font-size:3rem; line-height:1; font-variant-numeric:tabular-nums; } .st-clock span { color:var(--text-2); font-size:.9rem; }
.st-gps { display:flex; gap:8px; align-items:center; justify-content:center; padding:10px 12px; border-radius:12px; background:var(--surface-2); font-size:.88rem; cursor:pointer; text-align:center; }
.st-gps.is-ok { background:color-mix(in srgb, var(--ok) 14%, var(--surface)); color:var(--ok); } .st-gps.is-warn { background:color-mix(in srgb, var(--warn) 16%, var(--surface)); } .st-gps.is-bad { background:color-mix(in srgb, var(--bad) 14%, var(--surface)); color:var(--bad); }
.st-photo { cursor:pointer; } .st-photo-img { display:grid; place-items:center; gap:4px; aspect-ratio:4/3; max-height:260px; margin-inline:auto; width:100%; border-radius:16px; border:2px dashed var(--line-strong); color:var(--text-3); background:var(--surface-2) center/cover no-repeat; }
.st-photo-img em { font-style:normal; font-size:.85rem; } .st-photo-img.has { border-style:solid; border-color:var(--primary); } .st-photo-img.has .icon, .st-photo-img.has em { display:none; }
.st-btns { display:grid; grid-template-columns:1fr 1fr; gap:10px; } .st-btns .btn { justify-content:center; min-height:52px; font-size:1.05rem; }
.st-thumb { width:40px; height:40px; object-fit:cover; border-radius:8px; vertical-align:middle; margin:2px; border:1px solid var(--line); }
.a4.pl-a4.st-a4 { --fs:11.5pt; font-size:11.5pt; line-height:1.3; gap:1.5mm; } .st-a4 .svp-t { font-size:.92em; } .st-a4 .svp-t td { padding:.8mm 1.4mm; } .st-a4 .pl-head img { height:16mm; } .st-a4 .svp-t td.c, .st-a4 .svp-t th { text-align:center; }
.st-redline td { color:#c00; font-weight:700; text-align:center; border-top:2.5px solid #c00 !important; border-bottom:2.5px solid #c00 !important; }
.st-a4 .svp-t td.c { white-space:nowrap; } .st-a4 .st-sgc { padding:0 1mm !important; line-height:1; } .st-sig { height:5.2mm; max-width:100%; object-fit:contain; vertical-align:middle; } .st-src { font-size:.78em; color:#555; white-space:nowrap; }
.st-proxy-x { display:inline-block; } .st-proxy-x .btn { padding:0 6px; min-height:24px; font-size:.8rem; }
.st-sum { font-size:.9em; margin:2mm 0; } .st-bad { color:var(--bad); font-weight:700; } .st-total td { background:var(--surface-2); }
@media print { .st-total td { background:#f2f2f2 !important; } }
.st-today { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.st-btns .btn { min-width:0; padding-inline:8px; } .st-sumt td:nth-child(2) { min-width:190px; } .st-sumt th { white-space:nowrap; }
/* บันทึกข้อความขออนุญาตไปราชการ · ฟอร์มขอลา */
.lv-panel { max-width:210mm; margin:8px auto 0; } .lv-panel .card { padding:10px 14px; }
.lv-memo .lv-sig { width:55%; margin:4mm 0 0 45%; }
.lv-memo .lv-dir { margin-top:5mm; border-top:1px dashed #999; padding-top:2mm; }
.lv-box { display:inline-block; width:4.2mm; height:4.2mm; border:1px solid #333; text-align:center; line-height:4mm; font-size:.85em; vertical-align:-.5mm; margin-right:1mm; }
.lv-comp summary { cursor:pointer; font-weight:600; } .lv-comp-list { max-height:220px; overflow:auto; display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:4px 12px; margin-top:6px; }
.lv-add { display:inline-block; }
[data-leave-form] [hidden] { display:none !important; }
.lv-form .lv-2col { display:grid; grid-template-columns:1fr 1fr; gap:6mm; margin-top:4mm; font-size:.92em; }
.lv-form .lv-stat { font-size:.92em; } .lv-form .lv-stat th, .lv-form .lv-stat td { padding:.6mm 1.2mm; }
.lv-form .lv-sig { margin-top:2mm; } .lv-sig2 { text-align:center; margin-top:3mm; }
.lv-txt { margin:0 0 2mm 10mm !important; white-space:normal; }
.lv-photos { display:grid; grid-template-columns:1fr 1fr; gap:4mm; margin-top:4mm; } .lv-photos img { width:100%; height:75mm; object-fit:cover; border:1px solid #ccc; }
.lv-form .lv-sig > p.c { margin-bottom:7mm !important; }
.lv-form .lv-2col p + .lv-sig2 { margin-top:7mm; }
.st-loc { display:inline-flex; align-items:center; gap:3px; font-size:.8rem; white-space:nowrap; } .st-loc .icon { width:14px; height:14px; }
.st-punch-row { display:flex; align-items:center; gap:6px; margin:2px 0; } .st-punch-row form { margin:0; } .st-del { padding:0 4px; min-height:22px; color:var(--bad); }
.st-cam video { width:100%; max-height:300px; border-radius:16px; transform:scaleX(-1); background:#000; object-fit:cover; } .st-cam-btns { justify-content:center; gap:8px; margin-top:8px; } .st-cam .st-photo-img { cursor:pointer; }

/* บันทึกการสอน (/teach): รายการคาบของวัน */
.tc-list { list-style:none; margin:0; padding:4px 12px; }
.tc-row { display:flex; align-items:center; gap:12px; padding:12px 4px; border-bottom:1px solid var(--line); border-radius:12px; flex-wrap:wrap; }
.tc-row:last-child { border-bottom:0; }
.tc-row.is-now { background:var(--ok-soft, var(--info-soft)); }
.tc-row.is-done .tc-hour b { color:var(--ok); }
.tc-hour { display:flex; flex-direction:column; align-items:center; min-width:62px; }
.tc-hour b { font-size:1rem; }
.tc-main { flex:1; min-width:200px; }
.tc-main .badge { margin-left:4px; vertical-align:middle; }
@media (max-width:640px){ .tc-row > .btn { width:100%; justify-content:center; } }
/* สุ่มชื่อ */
.tc-rand-stage { text-align:center; padding:18px 8px 10px; }
.tc-rand-photo img, .tc-rand-photo .stu-initial { width:140px; height:140px; border-radius:50%; object-fit:cover; box-shadow:var(--shadow); display:inline-grid; }
.tc-rand-no { font-size:.95rem; color:var(--text-2); margin-top:10px; font-weight:600; }
.tc-rand-name { font-size:1.6rem; font-weight:800; font-family:var(--font-display); line-height:1.25; }
.tc-rand.is-spinning .tc-rand-name { color:var(--text-3); }
.tc-rand.is-hit .tc-rand-photo { animation:tcpop .45s ease; } .tc-rand.is-hit .tc-rand-name { color:var(--primary); }
@keyframes tcpop { 0%{transform:scale(.85)} 60%{transform:scale(1.08)} 100%{transform:scale(1)} }
.tc-rand-picked { display:flex; flex-wrap:wrap; gap:6px; justify-content:center; margin-top:10px; min-height:1em; }
.tc-rand-picked span { background:var(--bg-soft); border-radius:999px; padding:3px 10px; }
.tc-groups { display:grid; gap:10px; grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); margin-top:10px; }
.tc-groups .grp { border:1px solid var(--line); border-radius:12px; padding:10px 12px; } .tc-groups .grp b { display:block; margin-bottom:4px; } .tc-groups .grp div { font-size:.85rem; }
/* คะแนนเก็บ */
.tc-grid th.tc-item { min-width:96px; vertical-align:top; } .tc-item-t { white-space:normal; font-size:.8rem; line-height:1.2; }
.tc-item-ctl { display:flex; gap:4px; align-items:center; margin-top:4px; } .tc-item-ctl .input-sm { font-size:.72rem; padding:2px 4px; min-height:0; max-width:140px; }
.tc-cell { width:64px; text-align:center; padding:4px 6px; min-height:0; } .tc-cell.is-bad { border-color:var(--bad); background:var(--bad-soft); }
/* ตารางคะแนนเก็บ / ปพ.5 ในหน้าบันทึกการสอน = หน้าตาเดียวกับหน้าบันทึกคะแนน ปพ.5 (แน่น · ชื่อไม่ตัดบรรทัด · คอลัมน์ชื่อค้างไว้ตอนเลื่อน) */
.tc-add { display:grid; grid-template-columns:minmax(0,1fr) 110px 170px auto; gap:10px; align-items:end; } .tc-add .field { margin:0; } @media (max-width:640px) { .tc-add { grid-template-columns:96px 1fr; } .tc-add .field:first-child { grid-column:1 / -1; } .tc-add .btn { grid-column:1 / -1; } }
.tc-sg { width:auto; } .tc-sg th, .tc-sg td { padding:6px 8px; } .tc-sg tbody tr:hover td { background:var(--surface-2); }
.tc-sg td.sticky, .tc-sg th.sticky { position:sticky; left:0; background:var(--surface); z-index:2; white-space:nowrap; } .tc-sg thead th.sticky { z-index:3; background:var(--surface-2); }
.tc-sg .stu-cell { gap:8px; } .tc-sg .stu-photo { width:30px; height:30px; border-radius:9px; }
.tc-sg th.tc-item { min-width:0; width:86px; max-width:104px; vertical-align:bottom; text-align:center; white-space:normal; }
.tc-sg .tc-item-t { font-size:.78rem; line-height:1.25; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; color:var(--text); }
.tc-sg th small { display:block; font-weight:500; color:var(--text-3); font-size:.7rem; line-height:1.3; } .tc-sg th small.tc-item-d { font-size:.66rem; }
.tc-sg .tc-item-ctl { justify-content:center; margin-top:2px; } .tc-del { border:0; background:none; color:var(--text-3); cursor:pointer; padding:2px; border-radius:6px; line-height:0; } .tc-del:hover { color:var(--bad); background:var(--bad-soft); } .tc-del svg { width:14px; height:14px; }
.tc-sg .tc-cell { width:56px; min-height:36px; padding:5px; border:1.5px solid var(--line-strong); border-radius:8px; background:var(--surface); color:var(--text); font:600 .95rem var(--font-body); font-variant-numeric:tabular-nums; }
.tc-sg .tc-cell:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
@media (max-width:640px) { .tc-sg .stu-photo { display:none; } .tc-sg td.sticky { font-size:.8rem; padding:4px 6px; } .tc-sg th, .tc-sg td { padding:4px 5px; } .tc-sg .tc-cell { width:48px; } .tc-scores .att-savebar > .tiny { display:none; } }
.tc-sg .tc-cell.pending { background:#000; color:#fff; border-color:#000; font-weight:800; }
.tc-slot label { font-weight:normal; }
@media print { .tc-item-ctl, .att-savebar, .seg, .page-head .actions, .alert { display:none !important; } .tc-grid { font-size:11px; } }
.att-row.st-skip { background:var(--bad-soft); }
.att-opts .opt-skip input:checked + span { background:#8b1e1e; border-color:#8b1e1e; color:#fff; } .att-opts .opt-skip span small { font-size:.68rem; opacity:.85; }
/* สุ่มแบ่งกลุ่ม + เกมกลุ่ม */
.tc-game { position:relative; }
.tc-game.is-full { position:fixed; inset:0; z-index:60; margin:0; border-radius:0; overflow:auto; padding:18px 22px; background:var(--surface); }
.tc-groups { display:grid; gap:12px; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); margin-top:12px; }
.tc-game.is-full .tc-groups { grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); }
.tc-grp { border:2px solid var(--line); border-radius:16px; padding:10px 12px; background:var(--surface); position:relative; transition:transform .25s, border-color .25s; }
.tc-grp.is-lead { border-color:#e3a008; box-shadow:0 0 0 3px rgba(227,160,8,.18); } .tc-grp.is-called { border-color:var(--primary); transform:scale(1.03); }
.tc-grp .crown { position:absolute; top:-14px; right:12px; font-size:1.3rem; }
.tc-grp-head { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.tc-grp-name { flex:1; font-weight:800; font-size:1.05rem; border:0; background:transparent; color:var(--text); min-width:0; padding:2px 4px; border-radius:6px; } .tc-grp-name:focus { background:var(--bg-soft); outline:none; }
.tc-grp-score { font-size:1.9rem; font-weight:900; font-family:var(--font-display); min-width:44px; text-align:center; color:var(--primary); line-height:1; }
.tc-grp-score.bump { animation:tcbump .35s ease; } @keyframes tcbump { 0%{transform:scale(1)} 50%{transform:scale(1.5)} 100%{transform:scale(1)} }
.tc-grp-btns { display:flex; gap:4px; margin-bottom:6px; } .tc-grp-btns button { flex:1; min-height:34px; border-radius:10px; border:1.5px solid var(--line-strong); background:var(--surface); font-weight:800; cursor:pointer; color:var(--text); }
.tc-grp-btns button.plus { background:var(--ok-soft); color:var(--ok); border-color:transparent; } .tc-grp-btns button.minus { background:var(--bad-soft); color:var(--bad); border-color:transparent; }
.tc-grp-members { display:flex; flex-wrap:wrap; gap:6px; }
.tc-mem { display:flex; flex-direction:column; align-items:center; width:58px; font-size:.68rem; line-height:1.15; text-align:center; opacity:0; transform:translateY(14px) scale(.6); transition:opacity .35s, transform .35s; }
.tc-mem.in { opacity:1; transform:none; } .tc-mem.is-called { transform:scale(1.15); } .tc-mem.is-called img, .tc-mem.is-called .stu-initial { box-shadow:0 0 0 3px var(--primary); }
.tc-mem img, .tc-mem .stu-initial { width:44px; height:44px; border-radius:50%; object-fit:cover; display:inline-grid; }
.tc-game.is-full .tc-mem { width:74px; font-size:.8rem; } .tc-game.is-full .tc-mem img, .tc-game.is-full .tc-mem .stu-initial { width:60px; height:60px; }
.tc-pile { position:fixed; inset:0; z-index:70; display:grid; place-items:center; pointer-events:none; }
.tc-pile .tc-mem { position:absolute; opacity:1; transform:none; transition:transform .6s cubic-bezier(.3,1.3,.4,1), opacity .4s; }
.tc-pile.shuffle .tc-mem { animation:tcshake .5s infinite alternate; } @keyframes tcshake { from{transform:rotate(-8deg) translateX(-6px)} to{transform:rotate(8deg) translateX(6px)} }
.tc-callout { margin-top:10px; padding:14px; border-radius:14px; background:var(--info-soft); text-align:center; font-size:1.3rem; font-weight:800; }
.tc-podium { margin-top:14px; display:flex; gap:12px; align-items:flex-end; justify-content:center; flex-wrap:wrap; }
.tc-podium .pod { text-align:center; padding:10px; border-radius:14px 14px 0 0; min-width:150px; background:#eef0f3; color:#222; animation:tcrise .6s ease; }
.tc-podium .pod.p1 { background:#fff3c4; min-height:170px; } .tc-podium .pod.p2 { background:#e9edf2; min-height:140px; } .tc-podium .pod.p3 { background:#f6e0cf; min-height:120px; }
.tc-podium .pod b { display:block; font-size:1.1rem; } .tc-podium .pod .medal { font-size:2rem; } .tc-podium .pod .tc-grp-members { justify-content:center; margin-top:6px; }
@keyframes tcrise { from{transform:translateY(40px);opacity:0} to{transform:none;opacity:1} }
.tc-confetti { position:fixed; inset:0; pointer-events:none; z-index:80; overflow:hidden; } .tc-confetti i { position:absolute; top:-12px; width:10px; height:16px; animation:tcfall 2.6s linear forwards; }
@keyframes tcfall { to { transform:translateY(110vh) rotate(720deg); opacity:.2 } }
.tc-game-save { margin-top:12px; padding-top:10px; border-top:1px solid var(--line); } .tc-game-save .field span { font-size:.75rem; }
.tc-cell.is-empty { background:#fff6d6; border-color:#e3a008; } :root[data-theme="dark"] .tc-cell.is-empty { background:#3b3110; }
.tc-cell.is-filled { background:var(--ok-soft); } .tc-note { color:var(--text-3); white-space:nowrap; min-height:0; }
.tc-fill { border:0; border-radius:16px; padding:18px 20px; max-width:min(92vw, 460px); box-shadow:var(--shadow); } .tc-fill::backdrop { background:rgba(10,12,18,.5); }
.tc-fill-items label { display:flex; gap:8px; align-items:center; padding:5px 0; border-bottom:1px solid var(--line); font-size:.9rem; }
.lv-filelist { list-style:none; margin:4px 0 0; padding:0; } .lv-filelist li { display:flex; align-items:center; gap:6px; padding:3px 0; } .lv-file + .lv-file { border-top:1px solid var(--line); }
/* หนังสือราชการ + บันทึกข้อความของ ผอ. (ไปราชการ เสนอ สพท.) */
.lt-letter { position:relative; text-align:justify; text-justify:inter-cluster; }
.lt-letter .lt-krut { position:absolute; top:18mm; left:50%; transform:translateX(-50%); margin:0; } .lt-letter .lt-krut img { height:30mm; width:auto; display:block; }   /* ครุฑกึ่งกลางหน้ากระดาษ · ตีนครุฑอยู่ระดับบรรทัด ที่ / ชื่อส่วนราชการ */
.lt-head { display:flex; justify-content:space-between; align-items:flex-start; margin:23mm 0 3mm; } .lt-head .lt-addr { width:42%; text-align:left; }
.lt-date { margin:0 0 3mm 75mm !important; text-align:left; }   /* เริ่มที่กึ่งกลางหน้ากระดาษ = กึ่งกลางครุฑ */ .lt-lab { display:inline-block; min-width:14mm; }
.lt-letter .ld-p { text-align:justify; text-justify:inter-cluster; margin:2mm 0; }
.lt-sig { width:55%; margin:4mm 0 0 45%; text-align:center; } .lt-sig p { margin:0; } .lt-sig-img { display:flex; align-items:flex-end; justify-content:center; height:15mm; }
.lt-sig-img .esig-line { display:block; position:static; width:auto; height:auto; border-bottom:0; } .lt-sig-img .esig-line img { position:static; transform:none; display:block; height:14mm; width:auto; max-width:45mm; object-fit:contain; }   /* ลายเซ็นอยู่ในช่องของตัวเอง ไม่ลอยทับข้อความด้านบน */
.lt-foot { position:absolute; left:30mm; bottom:18mm; line-height:1.4; }
.lt-memo { position:relative; } .lt-frame { position:absolute; right:20mm; top:12mm; border:1.5px solid #000; padding:1mm 4mm; font-weight:700; text-align:center; line-height:1.25; }
.lt-chk { display:inline-block; min-width:8mm; } .lt-chk b { color:#000; }
.lt-memo p { margin:.8mm 0; }
.lt-sign2 { display:flex; gap:3mm; align-items:flex-start; justify-content:center; margin-top:3mm; } .lt-sign2-m { display:flex; flex-direction:column; align-items:center; width:60mm; } .lt-sign2-m .lt-sig-img { height:13mm; margin-bottom:-3mm; } .lt-sign2-m .lt-sig-img .esig-line img { height:12mm; }   /* ลายเซ็นวางบนเส้นจุด */ .lt-sign2-m .lt-dots { line-height:.6; } .lt-sign2-m .lt-name { margin-top:1mm; } .lt-sign2-l, .lt-sign2-r { padding-top:7mm; }
.lt-cmd { width:50%; margin:6mm 0 0 50%; text-align:left; } .lt-cmd p { margin:1mm 0; } .lt-cmd p b { display:block; }
.lt-memo .ld-memo-t { font-size:1.9em; } .lt-memo .ld-lab { font-size:1.25em; } .lt-plain { font-weight:400; }
.lt-line { display:flex; gap:2mm; margin:1mm 0; } .lt-line > .lt-lab { flex:none; } .lt-line > .lt-f { flex:1; min-width:0; }
.lt-f.is-editing { outline:1px dashed var(--primary); outline-offset:2px; border-radius:3px; cursor:text; display:inline; } div.lt-f.is-editing { display:block; } .lt-f.is-editing:empty::after { content:'…'; color:#999; } .lt-f.is-editing:focus { outline-style:solid; background:#fffbe6; }
.lt-editbar { position:sticky; top:52px; z-index:5; } .lt-editbar[hidden] { display:none; }
@media print { .lt-f { outline:0 !important; background:none !important; } }
.ld-p.tj { text-align:justify; } .tj-w { white-space:nowrap; }   /* thai-justify.js: ไทยกระจายซ้าย-ขวาเท่ากัน · บรรทัดสุดท้ายชิดซ้าย */
.lt-blank { display:inline-block; min-width:45mm; }
.lt-sign3 { display:flex; gap:2mm; align-items:flex-start; margin-top:8mm; } .lt-sign3-m { display:flex; flex-direction:column; align-items:center; }
.lt-f.is-editing:empty { display:inline-block; min-width:30mm; }

/* ปฐมวัย — ตั้งค่าหลักสูตร */
.ec-tree td { vertical-align:top; } .ec-tree td.tiny div { margin-bottom:3px; }
.ec-pick { max-height:460px; overflow:auto; border:1px solid var(--line); border-radius:12px; padding:8px 12px; } .ec-pick .check { padding:3px 0; }

/* ปฐมวัย — เครื่องมือครู */
.ec-ind { margin:0; padding-left:1.4em; font-size:.9rem; } .ec-ind li { margin:3px 0; }
.ec-grid td.sticky, .ec-grid th.sticky, .ec-cov td.sticky, .ec-cov th.sticky, .ec-growth td.sticky, .ec-growth th.sticky { position:sticky; left:0; background:var(--surface); z-index:2; white-space:nowrap; } .ec-grid thead th.sticky, .ec-cov thead th.sticky, .ec-growth thead th.sticky { z-index:3; background:var(--surface-2); }
.ec-grid th, .ec-grid td { padding:6px 8px; vertical-align:middle; } .ec-grid .stu-cell { gap:8px; } .ec-grid .stu-photo { width:32px; height:32px; border-radius:9px; }
.ec-lv { display:flex; flex-direction:column; align-items:center; gap:4px; min-width:92px; }
.ec-lv { --lvbg:var(--ok-soft); --lvfg:var(--ok); } .ec-lv.is-mid { --lvbg:var(--warn-soft); --lvfg:var(--warn); } .ec-lv.is-low { --lvbg:var(--bad-soft); --lvfg:var(--bad); }
.ec-lv .ec-opts { display:flex; } .ec-opt { position:relative; } .ec-opt input { position:absolute; opacity:0; inset:0; margin:0; cursor:pointer; }
.ec-opt span { display:inline-flex; align-items:center; justify-content:center; min-width:30px; height:30px; padding:0 6px; border:1.5px solid var(--line-strong); background:var(--surface); font-size:.85rem; cursor:pointer; margin-left:-1.5px; }
.ec-opts .ec-opt:first-child span { border-radius:8px 0 0 8px; margin-left:0; } .ec-opts .ec-opt:last-child span { border-radius:0 8px 8px 0; }
.ec-opt input:checked + span { background:var(--lvbg); color:var(--lvfg); border-color:var(--lvfg); font-weight:700; position:relative; z-index:1; }
.ec-lv .ec-note { width:100%; max-width:140px; font-size:.75rem; padding:3px 6px; min-height:0; } .ec-lv.is-off { opacity:.35; pointer-events:none; }
.ec-grid tr.is-absent td { background:var(--surface-2); } .ec-grid tr.is-exc td.sticky { box-shadow:inset 3px 0 0 var(--warn); }
.ec-thumb { width:56px; height:56px; object-fit:cover; border-radius:10px; flex:none; background:var(--surface-2); } .ec-preview { max-height:160px; max-width:220px; border-radius:12px; object-fit:cover; }
.ec-pickgrid { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:6px; }
.ec-pick { display:flex; align-items:center; gap:8px; padding:6px 8px; border:1.5px solid var(--line); border-radius:12px; cursor:pointer; font-size:.85rem; position:relative; } .ec-pick input { position:absolute; opacity:0; inset:0; margin:0; cursor:pointer; }
.ec-pick.is-on { border-color:var(--primary); background:var(--primary-soft); } .ec-pick .stu-photo { width:36px; height:36px; border-radius:10px; }
.ec-cov th, .ec-cov td { padding:4px 6px; } .ec-cell { font-size:.75rem; color:var(--text-3); } .ec-cell.is-ok { background:var(--ok-soft); color:var(--ok); font-weight:600; } .ec-foot td { border-top:2px solid var(--line-strong); }
.ec-num { width:84px; text-align:center; font-variant-numeric:tabular-nums; }
@media (max-width:640px) { .ec-grid .tiny.muted { display:none; } .ec-lv { min-width:84px; } .ec-opt span { min-width:26px; height:30px; } }
@media print { .ec-cov { font-size:9pt; } .ec-cell.is-ok { -webkit-print-color-adjust:exact; print-color-adjust:exact; } }

/* ปฐมวัย — สรุปสิ้นภาค + เอกสารพิมพ์ */
.ec-sum th, .ec-sum td { padding:6px 8px; } .ec-sumtbl td { padding:4px 6px; vertical-align:top; } .ec-sumtbl .tiny span { margin-right:6px; white-space:nowrap; }
.ec-rb { --fs:10pt; font-size:10pt; line-height:1.35; padding:10mm 12mm; height:auto; min-height:297mm; overflow:visible; break-after:page; }   /* ยาวเกิน → ไหลไปหน้าถัดไป ไม่ตัดทิ้ง */ .ec-cb { --fs:9.5pt; font-size:9.5pt; padding:10mm 12mm; } .ec-pf { padding:12mm 14mm; }
.a4.a4-land { width:297mm; height:210mm; }
.ec-rb-head { display:flex; gap:5mm; align-items:center; border-bottom:1.5px solid #333; padding-bottom:2mm; margin-bottom:2mm; } .ec-rb-head > img:first-child { width:18mm; height:18mm; object-fit:contain; } .ec-rb-head > div { flex:1; } .ec-rb-head .stu-photo { width:22mm; height:22mm; border-radius:3mm; }
.ec-rb-school { font-weight:700; font-size:1.15em; } .ec-rb-title { font-weight:700; font-size:1.25em; }
.ec-rb-who { margin-bottom:3mm; }
.ec-rb-tbl { width:100%; border-collapse:collapse; font-size:.9em; } .ec-rb-tbl th, .ec-rb-tbl td { border:1px solid #333; padding:.7mm 1.8mm; } .ec-rb-tbl th { background:#eee; } .ec-rb-tbl .c { text-align:center; } .ec-rb-dom td { background:#f4f4f4; font-weight:700; } .ec-rb-std { padding-left:6mm !important; }
.ec-rb-two { display:grid; grid-template-columns:1.3fr 1fr; gap:4mm; margin-top:2mm; font-size:.95em; } .ec-rb-h { font-weight:700; margin-top:2mm; } .ec-rb-text { white-space:pre-line; min-height:5mm; }
.ec-rb-parent { border:1px solid #333; min-height:14mm; padding:1.5mm 2mm; margin-top:1mm; } .ec-rb-lines { height:14mm; background:repeating-linear-gradient(to bottom, transparent 0, transparent 6.5mm, #999 6.5mm, #999 6.6mm); }
.ec-rb-sign { display:grid; grid-template-columns:repeat(3, 1fr); gap:4mm; margin-top:5mm; text-align:center; break-inside:avoid; } .ec-cb .ec-rb-sign { grid-template-columns:1fr 1fr; width:70%; margin-left:auto; }
.ec-cb-tbl { width:100%; border-collapse:collapse; } .ec-cb-tbl th, .ec-cb-tbl td { border:1px solid #333; padding:.8mm 1.2mm; text-align:center; } .ec-cb-tbl th { background:#eee; font-weight:700; } .ec-cb-tbl .l { text-align:left; } .ec-cb-tbl .r { text-align:right; } .ec-cb-tbl .b { font-weight:700; } .ec-cb-tbl .ec-low { background:#fde7e7; }
.ec-pf-grid { display:grid; grid-template-columns:1fr 1fr; gap:4mm; } .ec-pf-item { border:1px solid #ccc; border-radius:2mm; overflow:hidden; break-inside:avoid; } .ec-pf-item img { width:100%; height:58mm; object-fit:cover; display:block; } .ec-pf-nophoto { height:20mm; display:flex; align-items:center; justify-content:center; color:#999; background:#f5f5f5; } .ec-pf-cap { padding:1.5mm 2mm; font-size:.9em; }
@media print { .ec-rb, .ec-cb, .ec-pf { -webkit-print-color-adjust:exact; print-color-adjust:exact; } .a4.a4-land { page:land; } @page land { size:A4 landscape; } }

/* ปฐมวัย — ผู้ปกครอง */
.ec-par th, .ec-par td { padding:5px 8px; vertical-align:middle; } .ec-par .input-sm { font-size:.82rem; }
.ec-pdom { display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:8px; } .ec-pdom-i { padding:8px 10px; border:1px solid var(--line); border-radius:12px; } .ec-pdom-i b { font-size:1rem; }

/* ปฐมวัย รอบ 5 — ตัวเลือกตัวบ่งชี้ (การ์ดรายมาตรฐาน / ปุ่มเม็ด) · หน้าผู้ปกครองแบบขั้นตอน */
.ec-indpick-dom { font-weight:700; margin:14px 0 6px; padding-bottom:4px; border-bottom:2px solid var(--line-strong); } .ec-indpick-dom:first-child { margin-top:0; }
.ec-indpick-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:8px; }
.ec-indpick-std { border:1px solid var(--line); border-radius:12px; padding:8px 10px; background:var(--surface); } .ec-indpick-std.is-all { border-color:var(--primary); background:var(--primary-soft); }
.ec-indpick-sh { display:flex; gap:6px; align-items:baseline; font-size:.85rem; margin-bottom:4px; } .ec-indpick-sh span { flex:1; color:var(--text-2); } .ec-indpick-sh .btn { padding:0 6px; min-height:22px; }
.ec-indpick .check { padding:3px 0; align-items:flex-start; } .ec-indpick .check input { margin-top:3px; }
.ec-chips-h { font-size:.8rem; font-weight:600; color:var(--text-2); margin:8px 0 4px; } .ec-chips-row { display:flex; flex-wrap:wrap; gap:6px; }
.ec-chip { display:inline-flex; gap:4px; align-items:center; padding:5px 10px; border:1.5px solid var(--line); border-radius:999px; font-size:.82rem; cursor:pointer; position:relative; line-height:1.3; background:var(--surface); }
.ec-chip input { position:absolute; opacity:0; inset:0; margin:0; cursor:pointer; } .ec-chip.is-on { border-color:var(--primary); background:var(--primary-soft); color:var(--primary); font-weight:600; }
.ec-chips-more summary { cursor:pointer; margin-top:8px; }
.ec-par-steps { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:8px; } .ec-par-step { display:flex; gap:10px; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:12px; }
.ec-par-step .n { width:30px; height:30px; border-radius:50%; background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; flex:none; } .ec-par-step b { display:block; font-size:.9rem; } .ec-par-step .tiny { color:var(--text-2); }
.ec-parrow { display:grid; grid-template-columns:200px 1fr; gap:6px 14px; padding:10px 0; border-top:1px solid var(--line); align-items:start; } .ec-parrow:first-child { border-top:0; }
.ec-parrow .ec-parline { display:flex; flex-wrap:wrap; gap:6px 10px; align-items:center; font-size:.88rem; } .ec-parrow .input-sm { min-height:32px; width:auto; }
.ec-parrow .ec-parstat { font-size:.85rem; display:flex; flex-wrap:wrap; gap:6px 14px; align-items:center; }
@media (max-width:640px) { .ec-parrow { grid-template-columns:1fr; } }
.ec-unit-blank { border:1.5px dashed var(--warn); }
/* เอกสารพิมพ์ รอบ 5: แบบบันทึกความครอบคลุม · แบบบันทึกผลรายหน่วย (ไม่พึ่งสีพื้น) */
.ec-cv-tbl { width:100%; border-collapse:collapse; font-size:8.5pt; } .ec-cv-tbl th, .ec-cv-tbl td { border:1px solid #333; padding:.6mm 1mm; text-align:center; } .ec-cv-tbl th { background:#eee; } .ec-cv-tbl .l { text-align:left; white-space:nowrap; } .ec-cv-tbl .r { text-align:right; }
.ec-cv-tbl .v { writing-mode:vertical-rl; transform:rotate(180deg); white-space:nowrap; font-size:7.5pt; padding:1mm .5mm; }
.ec-step { display:flex; gap:8px; align-items:center; font-weight:600; font-size:.9rem; margin:10px 0 6px; } .ec-step > b { width:24px; height:24px; border-radius:50%; background:var(--primary); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-size:.8rem; flex:none; }
.ec-ut .ec-rb-tbl td, .ec-ut .ec-rb-tbl th { padding:.3mm 1.5mm; } .ec-ut .ec-rb-sign { margin-top:3mm; }
.ec-cv .ec-rb-sign { margin-top:3mm; } .ec-cv.a4 { height:auto; min-height:210mm; overflow:visible; }
.ec-ut { --fs:9.5pt; font-size:9.5pt; } .ec-ut .ec-ind { font-size:.85em; } .ec-ut .ec-rb-tbl td, .ec-ut .ec-rb-tbl th { padding:.2mm 1.5mm; } .ec-ut .ec-rb-head { margin-bottom:1mm; }
.ec-cv .ec-cv-tbl td, .ec-cv .ec-cv-tbl th { padding:.25mm .8mm; line-height:1.25; } .ec-cv .ec-rb-head { margin-bottom:1mm; padding-bottom:1mm; } .ec-cv .ec-rb-sign { margin-top:2mm; }
.ec-cv.a4 { padding:7mm 9mm 6mm; }
/* ปฐมวัย รอบ 5b — เอกสารหลักฐาน (เทียบ ปพ.) */
.ec-dh-code { align-self:flex-start; flex:none; margin-left:auto; border:1px solid #333; padding:.5mm 2mm; font-weight:700; font-size:.9em; white-space:nowrap; }
.ec-doc-no { text-align:right; font-size:.9em; margin:1mm 0 2mm; }
.ec-kv { width:100%; border-collapse:collapse; font-size:.92em; margin-bottom:2mm; } .ec-kv th, .ec-kv td { border:1px solid #333; padding:.6mm 1.8mm; vertical-align:top; } .ec-kv th { background:#eee; text-align:left; font-weight:600; white-space:nowrap; width:22%; }
.ec-doc .ec-rb-sign { margin-top:4mm; }
.ec-roll-tbl { width:100%; border-collapse:collapse; font-size:8.5pt; } .ec-roll-tbl th, .ec-roll-tbl td { border:1px solid #333; padding:.4mm 1mm; text-align:center; } .ec-roll-tbl th { background:#eee; } .ec-roll-tbl .l { text-align:left; white-space:nowrap; }
.ec-letter { font-family:'TH Sarabun New','Sarabun',sans-serif; font-size:16pt; line-height:1.5; padding:15mm 20mm 20mm 30mm; } .ec-letter h1 { text-align:center; font-size:18pt; font-weight:700; margin:0 0 4mm; }
.ec-letter .lt-body { text-indent:2.5cm; text-align:justify; text-align-last:left; margin:0 0 2mm; } .ec-letter .lt-row { display:flex; gap:4mm; margin:1mm 0; } .ec-letter .lt-row > b { flex:none; width:32mm; }
.ec-letter .lt-sign { width:55%; margin-left:auto; text-align:center; margin-top:10mm; } .ec-letter .lt-foot { position:absolute; bottom:12mm; left:30mm; font-size:13pt; line-height:1.3; }
/* ปก + ลายเซ็นอิเล็กทรอนิกส์ เอกสารปฐมวัย · ตารางแนวตั้ง */
.ec-cover { position:relative; display:flex; flex-direction:column; align-items:center; text-align:center; padding:30mm 20mm 20mm; font-size:14pt; }
.ec-cover-code { position:absolute; top:12mm; right:14mm; border:1.5px solid #333; padding:1mm 4mm; font-weight:700; font-size:13pt; }
.ec-cover-logo { width:42mm; height:42mm; object-fit:contain; margin-bottom:8mm; }
.ec-cover-school { font-size:20pt; font-weight:700; } .ec-cover-title { font-size:24pt; font-weight:700; margin:14mm 0 3mm; line-height:1.3; } .ec-cover-sub { font-size:13pt; color:#333; }
.ec-cover-photo { margin:12mm 0 4mm; } .ec-cover-photo .stu-photo { width:38mm; height:38mm; border-radius:6mm; } .ec-cover-name { font-size:20pt; font-weight:700; }
.ec-cover-lines { margin-top:10mm; font-size:15pt; line-height:1.7; } .ec-cover-foot { position:absolute; bottom:18mm; left:0; right:0; font-size:12pt; line-height:1.4; color:#333; }
.ec-esig { display:flex; gap:8px; align-items:center; flex-wrap:wrap; width:210mm; margin:0 auto 6px; padding:6px 10px; background:var(--surface); border-radius:10px; font-size:.85rem; } .ec-esig b { flex:1; }
.ec-doc .ec-rb-sign .sgc-r, .ec-cb .ec-rb-sign .sgc-r { min-height:12mm; display:inline-flex; align-items:flex-end; } .ec-rb-sign .esig-line { border-bottom:0; width:auto; } .ec-rb-sign .esig-line img { position:static; transform:none; display:block; height:11mm; max-width:38mm; margin:0 auto; }
.ec-pt .ec-roll-tbl, .ec-pt .ec-cb-tbl { font-size:8pt; } .ec-pt .ec-roll-tbl th, .ec-pt .ec-roll-tbl td { padding:.3mm .6mm; } .ec-pt .ec-cb-tbl th, .ec-pt .ec-cb-tbl td { padding:.4mm .8mm; }
.ec-pt.ec-rb { padding:8mm 10mm; }
.ec-doclist td { vertical-align:middle; } .ec-doclist .btn-sm { min-width:110px; justify-content:center; }
.ec-rb-head > div.ec-dh-code { flex:none; }
/* แบบขีดรายเดือนปฐมวัย (แบบ ปพ.5 · A4 แนวตั้ง) */
.ec-tick-tbl { width:100%; border-collapse:collapse; table-layout:fixed; font-size:7pt; } .ec-tick-tbl th, .ec-tick-tbl td { border:1px solid #333; padding:.3mm 0; text-align:center; line-height:1.25; overflow:hidden; }
.ec-tick-tbl th { background:#eee; font-weight:600; } .ec-tick-tbl .l { text-align:left; padding-left:1mm; width:34mm; white-space:nowrap; } .ec-tick-tbl .no { width:5mm; } .ec-tick-tbl .t { width:5.5mm; } .ec-tick-tbl .b { font-weight:700; }
.ec-tick-tbl .ab { font-size:6pt; font-weight:400; } .ec-tick-tbl .wk { background:#d9d9d9; } .ec-tick-tbl th.hd { background:#e9e9e9; } .ec-tick-tbl .nc { color:#999; }
.ec-tick-tbl td.hol { background:#f2f2f2; vertical-align:middle; padding:1mm 0; } .ec-tick-tbl td.hol span { writing-mode:vertical-rl; font-size:6.5pt; white-space:nowrap; display:inline-block; max-height:100%; }
@media print { .ec-tick-tbl .wk, .ec-tick-tbl td.hol, .ec-tick-tbl th { -webkit-print-color-adjust:exact; print-color-adjust:exact; } }

/* เว็บไซต์โรงเรียน (www) — ทำเนียบบุคลากร · สถิตินักเรียน · ปฏิทิน · ผู้บริหาร · ลิงก์ */
.ws-staff { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:16px; }
.ws-staff.is-exec { grid-template-columns:repeat(auto-fit, minmax(180px, 220px)); justify-content:center; }
.ws-person { margin:0; text-align:center; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-lg); padding:14px 10px; display:flex; flex-direction:column; align-items:center; gap:8px; }
.ws-person img, .ws-noimg { width:112px; height:112px; border-radius:50%; object-fit:cover; background:var(--surface-2); display:flex; align-items:center; justify-content:center; color:var(--text-3); }
.ws-staff.is-exec .ws-person img, .ws-staff.is-exec .ws-noimg { width:150px; height:150px; }
.ws-noimg .icon { width:44px; height:44px; }
.ws-person figcaption { display:flex; flex-direction:column; gap:2px; } .ws-person b { font-size:.95rem; } .ws-person span { font-size:.82rem; color:var(--text-2); } .ws-person small { font-size:.75rem; color:var(--text-3); }
.ws-leaders { display:grid; gap:20px; align-items:center; } @media (min-width:900px) { .ws-leaders { grid-template-columns:auto 1fr; } .ws-leaders .ws-staff.is-exec { justify-content:start; } }
.ws-quote { margin:0; padding:22px 26px; border-left:4px solid var(--primary); font-size:1rem; line-height:1.7; } .ws-quote footer { margin-top:8px; color:var(--text-2); font-size:.9rem; }
.ws-cal { list-style:none; margin:0; padding:0; display:grid; gap:10px; } .ws-cal li { display:flex; gap:14px; align-items:center; padding:12px 16px; } .ws-cal li > div { flex:1; min-width:0; }
.ws-cal-d { width:54px; flex:none; text-align:center; border-radius:12px; background:var(--primary-soft); color:var(--primary); padding:6px 0; line-height:1.1; } .ws-cal-d b { display:block; font-size:1.35rem; font-family:var(--font-display); } .ws-cal-d small { font-size:.75rem; }
.ws-stat td, .ws-stat th { vertical-align:middle; } .ws-bar-col { width:38%; } .ws-bar { display:flex; height:12px; border-radius:6px; overflow:hidden; background:var(--surface-2); } .ws-bar i { display:block; height:100%; }
.ws-bar .m, .ws-key.m { background:var(--navy-500); } .ws-bar .f, .ws-key.f { background:var(--coral-600); } .ws-key { display:inline-block; width:10px; height:10px; border-radius:3px; vertical-align:middle; }
@media (max-width:640px) { .ws-bar-col { display:none; } }
.ws-links { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:10px; } .ws-links a { display:flex; gap:10px; align-items:center; padding:12px 14px; font-size:.9rem; }
.ws-admins { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:6px; }
.ws-hero { background:linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 55%, #1b2a4a) 100%); color:#fff; padding:clamp(32px, 6vw, 72px) 0; }
.ws-hero .container { display:flex; gap:24px; align-items:center; flex-wrap:wrap; } .ws-hero img { width:clamp(84px, 12vw, 120px); height:auto; background:#fff; border-radius:50%; padding:6px; }
.ws-hero h1 { color:#fff; margin:0; font-size:clamp(1.6rem, 1.1rem + 2.4vw, 2.8rem); } .ws-hero p { margin:.3em 0 0; opacity:.9; font-size:clamp(.95rem, .85rem + .5vw, 1.2rem); }
.main-nav a { white-space:nowrap; } @media (max-width:1280px) { .main-nav a { padding:8px 10px; } } .site-header .brand small { max-width:340px; }
@media (max-width:640px) { .ws-staff, .ws-staff.is-exec { grid-template-columns:repeat(2, 1fr); gap:10px; } .ws-person img, .ws-noimg, .ws-staff.is-exec .ws-person img, .ws-staff.is-exec .ws-noimg { width:96px; height:96px; } }
.ws-thumb { width:40px; height:40px; border-radius:50%; object-fit:cover; vertical-align:middle; background:var(--surface-2); }
.ws-sub td { background:var(--surface-2); }
.ws-years { display:flex; gap:clamp(10px, 4vw, 36px); align-items:flex-end; justify-content:center; height:200px; padding-top:10px; }
.ws-yr { display:flex; flex-direction:column; align-items:center; gap:4px; height:100%; justify-content:flex-end; } .ws-yr-n { font-weight:700; font-size:.9rem; }
.ws-yr-bar { width:clamp(28px, 6vw, 46px); height:150px; display:flex; flex-direction:column; justify-content:flex-end; border-radius:8px 8px 0 0; overflow:hidden; background:var(--surface-2); } .ws-yr-bar i { display:block; width:100%; }
.ws-yr-bar .m { background:var(--navy-500); } .ws-yr-bar .f { background:var(--coral-600); }
.ws-order tr.ws-moved td { background:var(--primary-soft); transition:background .3s; } .ws-order td { vertical-align:middle; }
/* หน้าข้อมูลพื้นฐาน (เว็บไซต์) */
.ws-page-wrap { display:grid; gap:20px; align-items:start; } @media (min-width:900px) { .ws-page-wrap { grid-template-columns:1fr 260px; } }
.ws-page { padding:clamp(16px, 3vw, 32px); line-height:1.75; overflow-x:auto; } .ws-page img { max-width:100%; height:auto; border-radius:8px; }
.ws-page table { border-collapse:collapse; width:100%; margin:12px 0; font-size:.92rem; } .ws-page td, .ws-page th { border:1px solid var(--line); padding:6px 10px; vertical-align:top; }
.ws-page .ws-center { text-align:center; } .ws-page .ws-right { text-align:right; } .ws-page h2, .ws-page h3 { margin-top:1em; }
.ws-drive { margin:10px 0 18px; } .ws-drive iframe { width:100%; height:min(80vh, 900px); border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
.ws-page-nav { display:flex; flex-direction:column; gap:2px; padding:14px; position:sticky; top:80px; } .ws-page-nav b { margin-bottom:6px; }
.ws-page-nav a { padding:6px 10px; border-radius:8px; color:var(--text-2); text-decoration:none; font-size:.9rem; } .ws-page-nav a:hover, .ws-page-nav a.is-active { background:var(--primary-soft); color:var(--primary); }
.ws-works { list-style:none; padding:0; display:grid; gap:10px; } .ws-works li a { display:block; padding:14px 16px; border:1px solid var(--line); border-radius:12px; text-decoration:none; }

/* ===================== เว็บไซต์โรงเรียน (ปรับใหม่ 1 พ.ย. 2569) — sv-* =====================
   สีหลัก = --primary (สีโรงเรียน ตั้งที่ จัดการเว็บไซต์ → โทนสี) · เส้นทอง = --sv-gold · ใช้เฉพาะโหมดเว็บไซต์ */
:root { --sv-gold:#e2b23a; --sv-deep:color-mix(in srgb, var(--primary) 70%, #000); --sv-radius:14px; }
:root[data-theme="dark"] { --sv-deep:color-mix(in srgb, var(--primary) 35%, #0b0b0f); }
.sv-top { background:var(--sv-deep); color:#fff; font-size:.84rem; }
.sv-top .container { display:flex; align-items:center; gap:18px; min-height:38px; }
.sv-top a { color:#fff; opacity:.92; text-decoration:none; display:inline-flex; align-items:center; gap:6px; }
.sv-top a:hover { opacity:1; text-decoration:underline; }
.sv-top .icon { width:15px; height:15px; }
.sv-top .lang-switch { color:#fff; border-color:rgba(255,255,255,.35); padding:2px 10px; min-height:0; background:transparent; }
.sv-head { background:var(--surface); }
.sv-head .container { display:flex; align-items:center; gap:16px; padding-block:14px; }
.sv-brand { display:flex; align-items:center; gap:14px; text-decoration:none; color:var(--text); min-width:0; }
.sv-brand img { width:64px; height:64px; object-fit:contain; flex:none; }
.sv-brand b { display:block; font-family:var(--font-display); font-size:clamp(1.1rem, .9rem + 1vw, 1.55rem); line-height:1.25; color:var(--sv-deep); }
:root[data-theme="dark"] .sv-brand b { color:var(--text); }
.sv-brand small { display:block; color:var(--text-2); font-size:.88rem; }
.sv-brand.is-sm img { width:40px; height:40px; } .sv-brand.is-sm b { font-size:1rem; }
.sv-search { margin-left:auto; display:flex; align-items:center; border:1px solid var(--line-strong); border-radius:999px; background:var(--surface); padding:2px 2px 2px 14px; width:min(300px, 100%); }
.sv-search .input { border:0; background:transparent; min-height:38px; padding:0; box-shadow:none; flex:1; min-width:0; }
.sv-search .btn { min-height:36px; width:36px; padding:0; border-radius:999px; background:var(--primary); color:var(--primary-ink); }
.sv-search.is-drawer { margin:0 0 10px; width:100%; }
.sv-search.is-inline { margin-left:auto; }
.sv-burger { display:none; margin-left:auto; }
.sv-nav { position:sticky; top:0; z-index:45; background:var(--primary); border-bottom:3px solid var(--sv-gold); box-shadow:0 2px 10px rgba(0,0,0,.08); }
.sv-nav .container { display:flex; flex-wrap:wrap; }
.sv-link { display:inline-flex; align-items:center; gap:4px; padding:13px 16px; color:var(--primary-ink); font-weight:600; text-decoration:none; white-space:nowrap; }
.sv-link .icon { width:14px; height:14px; opacity:.8; }
.sv-link:hover, .sv-link.is-active, .sv-dd:hover > .sv-link, .sv-dd:focus-within > .sv-link { background:rgba(0,0,0,.16); color:#fff; }
.sv-dd { position:relative; }
.sv-menu { position:absolute; left:0; top:100%; min-width:240px; background:var(--surface); border:1px solid var(--line); border-top:3px solid var(--sv-gold); border-radius:0 0 12px 12px; box-shadow:0 16px 36px rgba(0,0,0,.14); padding:8px; display:none; z-index:60; }
.sv-dd.is-wide .sv-menu { min-width:520px; columns:2; column-gap:8px; }
.sv-dd:hover .sv-menu, .sv-dd:focus-within .sv-menu { display:block; }
.sv-menu a { display:block; padding:8px 12px; border-radius:8px; color:var(--text); text-decoration:none; break-inside:avoid; font-size:.95rem; }
.sv-menu a:hover { background:var(--primary-soft); color:var(--sv-deep); }
.sv-drawer details.sv-group > summary { list-style:none; display:flex; justify-content:space-between; align-items:center; padding:12px 14px; border-radius:12px; font-weight:500; cursor:pointer; }
.sv-drawer details.sv-group > summary::-webkit-details-marker { display:none; }
.sv-drawer details[open] > summary .icon { transform:rotate(180deg); }
.sv-drawer a.nav-item.sv-sub { padding:9px 14px 9px 28px; font-size:.93rem; color:var(--text-2); }
@media (max-width:959px) {
  .sv-nav { display:none; }
  .sv-head .sv-search { display:none; }
  .sv-burger { display:inline-flex; }
  .sv-head { position:sticky; top:0; z-index:45; border-bottom:3px solid var(--primary); }
  .sv-brand img { width:48px; height:48px; }
}
@media (max-width:640px) { .sv-hide-sm { display:none !important; } .sv-top .container { gap:12px; } }

/* ภาพหัวหน้าแรก (เมื่อยังไม่มีแบนเนอร์) */
.sv-hero { position:relative; color:#fff; background:linear-gradient(100deg, color-mix(in srgb, var(--sv-deep) 92%, transparent) 0%, color-mix(in srgb, var(--sv-deep) 55%, transparent) 60%, rgba(0,0,0,.25) 100%), var(--sv-hero-img, linear-gradient(135deg, var(--primary), var(--sv-deep))) center/cover no-repeat; }
.sv-hero .container { display:flex; align-items:center; gap:clamp(16px, 3vw, 32px); min-height:clamp(260px, 34vw, 400px); padding-block:32px; }
.sv-hero img { width:clamp(84px, 11vw, 132px); height:auto; filter:drop-shadow(0 6px 16px rgba(0,0,0,.35)); flex:none; }
.sv-hero h1 { color:#fff; font-size:clamp(1.6rem, 1.1rem + 2.4vw, 2.9rem); margin:0 0 6px; text-shadow:0 2px 12px rgba(0,0,0,.3); }
.sv-motto { font-size:clamp(1rem, .9rem + .5vw, 1.25rem); opacity:.95; margin:0 0 18px; border-left:4px solid var(--sv-gold); padding-left:12px; }
.sv-hero-cta { display:flex; gap:10px; flex-wrap:wrap; }
.sv-btn-light { background:rgba(255,255,255,.14); color:#fff; border:1.5px solid rgba(255,255,255,.6); }
.sv-btn-light:hover { background:rgba(255,255,255,.24); color:#fff; }
.sv-slider.hero { background:none; }
@media (max-width:640px) { .sv-hero .container { flex-direction:column; text-align:center; } .sv-motto { border-left:0; padding-left:0; } .sv-hero-cta { justify-content:center; } }

/* ส่วนต่าง ๆ */
.sv-sec { padding:44px 0; }
.sv-sec.is-tight { padding:24px 0; }
.sv-sec.is-soft { background:var(--bg-soft); }
.sv-sec-head { display:flex; align-items:center; gap:12px 18px; flex-wrap:wrap; margin-bottom:20px; }
.sv-sec-head h2 { margin:0; font-size:clamp(1.3rem, 1.1rem + .8vw, 1.7rem); padding-left:14px; border-left:5px solid var(--primary); line-height:1.2; }
.sv-more { display:inline-flex; align-items:center; gap:6px; font-weight:600; color:var(--primary); text-decoration:none; margin-left:auto; }
.sv-more:hover { text-decoration:underline; }
.sv-more .icon { width:16px; height:16px; }
.sv-chips { display:flex; flex-wrap:wrap; gap:6px; }
.sv-chips a { padding:5px 14px; border:1px solid var(--line-strong); border-radius:999px; color:var(--text-2); text-decoration:none; font-size:.9rem; background:var(--surface); }
.sv-chips a:hover { border-color:var(--primary); color:var(--primary); }
.sv-chips a.is-active { background:var(--primary); border-color:var(--primary); color:var(--primary-ink); }
.sv-kicker { display:flex; align-items:center; gap:10px; font-family:var(--font-display); font-size:1.2rem; color:var(--sv-deep); margin-bottom:14px; }
:root[data-theme="dark"] .sv-kicker { color:var(--text); }
.sv-kicker::before { content:""; width:5px; height:1.2em; background:var(--primary); border-radius:3px; }
.sv-box { background:var(--surface); border:1px solid var(--line); border-radius:var(--sv-radius); padding:clamp(16px, 2.4vw, 26px); display:flex; flex-direction:column; }
.sv-box > h2 { font-size:1.2rem; margin-bottom:14px; }
.sv-noimg { display:flex; align-items:center; justify-content:center; background:var(--primary-soft); color:var(--primary); width:100%; height:100%; }
.sv-noimg .icon { width:34%; height:auto; aspect-ratio:1; max-width:64px; opacity:.7; }

/* ข่าวหน้าแรก: ข่าวเด่น + ข่าวรอง */
.sv-news { display:grid; gap:18px; }
@media (min-width:900px) { .sv-news { grid-template-columns:1.35fr 1fr; } }
.sv-feat { position:relative; display:block; border-radius:var(--sv-radius); overflow:hidden; aspect-ratio:16/10; background:var(--primary-soft); color:#fff; text-decoration:none; }
.sv-feat img { width:100%; height:100%; object-fit:cover; display:block; transition:transform .4s var(--ease); }
.sv-feat:hover img { transform:scale(1.03); }
.sv-feat-text { position:absolute; inset:auto 0 0 0; padding:56px 20px 18px; background:linear-gradient(transparent, rgba(0,0,0,.78)); display:flex; flex-direction:column; gap:6px; }
.sv-feat-text b { font-size:clamp(1.05rem, .95rem + .6vw, 1.35rem); line-height:1.4; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.sv-feat-text small { display:inline-flex; gap:6px; align-items:center; opacity:.9; } .sv-feat-text .icon { width:14px; height:14px; }
.sv-tag { align-self:flex-start; background:var(--sv-gold); color:#3b2a00; font-size:.78rem; font-weight:700; padding:2px 10px; border-radius:999px; }
.sv-news-list { display:grid; gap:12px; align-content:start; }
.sv-news-item { display:flex; gap:14px; align-items:flex-start; padding:10px; border-radius:12px; background:var(--surface); border:1px solid var(--line); text-decoration:none; color:var(--text); transition:border-color .15s, box-shadow .15s; }
.sv-news-item:hover { border-color:var(--primary); box-shadow:var(--shadow-sm); }
.sv-news-item img, .sv-news-item .sv-noimg { width:128px; aspect-ratio:16/10; height:auto; object-fit:cover; border-radius:8px; flex:none; }
.sv-news-item b { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; line-height:1.45; font-weight:600; }
.sv-news-item small { display:block; color:var(--text-3); margin-top:4px; font-size:.82rem; }
@media (max-width:480px) { .sv-news-item img, .sv-news-item .sv-noimg { width:96px; } }

/* สารผู้อำนวยการ + กิจกรรม */
.sv-pair { display:grid; gap:20px; }
@media (min-width:900px) { .sv-pair { grid-template-columns:1.5fr 1fr; } .sv-pair.is-single { grid-template-columns:1fr; } }
.sv-dir-body { display:flex; gap:20px; align-items:flex-start; flex:1; }
.sv-dir-body > img, .sv-dir-body > .sv-noimg { width:clamp(140px, 16vw, 180px); aspect-ratio:4/5; height:auto; object-fit:cover; border-radius:12px; flex:none; border:3px solid var(--surface); box-shadow:0 0 0 2px var(--sv-gold); }
.sv-dir blockquote { margin:0 0 12px; color:var(--text-2); line-height:1.8; }
.sv-dir blockquote p { margin:0 0 .6em; }
.sv-dir-name b { display:block; } .sv-dir-name span { color:var(--text-3); font-size:.92rem; }
.sv-dir .sv-more, .sv-events .sv-more { margin-top:14px; }
@media (max-width:560px) { .sv-dir-body { flex-direction:column; align-items:center; text-align:center; } }
.sv-events ul { list-style:none; margin:0; padding:0; display:grid; gap:10px; flex:1; }
.sv-events li { display:flex; gap:12px; align-items:center; }
.sv-events li b { font-weight:600; line-height:1.4; } .sv-events li small { display:block; color:var(--text-3); font-size:.82rem; }
.sv-date { flex:none; width:54px; text-align:center; border-radius:10px; overflow:hidden; border:1px solid var(--line); background:var(--surface); }
.sv-date b { display:block; font-size:1.3rem; line-height:1.5; color:var(--sv-deep); font-weight:700 !important; }
:root[data-theme="dark"] .sv-date b { color:var(--text); }
.sv-date small { display:block; background:var(--primary); color:var(--primary-ink) !important; font-size:.74rem !important; line-height:1.6; }

/* ตัวเลขโรงเรียน · ลิงก์ */
.sv-facts { display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); border-radius:var(--sv-radius); overflow:hidden; background:var(--primary); color:var(--primary-ink); text-decoration:none; }
.sv-facts span { padding:18px 12px; text-align:center; border-right:1px solid rgba(255,255,255,.18); }
.sv-facts span:last-child { border-right:0; }
.sv-facts b { display:block; font-size:clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); font-family:var(--font-display); line-height:1.2; color:#fff; }
.sv-facts small { opacity:.9; }
.sv-facts:hover { filter:brightness(1.05); }
.sv-links { display:grid; grid-template-columns:repeat(auto-fill, minmax(210px, 1fr)); gap:10px; }
.sv-links a { display:flex; align-items:center; gap:10px; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--text); text-decoration:none; font-weight:500; }
.sv-links a:hover { border-color:var(--primary); color:var(--primary); }
.sv-links .icon { color:var(--primary); flex:none; }

/* หัวหน้าย่อย · เนื้อหา + เมนูข้าง */
.sv-pagehead { background:linear-gradient(100deg, var(--primary-soft), var(--bg)); border-bottom:1px solid var(--line); padding:22px 0 20px; }
.sv-pagehead h1 { margin:6px 0 0; font-size:clamp(1.4rem, 1.1rem + 1.4vw, 2.1rem); color:var(--sv-deep); }
:root[data-theme="dark"] .sv-pagehead h1 { color:var(--text); }
.sv-pagehead p { margin:6px 0 0; color:var(--text-2); }
.sv-crumbs { display:flex; flex-wrap:wrap; align-items:center; gap:4px; font-size:.86rem; color:var(--text-3); }
.sv-crumbs a { color:var(--text-2); text-decoration:none; } .sv-crumbs a:hover { color:var(--primary); text-decoration:underline; }
.sv-crumbs .icon { width:13px; height:13px; }
.sv-split { display:grid; gap:24px; align-items:start; }
@media (min-width:960px) { .sv-split { grid-template-columns:minmax(0, 1fr) 280px; } }
.sv-article { background:var(--surface); border:1px solid var(--line); border-radius:var(--sv-radius); padding:clamp(18px, 3vw, 36px); line-height:1.8; min-width:0; }
.sv-article .ws-page { padding:0; }
.sv-article h2 { font-size:1.25rem; margin-top:1.4em; padding-left:12px; border-left:4px solid var(--primary); }
.sv-article > h2:first-child { margin-top:0; }
.sv-quote { margin:0; padding:16px 20px; background:var(--primary-soft); border-radius:12px; font-size:1.08rem; color:var(--sv-deep); }
:root[data-theme="dark"] .sv-quote { color:var(--text); }
.sv-side { display:flex; flex-direction:column; background:var(--surface); border:1px solid var(--line); border-radius:var(--sv-radius); overflow:hidden; }
@media (min-width:960px) { .sv-side { position:sticky; top:62px; max-height:calc(100vh - 80px); overflow-y:auto; } }
.sv-side b { background:var(--primary); color:var(--primary-ink); padding:12px 16px; font-family:var(--font-display); }
.sv-side a { padding:10px 16px; border-bottom:1px solid var(--line); color:var(--text); text-decoration:none; font-size:.95rem; }
.sv-side a:last-child { border-bottom:0; }
.sv-side a:hover { background:var(--primary-soft); }
.sv-side a.is-active { background:var(--primary-soft); color:var(--sv-deep); font-weight:600; box-shadow:inset 4px 0 0 var(--primary); }

/* ข่าว: แถบเครื่องมือ · แบ่งหน้า */
.sv-toolbar { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-bottom:22px; }
.sv-pager { display:flex; justify-content:center; align-items:center; gap:12px; margin-top:26px; }

/* บุคลากร */
.sv-group-title { display:flex; align-items:center; gap:10px; font-size:1.25rem; margin:34px 0 16px; padding-bottom:8px; border-bottom:2px solid var(--line); scroll-margin-top:70px; }
.sv-group-title::before { content:""; width:5px; height:1.1em; background:var(--primary); border-radius:3px; }
.sv-group-title span { font-size:.8rem; background:var(--primary-soft); color:var(--sv-deep); border-radius:999px; padding:1px 10px; font-family:var(--font-body); }
.sv-chart { display:flex; justify-content:center; margin-bottom:18px; }
.sv-people { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap:16px; }
.sv-people.is-center { display:flex; flex-wrap:wrap; justify-content:center; }
.sv-people.is-center .sv-person { width:190px; }
.sv-person { margin:0; background:var(--surface); border:1px solid var(--line); border-radius:var(--sv-radius); overflow:hidden; text-align:center; display:flex; flex-direction:column; }
.sv-person img, .sv-person .sv-noimg { width:100%; aspect-ratio:4/5; height:auto; object-fit:cover; object-position:top; background:var(--primary-soft); }
.sv-person img { display:block; }
.sv-person figcaption { padding:10px 10px 14px; display:flex; flex-direction:column; gap:2px; border-top:3px solid var(--primary); flex:1; }
.sv-person b { font-size:.95rem; line-height:1.4; }
.sv-person span { color:var(--text-2); font-size:.85rem; } .sv-person small { color:var(--text-3); font-size:.8rem; }
.sv-person.is-big { width:240px; } .sv-person.is-big figcaption { border-top-color:var(--sv-gold); } .sv-person.is-big b { font-size:1.05rem; }

/* ติดต่อเรา */
.sv-contact { display:grid; gap:20px; align-items:start; }
@media (min-width:900px) { .sv-contact { grid-template-columns:1fr 1fr; } }
.sv-info { list-style:none; margin:0; padding:0; display:grid; gap:12px; }
.sv-info li { display:flex; gap:12px; align-items:flex-start; }
.sv-info .icon { color:var(--primary); flex:none; margin-top:3px; }
.sv-form { gap:4px; }
.sv-form .btn { align-self:flex-start; margin-top:8px; }
.sv-hp { position:absolute !important; left:-9999px; width:1px; height:1px; overflow:hidden; }

/* ท้ายเว็บ */
.sv-foot { background:var(--sv-deep); color:rgba(255,255,255,.86); margin-top:40px; border-top:4px solid var(--sv-gold); }
.sv-foot-grid { display:grid; gap:28px; padding-block:40px; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); }
@media (min-width:1000px) { .sv-foot-grid { grid-template-columns:1.5fr 1fr 1fr 1fr; } }
.sv-foot a { color:#fff; text-decoration:none; } .sv-foot a:hover { text-decoration:underline; }
.sv-foot h4 { color:#fff; font-size:1rem; margin:0 0 12px; padding-bottom:8px; border-bottom:2px solid var(--sv-gold); display:inline-block; }
.sv-foot ul { list-style:none; margin:0; padding:0; display:grid; gap:8px; font-size:.92rem; }
.sv-foot ul a { display:inline-flex; align-items:center; gap:8px; }
.sv-foot ul .icon { width:15px; height:15px; flex:none; }
.sv-foot .sv-brand b { color:#fff; } .sv-foot .sv-brand small { color:rgba(255,255,255,.75); }
.sv-foot-school p { display:flex; gap:10px; margin:10px 0 0; font-size:.92rem; }
.sv-foot-school .icon { width:16px; height:16px; flex:none; margin-top:4px; color:var(--sv-gold); }
.sv-visits { margin:14px 0 0; font-size:.88rem; display:flex; gap:6px; align-items:center; }
.sv-copy { background:rgba(0,0,0,.22); font-size:.84rem; }
.sv-copy .container { display:flex; align-items:center; gap:12px; min-height:46px; }
.sv-copy .btn { color:rgba(255,255,255,.85); }

/* หลังบ้าน: ข้อความติดต่อ */
.ws-msg { border-top:1px solid var(--line); padding:12px 0; }
.ws-msg.is-new { background:linear-gradient(90deg, var(--primary-soft), transparent 60%); padding-left:10px; border-radius:8px; }
.sv-drawer > .row { flex-wrap:nowrap; align-items:center; gap:8px; }
.sv-drawer .sv-brand span { min-width:0; }
@media (max-width:640px) { .sv-brand small { font-size:.76rem; line-height:1.4; } .sv-head .container { padding-block:10px; } }
/* นับถอยหลังกิจกรรมที่ใกล้ที่สุด */
.sv-count { background:var(--primary); color:var(--primary-ink); border-radius:12px; padding:14px 16px; margin-bottom:14px; display:flex; flex-direction:column; gap:10px; }
.sv-count-title { font-weight:700; font-size:1.05rem; line-height:1.4; color:#fff; }
.sv-count-title small { display:block; font-weight:400; font-size:.84rem; opacity:.9; }
.sv-count-box { display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; }
.sv-count-box > span { background:rgba(255,255,255,.16); border-radius:10px; text-align:center; padding:6px 4px; }
.sv-count-box b { display:block; font-family:var(--font-display); font-size:clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height:1.2; color:#fff; font-variant-numeric:tabular-nums; }
.sv-count-box small { font-size:.78rem; opacity:.9; }
.sv-count-now { align-self:flex-start; background:var(--sv-gold); color:#3b2a00; font-weight:700; padding:4px 14px; border-radius:999px; }
.sv-left { margin-left:auto; flex:none; font-size:.8rem; font-weight:600; color:var(--sv-deep); background:var(--primary-soft); padding:2px 10px; border-radius:999px; white-space:nowrap; }
:root[data-theme="dark"] .sv-left { color:var(--text); }
