/* 선생님 화면 '생활지도 대시보드' (teacher.html) */
/* 큰 모니터에서도 꽉 차게 (아주 넓으면 읽기 힘들어서 1800px 까지) */
.staff .page{max-width:1800px;padding-left:24px;padding-right:24px}
@media (max-width:600px){.staff .page{padding-left:16px;padding-right:16px}}

/* =====================================================================
   화면: record.js · student.js · stats.js · board.js
   색 약속: 생활지도 = 남색(--accent)과 범주 색, 보건실 = 주황(--health), 학부모 상담 = 초록(--counsel)
   ===================================================================== */
:root{--a-study:#2453c9;--a-safety:#b0281f;--a-relation:#0e7c86;--a-rules:#7a4a12;--k-rights:#a3123a;--k-rights-soft:#fbe7ec;
  --counsel:#1f6b45;--counsel-soft:#e3f1e8}
body.staff{--health:#a14a12;--health-soft:#fbeee4}
@media (prefers-color-scheme: dark){
  :root{--a-study:#7ea2ff;--a-safety:#ff8f80;--a-relation:#5fd0d9;--a-rules:#e0a060;--k-rights:#ff8aa5;--k-rights-soft:#3d1f27;
    --counsel:#6fcf97;--counsel-soft:#1c3328}
  body.staff{--health:#f0a070;--health-soft:#3a271b}}
.spacer{flex:1 1 auto}

/* 위 메뉴 */
.navrow{gap:22px}
.brandname{display:flex;align-items:center;gap:8px;font-size:1.15rem;font-weight:800;letter-spacing:-.01em}
.brandmark{width:22px;height:22px;border-radius:4px;background:var(--accent);
  background-image:linear-gradient(var(--accent-fg),var(--accent-fg)),linear-gradient(var(--accent-fg),var(--accent-fg)),linear-gradient(var(--accent-fg),var(--accent-fg));
  background-size:3px 8px,3px 12px,3px 6px;background-position:5px 9px,10px 5px,15px 11px;background-repeat:no-repeat}
.topnav{display:flex;gap:2px;flex-wrap:wrap}
.topnav button{border:0;background:transparent;padding:8px 14px;font-weight:600;color:var(--muted);border-radius:0;box-shadow:inset 0 -3px 0 transparent}
.topnav button[aria-current="true"]{color:var(--accent);box-shadow:inset 0 -3px 0 var(--accent)}
.setbtn[aria-current="true"]{background:var(--accent-soft);color:var(--accent);border-color:var(--accent)}
.privbtn{width:36px;height:36px;padding:0;font-size:1.2rem;line-height:1}
.small>button{padding:2px 9px;font-size:.85rem}

/* 범주 표시: 색은 영역마다 (k-영역 또는 k-범주 → --kc) */
.k-study,.k-disrupt,.k-defy,.k-attitude{--kc:var(--a-study)}
.k-safety,.k-hazard,.k-harm,.k-facility{--kc:var(--a-safety)}
.k-relation,.k-verbal,.k-manner,.k-discrim{--kc:var(--a-relation)}
.k-rules,.k-device,.k-absence,.k-school_rule{--kc:var(--a-rules)}
.dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:6px;vertical-align:middle;background:var(--kc,currentColor)}
.kbadge,.ebadge{display:inline-block;padding:1px 7px;border-radius:3px;font-size:.75rem;font-weight:700;white-space:nowrap}
.kbadge{color:#fff;background:var(--kc,var(--muted))}
@media (prefers-color-scheme: dark){.kbadge{color:#111}}
.ebadge.e-health{background:var(--health-soft);color:var(--health)} .ebadge.e-counsel{background:var(--counsel-soft);color:var(--counsel)}
.ebadge.e-plain{background:var(--sunk);color:var(--muted);border:1px solid var(--line)}

/* 화면 머리 (반 · 기간 · 보기) */
.rechead{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px}
.rechead h2{margin:0}
.rechead h2 .muted{font-weight:400}
.rechead select{padding:6px 10px}

/* ---------- 기록: 왼쪽 반 학생 칸, 오른쪽 반 기록하기 ---------- */
.reccols{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
@media (max-width:900px){.reccols{grid-template-columns:1fr}}
.stugrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px}
.stugrid > .empty{grid-column:1/-1}
.stu{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;padding:8px 10px;min-height:68px;
  border:1px solid var(--line);border-radius:var(--r);background:var(--surface);white-space:normal}
.stu .no{font-size:.75rem;color:var(--muted)}
.stu b{font-size:1.05rem}
.stu .hstate{font-size:.75rem;font-weight:700}
.stu.loc-health{border:2px solid var(--health);background:var(--health-soft)} .stu.loc-health .hstate{color:var(--health)}
.stu.loc-library{border:2px solid var(--muted)} .stu.loc-library .hstate{color:var(--muted)}
.stu .bantag{font-size:.7rem;color:var(--muted)}
.recdots{display:flex;flex-wrap:wrap;gap:4px;margin-top:3px}
.recdots .dot{margin:0;width:10px;height:10px}
.dotlegend{display:flex;flex-wrap:wrap;gap:4px 12px;margin-top:10px}
.dotlegend .dot{margin-right:4px}
.todaybtn{align-self:center}
.todaybtn b{color:var(--accent)}
.stu.sel{outline:3px solid var(--accent);outline-offset:-1px;background:var(--accent-soft)}
.gridhead{margin-bottom:10px}
.stugrid.multi .stu{cursor:copy}
.stu .check{font-style:normal;margin-right:4px;color:var(--accent);font-size:.95rem}
#multi[aria-pressed="true"]{background:var(--accent);color:var(--accent-fg);border-color:var(--accent)}
.selnames{color:var(--muted);line-height:1.6;margin-top:2px}
.recside{position:sticky;top:12px;display:flex;flex-direction:column;gap:14px;padding:18px}
.sidehead{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:8px 12px}
.sidehead h2{font-size:1.4rem;white-space:nowrap}
.sidehead > div:first-child{flex:1 0 auto;min-width:0}
.sidetools{gap:6px;flex-wrap:wrap;justify-content:flex-end;align-items:center}
.sidename{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}
.sendbtn{background:var(--health);color:#fff;border:1px solid var(--health);font-weight:700;padding:5px 14px}
.sendbtn:hover:not(:disabled){filter:brightness(1.08);border-color:var(--health)}
.hcancel{border:1px solid var(--health);color:var(--health);background:var(--surface);font-weight:700}
.hbox{background:var(--health-soft);color:var(--health);border-radius:var(--r);padding:8px 10px;font-size:.88rem}
/* 분리 조치 · 외출 · 조퇴 (0031) */
.stu.loc-sep{border:2px solid var(--k-rights);background:var(--k-rights-soft)} .stu.loc-sep .hstate{color:var(--k-rights)}
.stu .gatetag,.stu .elevtag{color:var(--counsel)}
.sepbox{background:var(--k-rights-soft);color:var(--k-rights);border-radius:var(--r);padding:8px 10px;font-size:.88rem;display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.gatebox{background:var(--counsel-soft);color:var(--counsel);border-radius:var(--r);padding:6px 10px;display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.sepplaces{display:flex;flex-direction:column;gap:6px;padding:8px 10px;border:1px dashed var(--k-rights);border-radius:var(--r)}
.sepcard{display:flex;flex-direction:column;gap:6px;padding:12px 14px;border:1px solid var(--line);border-left:6px solid var(--k-rights);border-radius:var(--r);margin-bottom:10px}
.sepcard.acked{border-left-color:var(--counsel)}
.sepwho{font-size:1.25rem;margin-right:10px}
ul.plain{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.banbox{background:var(--sunk);color:var(--fg);border:1px solid var(--line);border-radius:var(--r);padding:8px 10px;display:flex;flex-direction:column;gap:6px}
.fld{display:flex;flex-direction:column;gap:6px}
.flabel{font-weight:700;font-size:.92rem}
label.flabel{flex-direction:row;flex-wrap:wrap;align-items:center;gap:6px;color:var(--fg)}
.opts{display:flex;flex-wrap:wrap;gap:6px}
.opts .opt{padding:4px 12px;font-size:.92rem}
.opts .opt[aria-pressed="true"]{background:var(--accent);color:var(--accent-fg);border-color:var(--accent);font-weight:700}
.opts .opt.dashed{border-style:dashed}
/* 지도 내용: '분리 조치'는 무거운 조치라 따로 (빨간 테두리) */
.opts .optsep{width:1px;align-self:stretch;background:var(--line);margin:0 4px}
.opts .opt.strong{border-color:var(--k-rights);color:var(--k-rights);font-weight:700}
.opts .opt.strong::before{content:"⚠ "}
.opts .opt.strong[aria-pressed="true"]{background:var(--k-rights);border-color:var(--k-rights);color:#fff}
/* 생활지도 펼침형: 영역 탭 → 범주 3칸 */
.areatabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;border-bottom:2px solid var(--line)}
.areatab{display:flex;flex-direction:column;align-items:center;line-height:1.25;border:0;background:transparent;border-radius:0;padding:5px 6px;font-weight:600;color:var(--muted);box-shadow:inset 0 -3px 0 transparent;white-space:normal}
.areatab .law{font-size:.72rem;font-weight:400;opacity:.8}
.areatab[aria-selected="true"]{color:var(--kc);box-shadow:inset 0 -3px 0 var(--kc);font-weight:800}
.kcols{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:4px}
@media (max-width:1200px){.kcols{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:600px){.kcols{grid-template-columns:1fr}}
.kcol{display:flex;flex-direction:column;gap:5px;padding:8px 10px;background:var(--sunk);border:1px solid var(--line);border-top:3px solid var(--kc);border-radius:var(--r)}
.kcolh{font-size:.9rem;color:var(--kc)}
.kcol .opt{text-align:left;justify-content:flex-start;padding:4px 10px;font-size:.9rem;line-height:1.35;white-space:normal;word-break:keep-all}
.kcol .opt[aria-pressed="true"]{background:var(--kc);border-color:var(--kc);color:#fff;font-weight:700}
@media (prefers-color-scheme: dark){.kcol .opt[aria-pressed="true"]{color:#111}}
.kcolfoot{display:flex;flex-wrap:wrap;gap:4px;margin-top:2px}
.kcolfoot .opt{font-size:.8rem;padding:2px 8px;color:var(--muted)}
.kcol input{padding:4px 8px}
.hint-rights{background:var(--k-rights-soft);color:var(--k-rights);border-radius:var(--r);padding:6px 8px;margin:2px 0 0}
.guidetip{line-height:1.5}
.recside textarea{min-height:60px}
.newitem{display:flex;flex-direction:column;gap:4px}.newitem input{min-width:0}
.pickedline{background:var(--sunk);border-radius:var(--r);padding:8px 10px}
.recfoot{display:flex;flex-wrap:wrap;align-items:center;gap:12px;border-top:1px solid var(--line);padding-top:14px}
/* 발생 시각: 이름 바로 아래, 날짜 · 시각 칸 (고치면 테두리가 진해져요) */
.attime{display:flex;width:fit-content;max-width:100%;flex-wrap:wrap;align-items:center;gap:4px 6px;margin-top:-6px;padding:4px 8px;border:1px solid var(--line);border-radius:var(--r);background:var(--accent-soft);font-size:.9rem}
.attime .atlabel{color:var(--muted);margin-right:2px}
.attime input{padding:3px 6px}
.attime.on{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.atnote{color:var(--accent);font-weight:700}
/* 분리 조치 기록: 빨간 하트 */
.sepheart{color:#d62839;font-style:normal;font-size:.95em;line-height:1;margin-right:2px}
.recdots .sepheart{font-size:11px;margin:0}
.recgo{margin-left:auto;padding:7px 22px;font-size:1rem;font-weight:800}
.recgo:disabled{opacity:.45}

/* ---------- 학생별 자료 ---------- */
.cncols{display:grid;grid-template-columns:260px minmax(0,1fr);gap:16px;align-items:start}
@media (max-width:900px){.cncols{grid-template-columns:1fr}}
.cnlist{gap:6px;max-height:85vh;overflow:auto}
.cnlist label input{color:var(--fg)}
.cnstu{display:flex;align-items:baseline;gap:8px;text-align:left;justify-content:flex-start;border-color:transparent;background:transparent;padding:6px 10px;width:100%}
.cnstu .no{font-size:.8rem;color:var(--muted);width:2em}
.cnstu .n{margin-left:auto;font-size:.82rem;color:var(--muted);font-variant-numeric:tabular-nums}
.cnstu.sel{background:var(--accent-soft);outline:2px solid var(--accent);outline-offset:-2px}
.sthead{gap:14px}
.sttop{display:flex;flex-wrap:wrap;align-items:center;gap:14px 24px}
.stname h2{font-size:1.5rem}
.banflag{color:var(--fg)}
.sumtiles{display:flex;flex-wrap:wrap;gap:8px}
.sumtile{display:inline-flex;flex-direction:column;align-items:flex-start;gap:0;min-width:120px;padding:5px 14px;border:1px solid var(--line);border-left-width:4px;border-radius:var(--r);background:var(--surface)}
.sumtile span{font-size:.85rem;color:var(--muted)}
.sumtile b{font-size:1.5rem;font-variant-numeric:tabular-nums}
.sumtile b small{font-size:.85rem;font-weight:500}
.sumtile.t-rec{border-left-color:var(--accent)} .sumtile.t-health{border-left-color:var(--health)} .sumtile.t-counsel{border-left-color:var(--counsel)}
.sumtile[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent)}
.sumtile.t-health[aria-pressed="true"]{background:var(--health-soft);border-color:var(--health)}
.sumtile.t-counsel[aria-pressed="true"]{background:var(--counsel-soft);border-color:var(--counsel)}
.sumtile[aria-pressed="true"] span{color:inherit}
.stactions{display:flex;flex-wrap:wrap;gap:6px;margin-left:auto}
.stactions [aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
.cats{display:flex;flex-wrap:wrap;gap:6px;border-top:1px solid var(--line);padding-top:12px}
.cat{border-radius:999px;padding:3px 12px}
.cat[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);font-weight:700}
.tline{list-style:none;margin:4px 0 0;padding:0;display:flex;flex-direction:column}
.tline li{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;padding:9px 2px;border-bottom:1px solid var(--line);font-size:.92rem;min-width:0}
.tline .num{width:3.2em}
.tline .ell{flex:1 1 220px;min-width:0}
.tline .who{min-width:6em}
.tline .evby{text-align:right}
.recmemo{color:var(--muted);font-size:.88em}
.stamp{display:block;color:var(--muted);font-size:.75rem}
.dayblock{margin-top:12px}
.stday{font-weight:700;font-size:.88rem;border-bottom:2px solid var(--line);padding-bottom:3px}
.linkname{padding:2px 4px;font-weight:700;text-decoration:underline;text-decoration-color:var(--line);border:0;background:none}

/* ---------- 학급 통계 ---------- */
.sumrow{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.sumrow .tile{display:flex;flex-direction:column;gap:2px;border-top:4px solid var(--accent)}
.sumrow .tile > span:first-child{font-weight:700}
.sumrow .tile b{font-size:2rem}
.sumrow .tile b small{font-size:.9rem;font-weight:500;color:var(--muted)}
.sumrow .t-health{border-top-color:var(--health)} .sumrow .t-counsel{border-top-color:var(--counsel)}
.bscols{display:grid;grid-template-columns:repeat(auto-fit,minmax(380px,1fr));gap:16px;align-items:stretch;margin:12px 0 16px}
@media (max-width:900px){.bscols{grid-template-columns:1fr}}
.hbars{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:10px}
.hbars li{display:grid;grid-template-columns:minmax(90px,38%) minmax(0,1fr) 2.6em;align-items:center;gap:10px;font-size:.92rem}
.hbars b{text-align:right;font-variant-numeric:tabular-nums}
.bar{height:12px;border-radius:2px;background:var(--sunk);overflow:hidden;border:1px solid var(--line)}
.bar i{display:block;height:100%;background:var(--accent)}
.subh{margin-top:14px}
.heat{table-layout:fixed}
.heat th,.heat td{text-align:center;padding:8px 4px}
.heat td{font-weight:700;border:2px solid var(--surface)}
.heat .h0{background:var(--sunk)} .heat .h1{background:#dce5f2} .heat .h2{background:#b9cbe6} .heat .h3{background:#7f9ccb;color:#0d1622} .heat .h4{background:var(--accent);color:var(--accent-fg)}
@media (prefers-color-scheme: dark){.heat .h1{background:#22314a} .heat .h2{background:#2f4a72} .heat .h3{background:#4a6fa5;color:#fff}}
.bstable td.n,.bstable th.n{text-align:right;font-variant-numeric:tabular-nums}
.bstable .linkname{text-align:left}
.bstable tr.picked td{background:var(--accent-soft)}
.linknum{border:0;background:none;padding:2px 6px;color:var(--accent);font-weight:800;text-decoration:underline;cursor:pointer}
.linknum.hnum{color:var(--health)}
button.tile{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;width:100%;color:inherit;text-align:left;cursor:pointer;border:1px solid var(--line);background:var(--surface);font:inherit;white-space:normal}
button.tile:hover{border-color:var(--health)} button.tile.t-rec:hover{border-color:var(--accent)} button.tile.t-counsel:hover{border-color:var(--counsel)}
.kindsum a{color:inherit;text-decoration:none}
.pill[title]{cursor:help}
/* 학생별 자료: 같은 행동 5번 이상 → 상담 권장 */
.repeatbox{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:10px;padding:8px 10px;border-radius:var(--r);background:var(--wc-soft)}
.cnstu .pill{font-style:normal;font-size:.72rem;padding:1px 6px}
/* 기간 설정 */
.rangebox{display:inline-flex;flex-wrap:wrap;align-items:center;gap:6px}
.rangebox input[type=date]{padding:3px 6px}

.poptable{font-size:.9rem}
.poptable td{vertical-align:top;white-space:normal}
/* 내용에 맞춰 넓어지는 팝업: 한 기록 = 한 줄 */
.fit .poptable td,.fit .poptable th{white-space:nowrap}
.fit .tline li{flex-wrap:nowrap;white-space:nowrap}
.fit .tline .ell{flex:1 0 auto}
.poptable tr.grpstart td{border-top:2px solid var(--line)}

/* ---------- 상담 준비 (AI, counsel.js) ---------- */

/* ---------- 설정: 내 항목 · 보는 범위 ---------- */
.switchrow{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:10px 0;border-top:1px solid var(--line)}
.switch{min-width:64px;border-radius:999px;font-weight:700}
.switch[aria-pressed="true"]{background:var(--accent);color:var(--accent-fg);border-color:var(--accent)}
.fixedrules{margin:4px 0 6px;padding-left:18px;line-height:1.7}
.areah{margin:14px 0 4px;color:var(--kc)}
.itemkind h4{margin:0;font-size:.95rem}
.itemkinds{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:12px}
.itemkind{background:var(--sunk);border-radius:var(--r);padding:10px 12px;display:flex;flex-direction:column;gap:8px;min-width:0}
.itemkind ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.itemkind li{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.itemkind li input,.itemkind li > span:first-child{flex:1 1 160px;min-width:0}
.itemkind li.hiddenitem input,.itemkind li.hiddenitem span:first-child{opacity:.55}

/* ---------- PDF 저장 팝업 (report.js) ---------- */
.rpitems{display:grid;gap:8px;max-height:46vh;overflow:auto;border:1px solid var(--line);border-radius:var(--r);padding:8px 10px}
.rpkind ul{list-style:none;margin:2px 0 0 26px;padding:0;display:grid;gap:2px}

/* ---------- 🙈 오늘의 알림 (칠판) ---------- */
body.chalk{background:#3b2e22}
html:has(body.chalk){background:#3b2e22}
body.chalk .page{max-width:none;min-height:100vh;padding:16px}
.board{flex:1;display:flex;flex-direction:column;gap:12px;min-height:calc(100vh - 32px);padding:16px 28px 12px;border:16px solid #8a6440;border-radius:6px;
  background:#2f4a3b;box-shadow:inset 0 0 80px rgba(0,0,0,.35);color:#f3efe2;font-family:"Gowun Dodum",var(--f-body)}
.boardhead{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px}
@media (min-width:1000px){.boardhead{flex-wrap:nowrap}.boardtools{flex-wrap:nowrap}}
.board h1{font-family:inherit;font-weight:400;color:inherit;font-size:clamp(2rem,3.4vw,2.8rem);line-height:1.1;white-space:nowrap}
.boarddate{font-size:clamp(1.2rem,2vw,1.6rem);color:#e9e2c9;white-space:nowrap}
.boardtools{margin-left:auto;display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.boardclock{font-size:clamp(2.2rem,3.6vw,3rem);line-height:1;font-variant-numeric:tabular-nums}
.board button{font-family:var(--f-body)}
.board .boardghost{background:rgba(0,0,0,.18);border:1px solid rgba(243,239,226,.45);color:#f3efe2;padding:4px 10px;font-size:.92rem}
.board .boardghost:disabled{opacity:.4}
.fsbtns{display:inline-flex;align-items:center;gap:4px}
.board .boardbtn{background:#f3efe2;color:#2f4a3b;border:0;font-weight:700;padding:6px 18px}
.board .privbtn{background:rgba(0,0,0,.25);border-color:rgba(243,239,226,.5);color:#f3efe2}
.timer{display:flex;align-items:center}
.board .tmchip{display:inline-flex;align-items:center;gap:6px;font-size:1rem}
.timer .tmnum{font-size:clamp(1.4rem,2.2vw,1.9rem);line-height:1;font-variant-numeric:tabular-nums;color:#f6e58d}
.timer.over .tmnum,.tmpop.over .tmbig{color:#ffb4a2;animation:tmblink 1s steps(2) infinite}
@keyframes tmblink{50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){.timer.over .tmnum,.tmpop.over .tmbig{animation:none}}
.boardwrap{position:relative;flex:1;display:flex;min-height:62vh}
/* 타이머 팝업: 칠판 위에 떠 있고 끌어 옮기기 · 크기 바꾸기 (숫자는 팝업 크기를 따라 커져요) */
.tmpop{position:fixed;z-index:60;display:flex;flex-direction:column;min-width:280px;min-height:220px;background:#2f4a3b;border:10px solid #8a6440;border-radius:8px;
  color:#f3efe2;font-family:"Gowun Dodum",var(--f-body);box-shadow:0 10px 40px rgba(0,0,0,.45);container-type:size;overflow:hidden}
.tmdrag{flex:none;display:flex;align-items:center;gap:10px;padding:6px 12px;background:rgba(0,0,0,.22);cursor:move;touch-action:none;user-select:none;font-family:var(--f-body);font-size:.9rem}
.tmhint{opacity:.6;font-size:.8rem}
.tmbody{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:10px 16px 18px}
.tmbig{font-size:min(28cqw,48cqh);line-height:1;font-variant-numeric:tabular-nums;color:#f6e58d;white-space:nowrap}
.tmrow{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px}
.tmpop button{font-family:var(--f-body);font-size:1rem;padding:7px 14px;border-radius:8px}
.tmpop .boardghost{background:rgba(0,0,0,.18);border:1px solid rgba(243,239,226,.45);color:#f3efe2}
.tmpop .boardbtn{background:#f3efe2;color:#2f4a3b;border:0;font-weight:700}
.tmown{display:inline-flex;flex-direction:row;gap:6px;align-items:center;margin:0}
.tmown input{width:4.6em;padding:6px 8px;font-size:1rem;background:rgba(0,0,0,.25);color:#f3efe2;border:1px solid rgba(243,239,226,.45);border-radius:8px}
.tmresize{position:absolute;right:0;bottom:0;width:28px;height:28px;display:flex;align-items:flex-end;justify-content:flex-end;padding:2px 4px;cursor:nwse-resize;touch-action:none;user-select:none;color:rgba(243,239,226,.7);font-size:18px;line-height:1}
/* 칠판 서식 줄 */
.rtbar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;font-family:var(--f-body)}
.rtlabel{color:#d8cdb8;font-size:.85rem;margin-right:2px}
.rtcolors{display:inline-flex;gap:5px}
.rtcolor{width:28px;height:28px;padding:0;border-radius:50%;border:2px solid rgba(0,0,0,.35);background:var(--sw);box-shadow:0 0 0 1px rgba(243,239,226,.5)}
.board .rtb{min-width:2.4em}
.boardnote{flex:1;width:100%;overflow:auto;white-space:pre-wrap;word-break:break-word;background:transparent;border:2px dashed rgba(243,239,226,.25);border-radius:6px;padding:12px 16px;
  color:#f3efe2;font-family:inherit;font-size:2.4rem;line-height:1.5}
.boardnote:focus{outline:none;border-color:rgba(246,229,141,.7)}
.boardnote.empty::before{content:attr(data-ph);color:rgba(243,239,226,.45);pointer-events:none}
.boardfoot{display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;border-top:12px solid #6e5034;padding-top:8px;font-family:var(--f-body)}
.boardhint{font-size:.85rem;color:#d8cdb8}
.boardhint:first-child{margin-right:auto}

@media print{
  .rpt{font-size:10.5pt;line-height:1.5;color:#000}
  .rpt h1{font-size:15pt;margin:0 0 2px} .rpt h2{font-size:11.5pt;margin:12px 0 4px}
  .rpt table{width:100%;border-collapse:collapse}
  .rpt th,.rpt td{border:1px solid #999;padding:3px 5px;text-align:left;vertical-align:top}
  .rpt .rptcount td,.rpt .rptcount th{text-align:center}
  .rpt .nw{white-space:nowrap}
  .rpt tr{page-break-inside:avoid}
  .rpt .sepheart{color:#c00}
  .rptfoot{margin-top:10px;font-size:8.5pt;color:#444}
  .rptlead{margin:6px 0 0}
}

/* ---------- 자료실 (forms.js): 파일 목록 · 운영자 올리기 ---------- */
.formlist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.formlist > li{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 16px;padding:10px 0;border-top:1px solid var(--line)}
.formlist > li:first-child{border-top:0}
.formlist > li > div{display:flex;flex-direction:column;gap:2px;min-width:0}
.formlist .row{gap:6px}
.fedit label{display:flex;flex-direction:column;gap:4px}
.fedit .grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}

/* ---------- 문구 바꾸기 (textedit.js) ---------- */
.textgroup h3{margin:12px 0 6px}
.textrow{display:flex;flex-direction:column;gap:4px;padding:8px 0;border-top:1px solid var(--line)}
.textrow textarea{width:100%;min-height:0;resize:vertical;font:inherit}
.textrow .row{gap:6px;align-items:center}
#htexts summary{cursor:pointer;padding:4px 0}
.fedit .row.end{justify-content:flex-end;align-items:center}

/* ---------- 기록 첫 화면 달력 (reccal.js) · 출결 (record.js) ---------- */
.calhead{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.calhead h2{margin:0;font-size:1.2rem}
.calhead .muted{margin-left:auto}
.calgrid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.calwd{text-align:center;font-size:.8rem;color:var(--muted)}
.calday{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:3px;min-height:78px;padding:6px 8px;border:1px solid var(--line);border-radius:4px;background:var(--surface);text-align:left;font:inherit;color:var(--fg)}
.calday:hover:not(:disabled){border-color:var(--accent)}
.calday.future{background:var(--bg)}
.calday.future .calnum{color:var(--muted)}
.calday.today{border:2px solid var(--accent)}
.calnum{font-size:.85rem;font-weight:700}
.calrec,.calatt{display:inline-flex;align-items:center;gap:3px;white-space:nowrap;font-size:.88rem;font-weight:700}
.calatt{display:flex;flex-wrap:wrap;gap:2px 6px;white-space:normal}
.calatt > span{display:inline-flex;align-items:center;gap:1px}
.calcirc{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--accent)}
.callegend{display:flex;gap:12px;flex-wrap:wrap;margin-top:8px}
.callegend span{display:inline-flex;align-items:center;gap:4px}
.dayh{margin:12px 0 6px;font-size:1rem}
.attlist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.attlist li{display:flex;align-items:center;gap:8px;padding:4px 6px;border-radius:4px;background:var(--sunk)}
.attlist li button{margin-left:auto}
.attgroup{display:flex;flex-direction:column;gap:4px;margin-bottom:8px}
.attgroup h4{display:flex;align-items:center;gap:4px;margin:0;font-size:.95rem}
.attsq{display:inline-flex;align-items:center;justify-content:center;width:15px;height:15px;border-radius:2px;background:var(--muted);color:var(--surface);font-size:10px;font-style:normal;font-weight:700;line-height:1;margin-right:2px}
.attdots{display:inline-flex;gap:2px}
.attbtns{display:inline-flex;gap:3px}
/* 출결 색: 결석 빨강 · 지각 주황 · 외출 파랑 · 조퇴 보라 (네모 · 버튼 같은 색) */
.att-absent{--att:#C0392B}.att-late{--att:#C46A12}.att-out{--att:#2563A8}.att-early{--att:#7A45B0}
.attsq[class*="att-"]{background:var(--att)}
.attbtns button{border:2px solid var(--att,var(--line));color:var(--att,var(--fg));font-weight:800;background:var(--surface)}
.attbtns button[aria-pressed="true"]{background:var(--att,var(--fg));color:#fff;border-color:var(--att,var(--fg))}
.ebadge.e-att{background:var(--sunk);color:var(--fg)}

/* 자료실 하위 탭: 생활지도 양식들 · 개인정보보호 자료 */
.subtabs{display:flex;flex-wrap:wrap;gap:4px;border-bottom:2px solid var(--line)}
.subtabs .subtab{border:0;background:none;padding:8px 16px;font-weight:700;color:var(--muted);border-bottom:3px solid transparent;margin-bottom:-2px;border-radius:0}
.subtabs .subtab[aria-selected="true"]{color:var(--fg);border-bottom-color:var(--accent)}
