/* หน้าครู: แถบพาเนลซ้าย + พื้นที่หลัก + แผงแบบฟอร์มด้านขวา */
.tp{display:grid;grid-template-columns:250px minmax(0,1fr);gap:24px;align-items:start}
.tp-side{position:sticky;top:120px;background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px;max-height:calc(100vh - 140px);overflow:auto}
.tp-school{display:flex;flex-direction:column;padding:4px 6px 12px;border-bottom:1px solid var(--line);margin-bottom:6px}
.tp-school b{font-family:var(--head);font-weight:600;font-size:16px;line-height:1.3}
.tp-school span{font-size:13px;color:var(--muted)}
.tp-h{margin:12px 6px 6px;font-size:13px;font-weight:700;color:var(--muted);letter-spacing:.3px}
.tp-list{display:grid;gap:2px}
.tp-top{padding:2px 0 6px;border-bottom:1px solid var(--line)}
.tp-cnt{font-size:14px;color:var(--ink-2)}
/* Accordion ในแถบพาเนล */
.tp-acc{border-bottom:1px solid var(--line)}
.tp-acc:last-child{border-bottom:0}
.tp-acc-head{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;font:inherit;font-family:var(--head);font-weight:600;font-size:15px;color:var(--ink);background:transparent;border:0;border-radius:10px;padding:10px 8px;cursor:pointer;min-height:44px;text-align:left}
.tp-acc-head:hover{background:var(--accent-soft)}
.tp-acc-head small{font-family:var(--body,inherit);font-weight:500;font-size:12px;color:var(--muted)}
.tp-acc-head i{width:9px;height:9px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin:-4px 6px 0 0;transition:transform .18s;flex:none}
.tp-acc-head[aria-expanded="true"]{color:var(--accent)}
.tp-acc-head[aria-expanded="true"] i{transform:rotate(-135deg);margin-top:4px}
.tp-acc-body{padding:2px 0 10px;animation:tpacc .16s ease-out}
@keyframes tpacc{from{opacity:0;transform:translateY(-4px)}}
.tp-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;text-align:left;font:inherit;font-size:15px;color:var(--ink);background:transparent;border:0;border-radius:10px;padding:8px 10px;cursor:pointer;min-height:40px}
.tp-item:hover{background:var(--accent-soft)}
.tp-item[aria-current="true"]{background:var(--accent);color:#fff}
.tp-item small{font-size:12px;opacity:.75}
.tp-add{width:100%;margin-top:6px;font:inherit;font-size:15px;color:var(--accent);background:#fff;border:1.5px dashed #C9B8E0;border-radius:10px;padding:8px;cursor:pointer;min-height:40px}
.tp-add:hover{background:var(--accent-soft)}
.tp-badge{display:inline-block;min-width:20px;padding:0 6px;border-radius:99px;background:#F2A516;color:#2B2235;font-size:12px;font-weight:700;line-height:20px;text-align:center}
.tp-main{min-width:0}
.tp-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:12px}
.tp-head h1{font-size:28px;margin:0}
.tp-head .note{margin:2px 0 0}
.tp-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.tp-bar .btn{min-height:40px;padding:0 14px}
.tp-more{position:relative}
.tp-menu{position:absolute;right:0;top:calc(100% + 4px);z-index:20;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 30px rgba(38,26,58,.16);padding:6px;min-width:200px;display:grid}
.tp-menu button{font:inherit;font-size:15px;text-align:left;background:transparent;border:0;border-radius:8px;padding:9px 12px;cursor:pointer;color:var(--ink)}
.tp-menu button:hover{background:var(--accent-soft)}
.tp-float{position:fixed;right:auto;top:0;left:0;z-index:60}
.tp-menu .danger{color:#C0392B}
.tp-menu .danger:hover{background:#FDECEE}
.tp-tabs{display:flex;gap:4px;border-bottom:2px solid var(--line);margin:0 0 12px}
.tp-tabs button{font:inherit;font-family:var(--head);font-weight:500;font-size:15px;background:transparent;border:0;border-bottom:3px solid transparent;margin-bottom:-2px;padding:8px 14px;cursor:pointer;color:var(--ink-2)}
.tp-tabs button[aria-selected="true"]{color:var(--accent);border-bottom-color:var(--accent)}
.tp-count{font-size:13px;color:var(--muted)}
.tp-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.tp-card{background:#fff;border:1.5px solid var(--line);border-radius:14px;padding:14px 16px;display:flex;flex-direction:column;gap:6px}
.tp-card b{font-family:var(--head);font-size:22px}
.tp-card .tp-bar{margin-top:auto;padding-top:6px}
.tp-card .btn{min-height:36px;padding:0 12px;font-size:14px}
.tp-scroll{overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:#fff}
.tp-tbl{width:100%;border-collapse:collapse;font-size:15px}
.tp-tbl th,.tp-tbl td{border-bottom:1px solid var(--line);padding:8px 10px;text-align:left;vertical-align:middle}
.tp-tbl tr:last-child td{border-bottom:0}
.tp-tbl th{background:var(--accent-soft);font-family:var(--head);font-weight:500;white-space:nowrap}
.tp-tbl td:last-child{text-align:right;white-space:nowrap}
.tp-row-btn{font:inherit;font-size:14px;background:#fff;border:1px solid var(--line);border-radius:8px;padding:4px 10px;cursor:pointer;color:var(--ink)}
.tp-row-btn:hover{border-color:var(--accent);color:var(--accent)}
.tp-foot{margin:8px 0 0}
.tp-name{font:inherit;color:var(--ink);background:transparent;border:0;padding:2px 0;cursor:pointer;text-align:left;text-decoration:underline dotted #B9A9D0;text-underline-offset:4px}
.tp-name:hover{color:var(--accent);text-decoration-color:var(--accent)}
.tp-name::after{content:" ✎";font-size:13px;opacity:0;transition:opacity .15s}
.tp-name:hover::after,.tp-name:focus-visible::after{opacity:.8}
.tp-msg{min-height:1.4em;font-weight:600;margin:6px 0}
.tp-tag{display:inline-block;padding:0 8px;border-radius:99px;font-size:13px;line-height:22px;background:#EEE}
.tp-tag.ok{background:#E3F4EA;color:#1E7A4C}.tp-tag.wait{background:#FFF1D0;color:#7A5200}.tp-tag.off{background:#FDECEE;color:#C0392B}.tp-tag.head{background:#E4EEF9;color:#1D5FA8}
.tp-code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:17px;letter-spacing:1px;background:#FFF8E6;border-radius:6px;padding:0 6px}
.tp-sel{font:inherit;min-height:44px;border:1.5px solid var(--line);border-radius:12px;padding:0 10px;background:#fff;width:100%}
.tp-bar .tp-sel{width:auto}
.tp-form{display:grid;gap:12px}
.tp-paste{width:100%;min-height:140px;font:inherit;font-size:15px;border:1.5px solid var(--line);border-radius:12px;padding:10px;box-sizing:border-box}
.btn.danger{background:#C0392B;border-color:#C0392B;color:#fff}
/* แผงด้านขวา */
.tp-drawer{position:fixed;inset:0;z-index:70}
.tp-drawer-back{position:absolute;inset:0;background:rgba(25,18,36,.45)}
.tp-panel{position:absolute;top:0;right:0;bottom:0;width:min(480px,100%);background:#fff;box-shadow:-12px 0 40px rgba(0,0,0,.2);display:flex;flex-direction:column;animation:tpin .18s ease-out}
@keyframes tpin{from{transform:translateX(40px);opacity:.4}}
.tp-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 18px;border-bottom:1px solid var(--line)}
.tp-panel-head h2{margin:0;font-size:20px}
.tp-panel-body{padding:16px 18px;overflow:auto;flex:1}
[hidden]{display:none!important}
@media (max-width:900px){
  .tp{grid-template-columns:minmax(0,1fr)}
  .tp-side{position:static;max-height:none;padding:10px}
  .tp-list{grid-auto-flow:column;grid-auto-columns:max-content;overflow-x:auto;gap:6px}
  .tp-item{border:1px solid var(--line)}
  .tp-school{flex-direction:row;gap:8px;align-items:baseline;padding-bottom:8px}
}
#roster tr[data-st]{cursor:pointer}
#roster tr[data-st]:hover td{background:#FBF9FE}

/* ผล LAB */
.lab-tbl td small{display:block;color:var(--muted,#667);font-size:13px}
.lab-tbl .tp-sub th{font-size:13px;background:#fff}
.labd h3{font-family:var(--head);font-size:19px;margin:18px 0 8px}
.labd h3:first-child{margin-top:0}
.labd h4{font-size:15px;margin:12px 0 6px}
.labd .tp-tbl{font-size:14px}
.labd .tp-tbl th,.labd .tp-tbl td{padding:5px 8px}
.labd .mute{color:var(--muted,#667)}
.labd .chips{display:flex;flex-wrap:wrap;gap:6px}
.labd .chips code{background:var(--accent-soft,#eef);border-radius:6px;padding:2px 7px;font-size:13px}
.labd .stats{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 8px}
.labd .stats div{border:1px solid var(--line);border-radius:10px;padding:6px 12px;font-size:14px}
.labd .stats b{font-family:var(--head);font-size:20px;margin-right:4px}
.labd iframe{width:100%;height:320px;border:1px solid var(--line);border-radius:10px;background:#fff}
.labd pre{max-height:260px;overflow:auto;background:#f6f7f9;border:1px solid var(--line);border-radius:10px;padding:10px;font-size:13px;white-space:pre-wrap;word-break:break-word}
.labd details{margin:6px 0}
.labd summary{cursor:pointer}

/* ---------- บทเรียน: มอบหมายงาน คะแนน ตรวจข้อเขียน ---------- */
.tp-tabs{overflow-x:auto;scrollbar-width:thin}
.tp-tabs button{white-space:nowrap}
.aw-form{display:grid;grid-template-columns:1fr 1fr;gap:10px 14px;align-items:end;background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px 16px;margin-bottom:6px}
.aw-form>b{grid-column:1/-1;font-family:var(--head);font-weight:600;font-size:17px}
.aw-form label{display:flex;flex-direction:column;gap:4px;font-size:15px;font-weight:600;color:var(--ink-2)}
.aw-form .aw-wide{grid-column:1/-1}
.aw-form .tp-bar{grid-column:1/-1}
.aw-chk{display:inline-flex!important;flex-direction:row!important;align-items:center;gap:6px;font-weight:500!important;font-size:15px;cursor:pointer}
.aw-chk input{width:18px;height:18px}
.aw-card{background:#fff;border:1.5px solid #DDD7E6;border-radius:14px;padding:12px 16px;margin:10px 0;display:grid;gap:6px}
.aw-top{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.aw-top a{color:var(--ink);text-decoration:none}
.aw-top a:hover b{text-decoration:underline}
.aw-top b{font-family:var(--head);font-weight:600;font-size:17px}
.aw-type{font-size:13px;font-weight:700;border-radius:99px;padding:1px 10px;background:#EEE8F7;color:#4A3468}
.aw-type.t-pretest{background:#E4F0F8;color:#1B5E8A}.aw-type.t-posttest{background:#E3F4EA;color:#1E7A4C}.aw-type.t-worksheet{background:#FFF0E0;color:#8F4400}
.aw-due{font-size:15px;color:#4A4555}.aw-due.over{color:#B3261E;font-weight:600}
.aw-detail{font-size:15px;background:#FAF9FC;border-radius:8px;padding:4px 10px}
.aw-stats{display:flex;flex-wrap:wrap;gap:6px}
.aw-stats span{font-size:14px;font-weight:700;border-radius:99px;padding:2px 10px}
.s-done{background:#E3F4EA;color:#1E7A4C}.s-todo{background:#F1EEF5;color:#4A4555}.s-late{background:#FFF0E0;color:#8F4400}.s-pend{background:#F4EEFB;color:#5E2C91}
.btn.danger,.btn.ghost.danger{color:#B3261E;border-color:#E3A1A1;background:#fff}
.btn.danger:not(.ghost){background:#B3261E;color:#fff;border-color:#B3261E}
.st{font-size:14px;font-weight:700;border-radius:99px;padding:1px 9px;white-space:nowrap}
.st-done{background:#E3F4EA;color:#1E7A4C}.st-todo{background:#F1EEF5;color:#4A4555}.st-overdue{background:#FCECEA;color:#B3261E}.st-pending{background:#F4EEFB;color:#5E2C91}.st-late{background:#FFF0E0;color:#8F4400}
.sc-tbl td,.sc-tbl th{text-align:center;white-space:nowrap}
.sc-tbl td:nth-child(2),.sc-tbl th:nth-child(2){text-align:left}
.sc-none{color:#9AA5B1}
.sc-link{border:0;background:none;color:var(--accent);font:inherit;text-decoration:underline;cursor:pointer;padding:0}
.g-part{border:1px solid var(--line);border-radius:12px;padding:10px 14px;margin:10px 0}
.g-part h4{margin:0 0 6px;font-size:17px}
.g-part h4 small{font-weight:500;color:var(--muted);font-size:14px}
.g-row{margin:8px 0}
.g-q{font-weight:600;margin-bottom:4px}
.g-cols{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.g-cols small{color:var(--muted)}
.g-ans{background:#FFF8E6;border:1px solid #F0D9A0;border-radius:8px;padding:6px 10px;min-height:34px}
.g-model{background:#E9F6EE;border:1px solid #BFE3CB;border-radius:8px;padding:6px 10px;min-height:34px}
.g-ans ol,.g-model ol{margin:0;padding-left:1.3em}
.g-empty{color:#9AA5B1}
.g-crit{font-size:14.5px;color:#5E2C91;background:#F8F4FD;border-radius:8px;padding:6px 10px;margin:6px 0}
.g-score{display:flex;align-items:center;gap:8px;font-weight:700}
.g-score input{width:80px;min-height:40px;border:2px solid var(--line);border-radius:10px;text-align:center;font:inherit;font-size:17px}
.g-comment{display:flex;flex-direction:column;gap:4px;font-weight:600;margin-top:10px}
.g-comment textarea{font:inherit;border:1.5px solid var(--line);border-radius:10px;padding:8px}
@media (max-width:640px){.aw-form{grid-template-columns:1fr}.g-cols{grid-template-columns:1fr}}
