/* 톤: 따뜻한 미니멀 에디토리얼. 오트밀 종이 위에 테라코타 한 색, 그림자 대신 가는 선. */
:root {
  --oatmeal: #f1e9dc;
  --paper: #fbf7f0;
  --ink: #2f2620;
  --muted: #6b5d50;
  --line: #d9ccb9;
  --terracotta: #b25d3e;
  --terracotta-deep: #94492e;
  --terracotta-soft: #f0d9cb;
  --sans: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  /* 글꼴은 로그인 화면의 고딕 하나로 통일한다. */
  --serif: var(--sans);
  font-family: var(--sans);
  color: var(--ink);
  background: var(--oatmeal);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
h1 { font: 600 clamp(1.75rem, 4vw, 2.5rem)/1.25 var(--serif); letter-spacing: -.02em; }
h2 { font: 600 1.25rem/1.3 var(--serif); }
.loading { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }
.muted { color: var(--muted); font-size: .875rem; }
.error { color: var(--terracotta-deep); }
.eyebrow { font-size: .875rem; letter-spacing: .02em; color: var(--muted); }
.tag { font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.empty { padding: 36px 0; color: var(--muted); text-align: center; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

/* 입력과 버튼 */
label { display: block; flex: 1; margin-bottom: 16px; font-size: .875rem; font-weight: 600; }
input, select, textarea {
  display: block; width: 100%; min-height: 46px; margin-top: 6px; padding: 10px 12px;
  font: 400 1rem/1.5 var(--sans); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 4px;
}
input[type="search"] { margin-top: 0; }
input[type="date"] { width: auto; } /* 달력 단추가 날짜 바로 옆에 오게 */
.inline-submit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 16px; }
.inline-submit label { flex: none; margin-bottom: 0; }
.until-pick { display: flex; gap: 6px; }
.until-pick select { width: auto; }
input::placeholder { color: var(--muted); }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .student:focus-visible {
  outline: 2px solid var(--terracotta); outline-offset: 2px;
}
button {
  min-height: 46px; padding: 10px 18px; font: 600 1rem/1.3 var(--sans); color: #fff;
  background: var(--terracotta); border: 0; border-radius: 4px; cursor: pointer; touch-action: manipulation;
}
button:hover:not(:disabled) { background: var(--terracotta-deep); }
button:disabled { color: var(--paper); background: color-mix(in srgb, var(--muted) 60%, var(--oatmeal)); cursor: not-allowed; }
button.wide { width: 100%; min-height: 52px; }
button.outline { color: var(--terracotta-deep); background: transparent; border: 1px solid var(--terracotta); }
button.outline:hover:not(:disabled) { color: #fff; background: var(--terracotta); }
button.text-link { min-height: 32px; padding: 0; color: var(--terracotta-deep); background: transparent; font-size: .9375rem; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
button.text-link:hover:not(:disabled) { background: transparent; color: var(--ink); }

.status { display: inline-flex; align-items: center; gap: .45em; font-size: .875em; color: var(--muted); white-space: nowrap; }
.status::before { content: ""; width: .6em; height: .6em; background: #7d9463; border-radius: 50%; }
.status.offline { padding: .25em .7em; font-weight: 700; color: #fff; background: var(--terracotta-deep); border-radius: 4px; }
.status.offline::before { background: #fff; }

/* 로그인 */
.auth-view { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px; }
.auth-card { width: min(100%, 380px); }
.auth-card h1 { margin: 6px 0 32px; font-size: 2.5rem; }
.auth-card .error { min-height: 1.5em; margin-top: 14px; }
.auth-card > .error:first-child { margin-bottom: 14px; }

/* 교사 앱: 위 프로필, 가운데 내용, 아래 고정 메뉴 */
.teacher-view { padding-bottom: calc(72px + env(safe-area-inset-bottom)); } /* 아래 탭(약 69px)에 가리지 않을 만큼만 */
@media (max-width: 760px) { .teacher-view .tab { padding-bottom: 8px; } }
.profile, .tabs { width: min(100%, 1080px); margin: 0 auto; padding-inline: clamp(18px, 4vw, 40px); }
.profile { display: flex; align-items: center; gap: 12px; padding-block: 18px 6px; }
.profile strong { margin-right: auto; font-weight: 600; }
.avatar {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px;
  font: 600 1.125rem/1 var(--serif); color: var(--terracotta-deep); background: var(--terracotta-soft); border-radius: 50%;
}
.tab { padding-block: 16px 24px; }
.tab > h1, .page-head { margin-bottom: 24px; }
.page-head { align-items: center; }


/* 카드뉴스처럼 번호와 큰 이름으로 읽는 타임라인 */
.badge { flex: none; align-self: flex-start; padding: 3px 9px; font-size: .8125rem; font-weight: 600; color: var(--muted); background: color-mix(in srgb, var(--line) 60%, var(--paper)); border-radius: 3px; white-space: nowrap; }
.badge.sent { color: var(--terracotta-deep); background: var(--terracotta-soft); }
.badge.received { color: #fff; background: color-mix(in srgb, var(--terracotta-deep) 50%, var(--muted)); }
.badge.done { color: #fff; background: var(--terracotta); }

/* 호출 탭 */
.call-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.call-grid h2 { margin-bottom: 16px; }
.picker .section-head h2 { margin-bottom: 0; }
.row { display: flex; gap: 12px; }
.roster { margin-top: 14px; border-top: 1px solid var(--line); max-height: 460px; overflow-y: auto; }
.student {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 12px; align-items: center;
  width: 100%; min-height: 62px; padding: 9px 10px; font-weight: 400; color: var(--ink); text-align: left;
  background: transparent; border-bottom: 1px solid var(--line); border-radius: 0;
}
.student:hover:not(:disabled) { background: var(--paper); }
.student[aria-pressed="true"], .student[aria-pressed="true"]:hover:not(:disabled) { background: var(--terracotta-soft); box-shadow: inset 3px 0 0 var(--terracotta); }
.student:focus-visible { outline-offset: -2px; }
.student-name { font-weight: 700; }
.student-class { grid-row: 2; font-size: .8125rem; color: var(--muted); }
.room { grid-row: 1 / 3; grid-column: 2; font: 600 1.125rem/1 var(--serif); color: var(--terracotta-deep); }
.room.none { font: 400 .875rem/1 var(--sans); color: var(--muted); }
.roster .room { display: none; } /* 호출 명단 칸에는 이름·학번만 */
.roster .student:disabled, .roster .student:disabled * { color: color-mix(in srgb, var(--muted) 45%, var(--oatmeal)); background: var(--oatmeal); }
.target { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 20px; padding: 18px 20px; background: var(--paper); border-left: 3px solid var(--terracotta); }
.target-name { font-weight: 600; }
.target-room { font: 700 1.875rem/1.2 var(--serif); color: var(--terracotta-deep); }
.target-note { flex-basis: 100%; font-size: .8125rem; color: var(--muted); }
.target.none { border-left-color: var(--muted); }
.target.none .target-room { color: var(--muted); }
.feedback { min-height: 1.5em; margin-top: 12px; font-size: .9375rem; }

/* 기록 탭 */
.calls { border-bottom: 1px solid var(--line); }
.call-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
.call-row .badge { justify-self: start; }
/* 통신 기록: 한 줄로 접어 두고 누르면 펼친다 */
.log-item > summary { list-style: none; cursor: pointer; align-items: center; padding: 12px 0; }
.log-item > summary::-webkit-details-marker { display: none; }
.log-item > summary:hover .log-who { text-decoration: underline; }
.log-item[open] > summary { border-bottom: 1px dashed var(--line); }
.log-detail { border-top: 0; padding: 12px 0 16px; }
.call-text { display: grid; gap: 3px; }
.call-row time { font-size: .875rem; white-space: nowrap; }

/* 연락·공지 탭 */
.panel { padding: clamp(18px, 3vw, 28px); margin-bottom: 28px; background: var(--paper); border-top: 3px solid var(--terracotta); }
.panel h2 { margin-bottom: 6px; }
.panel > .muted { margin-bottom: 14px; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: clamp(16px, 3vw, 32px); align-items: start; }
.panel-grid .panel { margin-bottom: 0; }
.presence-row, .quick-replies { display: flex; flex-wrap: wrap; gap: 8px; }
button.presence-choice[aria-pressed="true"], button.presence-choice[aria-pressed="true"]:hover:not(:disabled) { color: #fff; background: var(--terracotta); }
.requests { border-bottom: 1px solid var(--line); }
/* 학생 연락 한 건: 동그란 사진 | 이름·시각 / 학생 말풍선(왼쪽) / 내 답변 말풍선(오른쪽) */
.request { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
.request-body { display: grid; gap: 10px; min-width: 0; }
.request-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.request-head strong { font-size: 1.125rem; }
.bubble { position: relative; justify-self: start; max-width: min(100%, 36em); padding: 10px 14px; line-height: 1.6; white-space: pre-wrap; background: var(--paper); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; }
.bubble.mine { justify-self: end; background: var(--terracotta-soft); border-color: transparent; border-radius: 14px 4px 14px 14px; }
.bubble-label { display: block; font-size: .8125rem; font-weight: 600; color: var(--terracotta-deep); }
.reply-form { display: grid; justify-items: end; gap: 8px; }
.reply-form .quick-replies { justify-content: flex-end; }
.reply-input { display: flex; align-items: flex-end; gap: 8px; width: min(100%, 30em); }
.reply-input textarea { flex: 1; min-height: 0; resize: none; }
.bubble-row { display: flex; align-items: flex-end; gap: 6px; min-width: 0; }
.bubble-row.mine { justify-content: flex-end; }
.bubble-row .bubble { min-width: 0; }
.request-time { flex: none; font-size: .75rem; white-space: nowrap; }
.reply-form textarea { margin-top: 0; }
.reply-form .feedback { margin-top: 0; min-height: 0; }
.reply-done { display: grid; justify-items: end; gap: 4px; }

/* 콘텐츠 관리 */
.content-view { padding-bottom: 40px; }
label.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; min-height: 0; margin: 0; }
button.small { min-height: 38px; padding: 6px 12px; font-size: .875rem; }
button.outline[data-armed], button.outline[data-armed]:hover:not(:disabled) { color: #fff; background: var(--terracotta); }
.content-list { margin-top: 16px; }
.content-list .empty { padding: 14px 0; font-size: .9375rem; }
.content-item { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.content-item > div:not(.content-actions) { flex: 1 1 14em; min-width: 0; } /* 버튼이 많으면 글자를 세로로 찌그러뜨리지 않고 버튼을 다음 줄로 */
.content-item strong { margin-right: 8px; font-size: .9375rem; }
.content-item p { margin-top: 3px; line-height: 1.5; white-space: pre-wrap; }
.class-picker, .class-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.class-picker { margin-bottom: 14px; }
.class-picker > legend { padding: 0; margin-bottom: 8px; font-size: .875rem; font-weight: 600; }
.quick-classes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.class-group { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 8px; }
.class-group > legend { padding: 0 0 2px; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.class-group label.check { margin: 0; gap: 6px; }
.content-actions { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
form.panel > button.text-link { display: block; margin-top: 8px; }
.panel form.password-form { margin-bottom: 16px; }

/* 내 정보 탭 */
button.avatar { min-height: 42px; padding: 0; }
button.avatar, button.avatar:hover:not(:disabled) { color: var(--terracotta-deep); background: var(--terracotta-soft); }
.auth-note { margin-bottom: 20px; line-height: 1.6; }
.auth-card .password-form .feedback { min-height: 1.5em; }
.nav-item { position: relative; }
.nav-count:not(:empty) { position: absolute; top: 8px; left: calc(50% + 8px); min-width: 18px; padding: 1px 5px; font-size: .75rem; font-weight: 700; line-height: 16px; color: #fff; background: var(--terracotta); border-radius: 9px; }

/* 하단 고정 메뉴 */
.bottom-nav {
  position: fixed; inset: auto 0 0; z-index: 10; display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom); background: var(--paper); border-top: 1px solid var(--line);
}
.nav-item {
  display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  max-width: 150px; min-height: 68px; padding: 6px 4px; font-size: .8125rem; font-weight: 500;
  color: var(--muted); background: transparent; border-radius: 0;
}
.nav-item:hover:not(:disabled) { color: var(--ink); background: transparent; }
.nav-item[aria-current="page"], .nav-item[aria-current="page"]:hover:not(:disabled) { font-weight: 700; color: var(--terracotta-deep); }
.nav-item:focus-visible { outline-offset: -3px; }
.nav-icon { display: block; width: 26px; height: 26px; }
.nav-icon svg { display: block; width: 100%; height: 100%; }

/* 칠판 화면: 교실 뒤에서도 읽히도록 글자를 화면 크기에 맞춰 키운다. */
/* --u: 화면에 들어가는 16:9 상자 너비의 1%. 칠판 글자와 간격을 이 단위로 잡아 어떤 크기·비율의 화면에서도 같은 비율로 맞춘다. */
.board-view { --u: min(1vw, 1.7778vh); display: grid; grid-template-rows: auto auto minmax(0, 1fr); height: 100vh; height: 100dvh; }
.board-view > .board-bar { grid-row: 1; }
.board-view > .emergency { grid-row: 2; }
.board-view > .board { grid-row: 3; }
.board-bar { display: flex; align-items: center; gap: 1em; padding: .6em calc(2 * var(--u)); font-size: calc(1 * var(--u)); border-bottom: 1px solid var(--line); }
.board-bar strong { font: 600 1.375em/1.3 var(--serif); }
.board-bar { position: relative; }
.bar-motto { position: absolute; left: 50%; max-width: 44%; overflow: hidden; font: 600 1.375em/1.3 var(--serif); color: var(--terracotta-deep); white-space: nowrap; text-overflow: ellipsis; transform: translateX(-50%); }
.bar-weather { font-weight: 600; white-space: nowrap; }
.call-count { margin-right: auto; font-weight: 700; color: var(--terracotta-deep); }
.bar-date { font-weight: 500; white-space: nowrap; }
.bar-clock { font: 600 1.375em/1.3 var(--serif); font-variant-numeric: tabular-nums lining-nums; color: var(--terracotta-deep); }
button.quiet { min-height: 44px; padding: .4em .8em; font-size: .875em; font-weight: 500; color: var(--muted); background: transparent; }
button.quiet:hover:not(:disabled) { color: var(--ink); background: transparent; }
button.quiet[data-armed], button.quiet[data-armed]:hover:not(:disabled) { font-weight: 700; color: #fff; background: var(--terracotta); }
.board { min-height: 0; overflow-y: auto; }
.idle { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 2vh; min-height: 100%; padding: calc(2 * var(--u)); }
.idle-hero { text-align: center; }
.idle-note { font: 600 calc(2.8 * var(--u))/1.35 var(--serif); }
/* 교시 표시 밑: 교실·선생님, 그 수업의 교과 공지와 준비물. 길면 항목마다 두 줄까지만 보인다. */
.lesson-info { margin-top: .35em; font-size: calc(1.6 * var(--u)); line-height: 1.35; }
.lesson-info p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.lesson-info p + p { margin-top: .15em; }
.lesson-info strong { color: var(--terracotta-deep); }
.board-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: calc(2 * var(--u)); align-items: start; font-size: calc(1.15 * var(--u)); }
.board-panel { padding-top: 14px; border-top: 3px solid var(--terracotta); }
.board-panel h2 { margin-bottom: 12px; font-size: 1.25em; }
.board-panel .section-head { margin-bottom: 0; }
.board-note { margin-bottom: 20px; line-height: 1.6; white-space: pre-wrap; }
/* 지금 교시는 가운데, 디데이 목록은 넓은 화면에서 급식 칸 위(4열)에 놓는다. 가운데 칸에 교시 아래 수업 안내가 들어가도록 높이를 넉넉히 두고, 넘치는 디데이는 숨긴다. */
.idle-class-notice h2 { margin-bottom: .2em; font-size: calc(1.25 * var(--u)); color: var(--terracotta-deep); }
.idle-class-notice .board-note { margin: 0; font-size: calc(1.65 * var(--u)); font-weight: 600; line-height: 1.35; }
.idle-ddays li { font-size: calc(1.65 * var(--u)); font-weight: 600; line-height: 1.35; }
.idle-ddays strong { color: var(--terracotta-deep); }
.board-lunch { line-height: 1.6; white-space: pre-wrap; }
.board-lunch p + p { margin-top: .6em; }
.board-lunch strong { display: block; color: var(--terracotta-deep); }
.board-list li { padding: 7px 0; line-height: 1.5; border-top: 1px solid var(--line); white-space: pre-wrap; }
.board-list li:first-child { padding-top: 0; border-top: 0; }
.board-list strong { color: var(--terracotta-deep); }
/* 글자 크기는 칸 너비에도 맞춘다. 창이 좁아져 칸이 좁아지면 과목 이름이 줄바꿈되지 않게 함께 작아진다. */
#schedule-panel { container-type: inline-size; }
.schedule li { display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: 0 .5em; align-items: baseline; padding: 7px 8px; border-top: 1px solid var(--line); word-break: keep-all; }
.schedule li > span { grid-column: 2; }
.schedule time { font-size: .82em; white-space: nowrap; }
.schedule { padding: 4px 8px; font-size: min(1em, 5.2cqi); }
/* 지금 교시는 배경색으로만 구분한다. */
/* 지금 교시·오늘 날짜 강조: 테마가 --now-bg(배경)·--now-ink(글씨)를 정하면 그 색, 아니면 강조색을 옅게 섞는다. */
.schedule li.current { color: var(--now-ink, inherit); background: var(--now-bg, color-mix(in srgb, var(--terracotta) 22%, var(--paper))); }
.schedule li.current .muted { color: var(--now-ink, var(--muted)); }
.board-posts li.pinned { font-weight: 600; }
.board-request { padding: 12px 0; border-top: 1px solid var(--line); }
.board-request p { margin-top: 4px; line-height: 1.5; }
.board-reply { margin-top: 8px; padding: 10px 12px; background: var(--terracotta-soft); }
.board-reply button { margin-top: 8px; }
.panel-stack { display: grid; gap: calc(2 * var(--u)); align-content: start; min-height: 0; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin-bottom: 10px; text-align: center; }
.calendar-head { font-size: .78em; color: var(--muted); }
.calendar-day { padding: .15em 0; font-variant-numeric: tabular-nums; border-radius: 3px; }
.calendar-day.has-items { cursor: pointer; }
.calendar-day.has-items .calendar-number { font-weight: 700; color: var(--terracotta-deep); text-decoration: underline; text-underline-offset: 3px; }
.calendar-day.today { color: var(--now-ink, inherit); background: var(--now-bg, var(--terracotta-soft)); }
.profile-photo { display: grid; place-items: center; flex: none; width: 96px; height: 96px; overflow: hidden; font: 600 2rem/1 var(--serif); color: var(--terracotta-deep); background: var(--terracotta-soft); border-radius: 50%; }
.profile-photo img, .avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar { overflow: hidden; }
.profile-edit { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.profile-edit > div:last-child { flex: 1; min-width: 0; }
.notice-boards { margin-bottom: 14px; }
button.alarm, button.alarm:hover:not(:disabled) { color: #fff; background: #c62828; }
button.alarm[data-armed], button.alarm[data-armed]:hover:not(:disabled) { background: #7f1d1d; }
.subject-pick { flex: none; width: 110px; margin-top: 0; }
.admin-nav button[hidden] { display: none; }
/* 창 폭이 761px 이상이면 데스크탑 화면(교사도 관리자와 같은 왼쪽 메뉴), 760px 이하면 모바일 화면(아래 탭)이다. 주소는 하나이고 창 폭으로 저절로 갈린다. */
@media (min-width: 761px) {
  .teacher-view { padding-bottom: 40px; }
  .teacher-view .bottom-nav, #open-grade-admin { display: none; }
  .teacher-view .tabs { width: auto; margin: 0; padding: 0 18px 48px 2px; } /* 오른쪽 스크롤 막대에 내용이 붙지 않게 */
  .teacher-view .desk-off { display: none; }
  .teacher-view .notice-grid > .panel > h2:first-child, .teacher-view .night-block > .panel > h2:first-child, .teacher-view .room-block > .panel > h2:first-child, .teacher-view .note-block > .panel:first-child > h2:first-child { display: none; }
  .teacher-view .notice-grid > .panel > .board-example + h2, .teacher-view .note-block > .board-example + .panel > h2:first-child { display: none; }
  .teacher-view > .profile, .content-view > .profile { width: min(100%, 1200px); }
}
@media (max-width: 760px) {
  .teacher-view .admin-nav { display: none; }
  .teacher-view .admin-layout { display: block; padding: 0; }
}
/* 사진 편집: 동그라미 안이 칠판에 보이는 부분이다. */
.photo-editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px 20px; align-items: start; margin-bottom: 14px; padding: 12px; background: var(--paper); border: 1px solid var(--line); }
.photo-editor[hidden] { display: none; }
.photo-stage { position: relative; width: min(100%, 240px); aspect-ratio: 1; overflow: hidden; }
.photo-stage canvas { display: block; width: 100%; height: 100%; cursor: move; touch-action: none; }
.photo-stage::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .4); pointer-events: none; }
.photo-tools .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.photo-result { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.teacher-card { display: flex; gap: 14px; padding: 12px; margin-bottom: 12px; background: var(--paper); border-left: 3px solid var(--terracotta); }
.teacher-card > div:last-child { min-width: 0; }
.teacher-intro { margin-top: 6px; line-height: 1.5; white-space: pre-wrap; }
#default-room-panel select { flex: none; width: 130px; margin-top: 0; }
.board-panel #open-contact { margin-bottom: 8px; }
.board-modal { width: min(96vw, calc(78 * var(--u))); max-width: none; max-height: 92vh; max-height: 92dvh; padding: 0; color: var(--ink); background: var(--oatmeal); border: 0; border-top: 4px solid var(--terracotta); font-size: calc(1.05 * var(--u)); }
.board-modal::backdrop { background: color-mix(in srgb, var(--ink) 60%, transparent); }
.modal-inner { padding: calc(2 * var(--u)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { font-size: 1.5em; }
.contact-step { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.contact-step h3 { margin: 0 0 10px; font: 600 1.15em/1.3 var(--serif); }
.contact-to, .contact-from { margin: 8px 0; font: 600 1.3em/1.3 var(--serif); }
.contact-from { text-align: right; }
.classroom { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
button.desk, .desk.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 58px; padding: 6px 2px; font-size: .9375em; font-weight: 600; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 3px; }
button.desk small { font-size: .78em; font-weight: 400; color: var(--muted); }
button.desk:hover:not(:disabled) { background: var(--terracotta-soft); }
button.desk[aria-pressed="true"], button.desk[aria-pressed="true"]:hover:not(:disabled) { color: #fff; background: var(--terracotta); border-color: var(--terracotta); }
button.desk[aria-pressed="true"] small { color: #fff; }
button.desk:disabled { color: color-mix(in srgb, var(--muted) 45%, var(--oatmeal)); background: transparent; }
button.desk:disabled small { color: color-mix(in srgb, var(--muted) 45%, var(--oatmeal)); }
.teacher-desk.available small { font-weight: 600; color: var(--terracotta-deep); }
.desk.empty { min-height: 44px; font-size: .75em; font-weight: 400; color: color-mix(in srgb, var(--muted) 60%, var(--oatmeal)); background: transparent; border-style: dashed; }
.offices { display: flex; flex-direction: column; gap: 10px; }
.office-tabs, .office-seats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
button.office-tab[aria-expanded="true"], button.office-tab[aria-expanded="true"]:hover:not(:disabled) { color: #fff; background: var(--terracotta); }
.contact-hint { margin-bottom: 8px; }
.contact-form .row button { flex: 1; }
.emergency { display: flex; flex-wrap: wrap; gap: .4em 1em; padding: .7em calc(2 * var(--u)); font-size: calc(2 * var(--u)); font-weight: 600; color: #fff; background: #e65100; }
.emergency strong { flex: none; }
.emergency.saying-band { font-size: calc(1.6 * var(--u)); font-weight: 400; justify-content: center; text-align: center; background: var(--terracotta-deep); } /* 한마디는 긴급 공지보다 작게 */
/* 화재·재난 경보: 빨강으로 천천히 깜박인다(눈에 부담이 없도록 초당 1회 이하). */
.emergency.alarm-banner { flex-direction: column; align-items: center; gap: .15em; padding: .5em calc(2 * var(--u)); font-size: calc(2.8 * var(--u)); font-weight: 800; text-align: center; background: #d50000; animation: alarm-pulse 1s ease-in-out infinite alternate; }
.emergency.alarm-banner strong { font-size: 1.4em; }
@keyframes alarm-pulse { to { background: #7f0000; } }
@media (prefers-reduced-motion: reduce) { .emergency.alarm-banner { animation: none; } }
.board-error { padding: 15vh 24px; font-size: calc(2.6 * var(--u)); text-align: center; color: var(--terracotta-deep); }

/* 호출이 오면 칠판 전체가 테라코타로 바뀐다. 칸보다 크면 fitCalls가 카드를 줄여 스크롤 없이 맞춘다. */
.board.has-calls { display: grid; grid-auto-rows: minmax(min-content, 1fr); gap: calc(1.2 * var(--u)); padding: calc(1.6 * var(--u)); background: var(--terracotta); animation: attention 1s ease-in-out 3; }
.board.many { grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(29 * var(--u))), 1fr)); }
.call { display: flex; flex-direction: column; padding: calc(3 * var(--u)); text-align: center; background: var(--paper); }
.call-from { font-size: min(3.2vw, 5vh); font-weight: 700; color: var(--terracotta-deep); }
.call-class { margin-top: .3em; font-size: min(2.8vw, 4.5vh); font-weight: 700; }
.call h1 { font: 700 min(8.5vw, 15vh)/1.2 var(--serif); letter-spacing: -.02em; }
.where { margin-top: .3em; font-size: min(4.2vw, 7vh); font-weight: 700; color: var(--terracotta-deep); }
.where-label { margin-right: .6em; font-size: .6em; font-weight: 600; color: var(--muted); white-space: nowrap; }
.call-message { flex: 1 1 auto; margin-top: .7em; font-size: min(2.8vw, 4.5vh); line-height: 1.45; white-space: pre-wrap; }
.from { margin: .6em 0; font-size: min(1.8vw, 3vh); color: var(--muted); }
.board-view .ack { position: sticky; bottom: calc(1.6 * var(--u)); flex: none; align-self: center; width: min(100%, calc(37.5 * var(--u))); min-height: 11vh; font-size: min(3vw, 5vh); }
.board.many .call, .call.long { padding: calc(1.8 * var(--u)); }
.board.many .call h1, .call.long h1 { font-size: min(4.2vw, 8vh); }
.board.many .where, .call.long .where { font-size: min(2.4vw, 4.5vh); }
.board.many .call-message, .call.long .call-message { font-size: min(1.7vw, 3vh); }
.board.many .call-from, .call.long .call-from,
.board.many .call-class, .call.long .call-class { font-size: min(1.7vw, 3vh); }
.board.many .ack, .call.long .ack { min-height: 8vh; font-size: min(2vw, 3.5vh); }
.board.many .call.long .call-message { font-size: min(1.35vw, 2.4vh); }
.board.many .call.long .where { font-size: min(1.7vw, 3vh); }
.board.many .call.long h1 { font-size: min(3.4vw, 6.5vh); }
@keyframes attention { 50% { background: color-mix(in srgb, var(--terracotta) 60%, white); } }

/* 가로 화면의 칠판은 페이지가 밀리지 않게 한 화면에 맞추고, 긴 내용은 칸 안에서 밀어 본다. */
.idle { height: 100%; }
.idle-hero { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(2 * var(--u)); align-items: center; min-height: calc(3.2 * 1.35 * calc(2.8 * var(--u))); padding-block: calc(1.5 * var(--u)); }
.idle-hero .idle-now { grid-column: 2 / 4; }
.idle-side { position: relative; align-self: stretch; text-align: left; }
.idle-side > * { position: absolute; inset: 0; overflow: hidden; }
.panel-stack { display: flex; flex-direction: column; }
.panel-stack > .board-panel { flex: 0 1 auto; }
.board-panels { grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: 0; height: 100%; align-items: stretch; }
.board-panel { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.schedule li { padding-block: 5px; }
@media (max-width: 760px) {
  .call-grid { grid-template-columns: minmax(0, 1fr); }
  .roster { max-height: 340px; }
}
@media (max-width: 520px) {
  .call-row { grid-template-columns: minmax(0, 1fr) auto; }
  .call-row .call-text { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .board.has-calls { animation: none; }
}
#board-accounts-form { margin-top: 20px; }
/* 계정 만들기와 교사시간표로 한꺼번에 만들기 사이에 줄을 긋고 띄운다 */
#teacher-file-form { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

/* 관리자: 왼쪽 메뉴 + 가운데에 고른 화면 하나 */
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; width: min(100%, 1200px); margin: 0 auto; padding: 8px clamp(18px, 4vw, 40px) 48px; }
.admin-nav { position: sticky; top: 12px; display: grid; gap: 18px; }
.admin-group-name { margin-bottom: 4px; padding-left: 12px; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.admin-nav button { display: block; width: 100%; min-height: 42px; padding: 8px 12px; font-weight: 500; text-align: left; color: var(--ink); background: transparent; }
.admin-nav button:hover:not(:disabled) { background: var(--paper); }
.admin-nav button[aria-current="page"], .admin-nav button[aria-current="page"]:hover:not(:disabled) { font-weight: 700; color: var(--terracotta-deep); background: var(--terracotta-soft); box-shadow: inset 3px 0 0 var(--terracotta); }
.admin-pane { width: min(100%, 760px); margin: 0 auto; padding-top: 16px; scroll-margin-top: 12px; }
.admin-pane > h1 { margin-bottom: 16px; }
.admin-pane > .muted { margin-bottom: 16px; }
.board-example { margin: 0 0 24px; }
@media (max-width: 760px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .admin-nav { position: static; display: flex; gap: 4px; overflow-x: auto; }
  .admin-group { display: contents; }
  .admin-group-name { display: none; }
  .admin-nav button { width: auto; white-space: nowrap; }
}
/* 데스크탑: 왼쪽 메뉴와 가운데 내용은 각자 스크롤한다. 마우스가 있는 쪽만 움직이고 맨 위 줄은 고정이다. */
@media (min-width: 761px) {
  .teacher-view, .content-view { display: flex; flex-direction: column; height: calc(100dvh / var(--zoom, 1)); padding-bottom: 0; overflow: hidden; }
  .teacher-view > .profile, .content-view > .profile { flex: none; }
  .teacher-view > .admin-layout, .content-view > .admin-layout { flex: 1; grid-template-rows: minmax(0, 1fr); align-items: stretch; min-height: 0; padding-bottom: 0; }
  .admin-nav, .admin-layout > main { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .admin-nav { position: static; align-content: start; }
  .admin-layout > main { padding: 0 18px 48px 2px; } /* 오른쪽 스크롤 막대에 내용이 붙지 않게 */
}

/* 칠판 예시 화면: 실제 칠판 대기 화면과 같은 배치를 작게 그린다. */
.mini-board { container-type: inline-size; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); gap: 1.2cqi; aspect-ratio: 16 / 9; padding: 1.2cqi; overflow: hidden; background: var(--oatmeal); border: 10px solid #3a332d; border-radius: 8px; }
.mini-board * { font-size: 2.1cqi; line-height: 1.35; }
.mini-board strong { display: block; margin-bottom: .3em; font-weight: 700; }
.mini-board span { display: block; }
.mini-zone, button.mini-zone { display: flex; flex-direction: column; justify-content: flex-start; min-width: 0; min-height: 0; margin: 0; padding: .5em .7em; overflow: hidden; font: inherit; text-align: left; color: var(--ink); background: var(--paper); border: 0; border-top: 2px solid var(--terracotta); border-radius: 2px; }
button.mini-zone { cursor: pointer; }
button.mini-zone:hover:not(:disabled) { color: var(--ink); background: var(--terracotta-soft); outline: 2px solid var(--terracotta); outline-offset: -2px; }
.mini-bar { flex-direction: row; gap: 2em; border-top: 0; border-bottom: 1px solid var(--line); background: transparent; }
.mini-bar span:first-child { margin-right: auto; font-weight: 700; }
.mini-zone.mini-emergency, button.mini-zone.mini-emergency { flex-direction: row; gap: 1em; color: #fff; background: #e65100; border-top: 0; }
.mini-emergency strong { margin: 0; }
.mini-hero { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2cqi; align-items: center; }
.mini-hero .mini-zone, .mini-hero button.mini-zone { padding-block: .2em; border-top: 0; background: transparent; }
.mini-hero .mini-now { grid-column: 2 / 4; align-items: center; font-weight: 700; }
.mini-now * { font-size: 2.6cqi; }
.mini-side strong { margin: 0; color: var(--terracotta-deep); }
.mini-hero .mini-dday { font-weight: 700; color: var(--terracotta-deep); }
.mini-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2cqi; min-height: 0; }
.mini-stack { display: flex; flex-direction: column; gap: 1.2cqi; min-height: 0; }
.mini-stack > .mini-zone { flex: 0 1 auto; }
.mini-board.has-hit .mini-zone:not(.hit) { opacity: .35; }
.mini-zone.hit { outline: 3px solid var(--ink); outline-offset: -3px; }
.admin-pane > .panel > h2:first-child { display: none; }
.layout-arrows { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
/* 원래 시간표와 달라진 교시(수업 교체, 장소 변경)는 ! 표시와 까닭을 보여 준다. */
.change-mark { font-weight: 800; color: var(--terracotta-deep); }
.schedule li.changed > span { font-weight: 700; color: var(--terracotta-deep); }
.lesson-change { grid-column: 1 / -1; font-size: .78em; font-weight: 600; line-height: 1.35; color: var(--terracotta-deep); }
.lesson-notice { color: var(--ink); }
#layout-panel { grid-column: 1 / -1; }
#layout-panel .mini-board { max-width: 900px; }
/* 연락 창은 넓은 화면에서 창 전체가 스크롤되지 않게 한 화면에 맞춘다. 자리가 아주 많을 때만 그 칸 안에서 밀어 본다. */
#contact-modal[open] { display: flex; flex-direction: column; overflow: hidden; }
#contact-modal .modal-inner { display: flex; flex: 1; flex-direction: column; min-height: 0; padding-block: 1.6vh; }
#contact-modal .modal-head { margin-bottom: 8px; }
#contact-modal .contact-form { display: flex; flex: 1; flex-direction: column; min-height: 0; }
#contact-modal .classroom, #contact-modal .offices { flex: 1; min-height: 0; max-height: none; overflow-y: auto; align-content: start; }
#contact-modal label { margin-bottom: 8px; }
#contact-modal textarea { flex: 1; min-height: 0; }
#contact-modal .teacher-card { flex: none; padding: 8px; margin-bottom: 8px; }
#contact-modal .profile-photo { width: 64px; height: 64px; font-size: 1.5rem; }
#contact-modal .teacher-intro { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
#contact-modal button.desk { min-height: 5.4vh; }

/* 테마: 눈이 편한 낮은 채도 위주. data-theme은 html(내 화면)과 미리보기 상자에 붙는다. 이름은 예전 변수 이름을 그대로 쓴다. */
[data-theme="sage"] { --oatmeal: #e6ece3; --paper: #f5f8f3; --ink: #243029; --muted: #5a695f; --line: #cbd7c9; --terracotta: #4f7a5c; --terracotta-deep: #3b6047; --terracotta-soft: #d5e5d8; }
[data-theme="sky"] { --oatmeal: #e5ebf0; --paper: #f5f8fa; --ink: #22303b; --muted: #586774; --line: #c9d5de; --terracotta: #4a7396; --terracotta-deep: #365a78; --terracotta-soft: #d4e2ee; }
[data-theme="lavender"] { --oatmeal: #ece9f1; --paper: #f8f6fa; --ink: #2c2635; --muted: #645c70; --line: #d7d0e1; --terracotta: #6e5a92; --terracotta-deep: #564675; --terracotta-soft: #e1daed; }
[data-theme="gray"] { --oatmeal: #e9e9e6; --paper: #f6f6f4; --ink: #2a2a29; --muted: #62625c; --line: #d4d4ce; --terracotta: #5c6d71; --terracotta-deep: #475558; --terracotta-soft: #dce3e3; }
[data-theme="cream"] { --oatmeal: #f3efe2; --paper: #fbf9f2; --ink: #2f2b22; --muted: #6a6352; --line: #ddd5bf; --terracotta: #8a7a3c; --terracotta-deep: #6b5e2c; --terracotta-soft: #ece4c6; }
/* 눈이 편한 칠판용 세 가지(사용자가 준 색표). --oatmeal 전체 배경, --terracotta 상단 헤더바·연락 버튼, --ink 기본 글씨,
   --line 구분선, --terracotta-soft 강조 배경(지금 교시·오늘 날짜), --terracotta-deep 강조 글씨(디데이 등).
   보조 글씨(--muted)는 색표의 구분선 색이 글씨로는 너무 흐려서 읽히는 만큼만 진하게/밝게 했다. */
[data-theme="charcoal"] { --now-bg: #424242; color-scheme: dark; --oatmeal: #1e1e1e; --paper: #262626; --ink: #e0e0e0; --muted: #a0a0a0; --line: #555555; --terracotta: #333333; --terracotta-deep: #ffb74d; --terracotta-soft: #424242; --bar-bg: #333333; --bar-ink: #e0e0e0; }
[data-theme="chalk"] { --now-bg: #345c3f; color-scheme: dark; --oatmeal: #1b3b22; --paper: #21452a; --ink: #f8f9fa; --muted: #b5cdb9; --line: #4a7053; --terracotta: #2e5236; --terracotta-deep: #ffd54f; --terracotta-soft: #345c3f; --bar-bg: #2e5236; --bar-ink: #f8f9fa; }
[data-theme="sepia"] { --now-bg: #efebe9; --oatmeal: #fdfbf7; --paper: #fffdf9; --ink: #333333; --muted: #6d625c; --line: #d7ccc8; --terracotta: #8d6e63; --terracotta-deep: #d84315; --terracotta-soft: #efebe9; --bar-bg: #8d6e63; --bar-ink: #ffffff; }
/* 소프트 블루(쿨그레이): 강조 배경은 선명한 스카이 블루에 흰 글씨. 헤더바는 배경보다 한 톤 진한 블루그레이에 기본 글씨. */
[data-theme="coolblue"] { --oatmeal: #f0f4f8; --paper: #f8fafc; --ink: #2d3748; --muted: #5a6779; --line: #cbd5e0; --terracotta: #4a90e2; --terracotta-deep: #2b6cb0; --terracotta-soft: #dce8f7; --bar-bg: #e2e8f0; --bar-ink: #2d3748; --now-bg: #4a90e2; --now-ink: #ffffff; }
/* 이 테마들은 칠판 맨 위 줄을 헤더바 색으로 칠하고, 한마디 띠도 헤더바 색으로 한다(강조 글씨 색 띠에 흰 글씨는 안 읽힌다). */
.board-bar { color: var(--bar-ink, inherit); background: var(--bar-bg, transparent); }
:is([data-theme="charcoal"], [data-theme="chalk"], [data-theme="sepia"]) :is(.bar-motto, .bar-clock) { color: var(--bar-ink); }
:is([data-theme="charcoal"], [data-theme="chalk"], [data-theme="sepia"], [data-theme="coolblue"]) .board-bar :is(.status, button) { color: var(--bar-ink); opacity: .85; } /* 연결 상태·로그아웃도 헤더바 위에서 읽히게 */
:is([data-theme="charcoal"], [data-theme="chalk"], [data-theme="sepia"]) .emergency.saying-band { color: var(--bar-ink); background: var(--bar-bg); }
/* 직접 고르기: 배경색(--oatmeal)과 강조색(--terracotta)만 정하고 나머지는 섞어서 만든다. */
[data-theme="custom"] {
  --paper: color-mix(in srgb, var(--oatmeal) 45%, white);
  --line: color-mix(in srgb, var(--oatmeal) 82%, var(--ink));
  --terracotta-deep: color-mix(in srgb, var(--terracotta) 80%, black);
  --terracotta-soft: color-mix(in srgb, var(--terracotta) 20%, var(--paper));
}
[data-theme] { color: var(--ink); background: var(--oatmeal); }
/* 글씨 크기: 화면 전체를 --zoom 배로. 칠판은 한 화면에 맞춰야 하므로 높이를 그만큼 나눈다. */
body { zoom: var(--zoom, 1); }
.board-view { height: calc(100dvh / var(--zoom, 1)); }
.auth-view { min-height: calc(100dvh / var(--zoom, 1)); }
.look-preview { margin: 8px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-top: 3px solid var(--terracotta); background: var(--paper); color: var(--ink); }
.look-preview strong { color: var(--terracotta-deep); }
.look-colors { display: flex; gap: 12px; }
.look-colors input[type=color] { min-height: 46px; padding: 4px; }
/* 칠판 안의 버튼·작은 글씨도 rem(고정) 대신 칸 글자 크기를 따라 화면과 함께 커지게 한다. */
.board-view :where(button, input, textarea, select) { font-size: 1em; }
.board-view button.text-link, .board-view button.small { font-size: .875em; }
.board-view :where(.muted, .tag, .eyebrow) { font-size: .8125em; }
.board-view :where(label) { font-size: .875em; }
.board-view .feedback { font-size: .9375em; }
/* 칠판 안의 고정 크기도 창을 따라 줄어든다. 창이 작아져도 배치는 그대로고 전체가 같은 비율로 작아진다(1920 화면에서 1u = 19.2px). */
.board-view button:not(.ack, .desk, .text-link, .post-open), .board-view :is(input, textarea) { min-height: calc(2.4 * var(--u)); padding: calc(0.5 * var(--u)) calc(0.9 * var(--u)); }
.board-view :is(input, textarea) { margin-top: calc(0.3 * var(--u)); }
.board-view button.text-link { min-height: calc(1.7 * var(--u)); }
.board-view button.desk, .board-view .desk.empty { min-height: calc(3 * var(--u)); padding: calc(0.3 * var(--u)) calc(0.1 * var(--u)); }
.board-view .desk.empty { min-height: calc(2.3 * var(--u)); }
.board-view .board-panel { padding-top: calc(0.73 * var(--u)); border-top-width: calc(0.16 * var(--u)); }
.board-view .board-panel h2 { margin-bottom: calc(0.62 * var(--u)); }
.board-view .board-panel #open-contact { margin-bottom: calc(0.42 * var(--u)); }
.board-view .board-note { margin-bottom: calc(1 * var(--u)); }
.board-view .idle-class-notice .board-note { margin: 0; }
.board-view .board-list li { padding: calc(0.36 * var(--u)) 0; }
.board-view .board-list li:first-child { padding-top: 0; }
.board-view .schedule { padding: calc(0.2 * var(--u)) calc(0.42 * var(--u)); }
.board-view .schedule li { padding: calc(0.26 * var(--u)) calc(0.42 * var(--u)); }
.board-view .calendar { gap: calc(0.1 * var(--u)); margin-bottom: calc(0.5 * var(--u)); }
.board-view .board-request { padding: calc(0.62 * var(--u)) 0; }
.board-view .board-request p { margin-top: calc(0.2 * var(--u)); }
.board-view .board-reply { margin-top: calc(0.42 * var(--u)); padding: calc(0.5 * var(--u)) calc(0.62 * var(--u)); }
.board-view .board-reply button { margin-top: calc(0.42 * var(--u)); }
.board-view .modal-head { gap: calc(0.62 * var(--u)); margin-bottom: calc(0.42 * var(--u)); }
.board-view .contact-step h3 { margin-bottom: calc(0.5 * var(--u)); }
.board-view .contact-to, .board-view .contact-from { margin-block: calc(0.42 * var(--u)); }
.board-view .classroom { gap: calc(0.3 * var(--u)); margin-top: calc(0.5 * var(--u)); }
.board-view .offices { gap: calc(0.5 * var(--u)); }
.board-view .office-tabs, .board-view .office-seats { gap: calc(0.3 * var(--u)); }
#contact-modal button.office-tab { min-height: calc(3.2 * var(--u)); padding: calc(0.2 * var(--u)); }
.board-view .contact-hint { margin-bottom: calc(0.42 * var(--u)); }
.board-view .teacher-card { gap: calc(0.73 * var(--u)); padding: calc(0.42 * var(--u)); margin-bottom: calc(0.42 * var(--u)); }
#contact-modal .profile-photo { width: calc(3.3 * var(--u)); height: calc(3.3 * var(--u)); font-size: calc(1.25 * var(--u)); }
#contact-modal .offices button.desk, #contact-modal .offices .desk.empty { min-height: calc(3.6 * var(--u)); padding-block: calc(0.1 * var(--u)); }
#contact-modal label { margin-bottom: calc(0.42 * var(--u)); }
#contact-modal .modal-head { margin-bottom: calc(0.42 * var(--u)); }
/* 내 과목 기본 교실: 칸을 눌러 고른다. */
.content-item:has(.room-picker) { flex-wrap: wrap; }
.room-picker-slot:empty { display: none; }
.content-item > div.room-picker-slot { flex: 1 1 100%; } /* 교실 고르기 칸은 한 줄 전체 */
.room-picker-actions { display: flex; gap: 8px; margin-top: 12px; }
.room-now { margin-top: 4px; font-weight: 600; color: var(--terracotta-deep); }
.room-group { margin-top: 10px; }
.room-group-name { margin-bottom: 4px; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.room-group-name:empty { display: none; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.room-picker button.desk { min-height: 44px; }
button.room-choice { flex: none; }
/* 예시 상자 속 실제 칠판(1920x1080을 상자 너비에 맞게 줄임). 누를 수 없는 그림으로만 쓴다. */
.board-preview { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--oatmeal); border: 10px solid #3a332d; border-radius: 8px; }
.board-preview.board-top { aspect-ratio: 1920 / 180; margin-bottom: 14px; border-width: 6px; }
.board-preview iframe { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; }
/* 예시 칠판에서 이 메뉴가 나오는 칸: 두꺼운 형광펜 동그라미. 예시는 40% 정도로 줄여 보이므로 굵게 그린다. */
/* 예시 그림의 형광펜: 두께는 그대로 두고, 칸 안을 노랗게 칠하고 나머지 칠판을 어둡게 눌러 눈에 띄게 한다. */
.preview-hit { z-index: 51; outline: 10px solid rgb(255 230 0); outline-offset: 6px; border-radius: 28px; box-shadow: 0 0 0 20px rgb(255 120 0 / .5); }
.preview-hit:not(.idle-side > *) { position: relative; }
.preview-hit:not(.emergency) { background: var(--oatmeal); }
.emergency.preview-hit { outline-offset: -10px; border-radius: 0; box-shadow: inset 0 0 0 18px rgb(255 120 0 / .5); }
.board-view:has(.preview-hit)::after { content: ''; position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .62); pointer-events: none; }
/* 학생 호출: 학년 → 반을 누르면 그 반 학생이 칸으로 나온다(칠판 연락 창 자리표와 같은 모양). */
.pick-grades, .pick-classes { display: grid; gap: 6px; margin-top: 10px; }
.pick-grades { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pick-classes { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.pick-grades button.desk, .pick-classes button.desk { min-height: 44px; }
/* 칠판 연락 창의 학생 자리표와 같은 크기: 한 줄에 5명. 폰은 글자가 잘리지 않게 3명. */
.roster { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding-top: 12px; max-height: 520px; }
@media (max-width: 760px) { .roster { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.roster > li.empty { grid-column: 1 / -1; }
.roster .student { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 58px; padding: 6px 2px; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; }
.roster .student[aria-pressed="true"], .roster .student[aria-pressed="true"]:hover:not(:disabled) { color: #fff; background: var(--terracotta); border-color: var(--terracotta); box-shadow: none; }
.roster .student[aria-pressed="true"] :is(.student-class, .room) { color: #fff; }
.roster .room { font-size: .8125rem; font-family: var(--sans); }
@media (max-width: 520px) { .pick-classes { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.test-time { margin-top: 14px; font-size: .875rem; color: var(--muted); }
.test-time summary { cursor: pointer; }
.test-time .row { margin-top: 8px; }
#account-panel .content-actions select { width: auto; margin-top: 0; min-height: 38px; padding-block: 4px; font-size: .875rem; }
#account-panel .perm-box { flex-basis: 100%; min-width: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; }
#account-panel .perm-box summary { cursor: pointer; font-weight: 600; }
#account-panel .perm-box .class-group { margin: 8px 0 0; }
.perm-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
/* 교사 화면 맨 위 줄: 왼쪽 이름, 가운데 상담 상태, 오른쪽 연결 상태. 좁은 화면에서는 상담 상태가 둘째 줄 가운데로 간다. */
.teacher-profile { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.teacher-profile .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.teacher-profile .who strong { margin-right: 0; }
.content-view > .profile strong { margin-right: 0; }
/* 이름을 누르면 내 정보(프로필 편집)가 열린다. */
button.name-link { min-height: 0; padding: 0; font: inherit; color: inherit; background: none; cursor: pointer; }
button.name-link:hover:not(:disabled) { text-decoration: underline; background: none; }
.content-view > .profile .plane { margin-right: auto; }
.alarm-row { margin-bottom: 12px; }
.help-link { display: inline-flex; gap: 4px; align-items: center; min-height: 0; padding: 0; font: inherit; font-weight: 700; color: var(--terracotta-deep); background: none; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.help-link:hover:not(:disabled) { color: var(--terracotta); background: none; }
.help-link img { width: 1.2em; height: 1.2em; }
#message-modal { width: min(96vw, 560px); }
#message-modal .modal-inner { padding: 20px; }
#my-post-modal { width: min(96vw, 620px); font-size: 1rem; } /* 교사 화면의 교과 공지 작성 창: 칠판용 큰 창이 아니라 메시지 창 크기 */
#my-post-modal .modal-inner { padding: 20px; }
#my-post-modal h2 { font-size: 1.25rem; }
#message-modal h3 { margin: 18px 0 6px; font-size: 1rem; }
.message-students { margin-bottom: 12px; }
.help-footer { flex: none; padding: 10px 18px; font-size: .8125rem; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
.teacher-profile .status { justify-self: end; }
button.plane, button.plane:hover:not(:disabled) { position: relative; flex: none; width: 42px; min-height: 42px; padding: 8px; background: transparent; }
button.plane img { display: block; width: 100%; }
.plane-count:not(:empty) { position: absolute; top: 0; right: -4px; min-width: 20px; padding: 0 5px; font-size: .75rem; font-weight: 700; line-height: 20px; color: #fff; text-align: center; background: #d32f2f; border-radius: 10px; }
.bar-presence { display: flex; flex-direction: column; align-items: center; }
.bar-presence .presence-row { gap: 6px; }
.bar-presence .feedback { margin-top: 4px; font-size: .8125rem; }
.bar-presence .feedback:empty { display: none; }
@media (max-width: 640px) {
  .teacher-profile { grid-template-columns: minmax(0, 1fr) auto; }
  .bar-presence { grid-column: 1 / -1; grid-row: 2; }
}

/* 칠판 한눈에 보기: 반마다 상자 하나. 연결됨은 초록, 연결 안 됨은 흐리게. 누른 반은 테두리. */
.board-states-grade { margin: 16px 0 8px; font-size: 1rem; }
.board-states { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 640px) { .board-states { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
button.board-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 68px; padding: 6px 2px; color: var(--muted); background: var(--paper); border: 2px solid var(--line); border-radius: 4px; }
button.board-state:not(.online):hover:not(:disabled) { background: var(--terracotta-soft); }
.board-state-label { font-size: .75rem; font-weight: 600; }
.board-state strong { font-size: 1.25rem; }
button.board-state.online { color: #3f5631; background: #e4ecd9; border-color: #7d9463; }
button.board-state.asleep { color: #34465a; background: #dde5ee; border-color: #6f8399; }
button.board-state[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
.map-refresh { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.map-refresh p { margin: 0; }
.board-view-title { margin: 20px 0 10px; font-size: 1.25rem; text-align: center; }
.board-example img { display: block; max-width: 100%; height: auto; margin-inline: auto; border: 1px solid var(--line); border-radius: 6px; }

/* 공지 미리보기: 칠판에 보이는 모양을 작게 흉내 낸다. */
.post-preview { margin: 4px 0 14px; padding: 12px; background: var(--oatmeal); border: 1px dashed var(--line); border-radius: 6px; }
.post-preview-title { margin-bottom: 8px; font-size: .8125rem; font-weight: 700; color: var(--muted); }
/* 칠판과 같은 비율: 미리보기 칸 폭을 칠판 폭(100u)으로 보고 맨 위 띠는 글자 2u, 칸은 칠판 칸 폭 22.5u에 글자 1.15u(학급 공지는 1.65u). */
.pv-board { container-type: inline-size; }
.pv-emergency { display: flex; flex-wrap: wrap; gap: .4em 1em; padding: .7em 2cqi; font-size: 2cqi; font-weight: 600; color: #fff; background: #e65100; white-space: pre-wrap; }
.pv-emergency.pv-saying { font-size: 1.6cqi; font-weight: 400; justify-content: center; text-align: center; background: var(--terracotta-deep); }
.pv-note { width: calc(13.64 * 23px); max-width: 100%; }
.pv-note small { display: block; font-size: .8125rem; font-weight: 700; color: var(--terracotta-deep); }
.pv-note p { font-size: 23px; font-weight: 600; line-height: 1.35; white-space: pre-wrap; }
.pv-panel { width: 19.6em; max-width: 100%; padding-top: 10px; font-size: 16px; border-top: 3px solid var(--terracotta); }
.pv-panel h4 { margin: 0 0 8px; font-size: 1.25em; }
.pv-panel p { line-height: 1.5; white-space: pre-wrap; }
.pv-panel strong { color: var(--terracotta-deep); }

/* 학급 칠판 설정 */
.layout-guide ol { margin: 0 0 10px; padding-left: 1.3em; list-style: decimal; line-height: 1.7; }
.layout-spare { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0; }
.layout-spare strong { margin-right: 4px; font-size: .875rem; }

/* 학생 DB */
.roster-db { margin-bottom: 16px; }
.roster-db details { margin-top: 4px; }
.roster-db summary { font-size: .875rem; color: var(--terracotta-deep); cursor: pointer; }
.roster-week { margin-top: 6px; border-collapse: collapse; font-size: .8125rem; background: var(--paper); }
.roster-week th, .roster-week td { padding: 4px 8px; text-align: center; border: 1px solid var(--line); white-space: nowrap; }
.roster-add .row { align-items: end; }
.roster-add select, .roster-add input { margin-top: 4px; }
.contact-warning { flex: 1; margin: 0; padding: 8px 12px; font-size: .9375em; font-weight: 600; line-height: 1.5; color: var(--terracotta-deep); background: var(--terracotta-soft); border-left: 4px solid var(--terracotta-deep); }
#contact-send { flex: 0 0 34%; }
#contact-send[data-armed] { background: var(--terracotta-deep); }
.contact-send { display: flex; gap: calc(.6 * var(--u)); align-items: stretch; margin-top: calc(.2 * var(--u)); }

/* 야간자율학습 출결: 칠판 가운데(지금 교시 아래)와 교사 입력 칸 */
.night-line { display: flex; flex-wrap: wrap; justify-content: center; gap: .3em 1.2em; font-weight: 600; }
.idle-note .night-line { margin-top: .35em; font-size: .55em; }
.night-line strong { color: var(--terracotta-deep); }
#night-panel .night-line { justify-content: flex-start; margin: 10px 0; }
/* 야자 출결: 한 줄에 한 학생(번호·이름·스터디룸·조퇴결석 체크). 넓으면 단을 나누되 번호는 위에서 아래로(1,2,3… 다음 단). */
.night-list { column-width: 22em; column-gap: 18px; margin-top: 8px; border-top: 1px solid var(--line); }
.night-list .night-row { break-inside: avoid; }
.night-row { display: grid; grid-template-columns: 3em minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 48px; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.night-number { font-size: .875rem; color: var(--muted); }
.night-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.night-check { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .9375rem; white-space: nowrap; cursor: pointer; }
.night-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--terracotta); }
.night-row.night-study { background: #e4ecd9; }
.night-row.night-absent { color: var(--muted); background: var(--oatmeal); }
.night-row.night-absent .night-name { text-decoration: line-through; }

/* 시험용 시간을 쓰는 브라우저임을 늘 보이게 한다. */
html.test-clock::after {
  content: '시험용 시간 사용 중';
  position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 9999;
  padding: 4px 12px; border-radius: 999px; background: #c62828; color: #fff;
  font: 600 13px/1.4 var(--sans, sans-serif); pointer-events: none;
}

/* 학생 호출: 좁은 데스크탑 창에서도 학생 칸 글자가 두 줄로 깨지지 않게 명단 쪽을 넓히고 줄바꿈을 막는다. */
.roster .student > span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 761px) and (max-width: 1280px) { .call-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; } }

/* 칠판 교과 공지: 누르면 자세히 보기. 안 본 글은 이름 뒤에 N */
.post-open { display: block; width: 100%; min-height: 0; padding: 0; font: inherit; color: inherit; text-align: left; background: none; border: 0; cursor: pointer; }
.post-open:hover:not(:disabled) { background: none; box-shadow: none; text-decoration: underline; }
.new-badge { display: inline-block; padding: 0 .3em; font-size: .75em; font-weight: 700; line-height: 1.35; vertical-align: .15em; color: #fff; background: #e53935; border-radius: 3px; }
.post-detail { display: grid; gap: 10px; }
.post-detail-by { font-weight: 700; color: var(--terracotta-deep); }
.post-detail-title { font-size: 1.25rem; font-weight: 700; }
.post-detail-text { font-size: 1.25rem; line-height: 1.5; white-space: pre-wrap; }
.pv-bar { font-size: 1cqi; padding: .6em 2cqi; background: var(--paper); }
.pv-bar-time { margin-left: auto; color: var(--muted); }
/* 수업 바꾸기: 한 주 시간표 표. 내 수업은 옅은 색, 고른 칸은 진한 색, 1대1로 바꿀 수 있는 칸은 초록 테두리 */
#swap-form { grid-column: 1 / -1; }
.swap-week { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
.swap-grid { overflow-x: auto; }
.swap-table { width: 100%; min-width: 520px; table-layout: fixed; border-collapse: collapse; font-size: .875rem; }
.swap-table th { padding: 6px 4px; font-weight: 600; color: var(--muted); text-align: center; }
.swap-table tbody th { width: 3.6em; }
.swap-table td { padding: 2px; }
.swap-cell { display: grid; place-content: center; gap: 2px; width: 100%; min-height: 3.6em; padding: 4px 2px; font: inherit; line-height: 1.25; color: var(--ink); text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.swap-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swap-cell span { overflow: hidden; font-size: .85em; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.swap-cell:disabled { cursor: default; opacity: .45; }
.swap-cell:hover:not(:disabled) { background: var(--paper); box-shadow: inset 0 0 0 2px var(--terracotta); }
.swap-cell.mine, .swap-cell.mine:hover:not(:disabled) { background: var(--terracotta-soft); }
.swap-cell.can-swap, .swap-cell.can-swap:hover:not(:disabled) { border: 2px solid #2e7d32; background: #e6f2e6; }
.swap-cell.can-swap:disabled { opacity: .7; }
/* 교실 칸(교실 변경의 옮겨 갈 교실, 교실 사용 현황 배치도). 빈 교실은 초록, 쓰는 교실은 바탕색. */
.map-room { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; min-height: 52px; padding: 4px 2px; font: inherit; line-height: 1.2; color: var(--ink); text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; }
.map-room strong { font-size: .9375em; }
.map-use { max-width: 100%; overflow: hidden; font-size: .75em; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.map-room.free { background: #e6f2e6; border: 2px solid #2e7d32; }
.map-room.free .map-use { color: #2e7d32; }
button.map-room { cursor: pointer; }
button.map-room:hover { box-shadow: inset 0 0 0 2px var(--terracotta); }
button.map-room[aria-pressed="true"] { color: #fff; background: var(--terracotta-deep); border-color: var(--terracotta-deep); }
button.map-room[aria-pressed="true"] .map-use { color: #fff; }
.busy-rooms { margin: 12px 0; }
.busy-rooms summary { font-weight: 600; cursor: pointer; }
.floor-map { overflow-x: auto; }
.floor h4 { margin: 14px 0 6px; font-size: .875rem; color: var(--muted); }
.floor-rows { display: grid; grid-template-columns: repeat(var(--cols), minmax(68px, 1fr)); gap: 4px; min-width: calc(var(--cols) * 72px); }
.map-mark { display: grid; place-items: center; min-height: 52px; font-size: .75em; color: var(--muted); text-align: center; background: color-mix(in srgb, var(--line) 35%, transparent); border-radius: 4px; }
.use-free { font-weight: 600; color: #2e7d32; }
.cover-names { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.cover-pick.first { color: #1b5e20; background: #e6f2e6; border: 2px solid #2e7d32; }
.cover-pick.second { color: #6d4c00; background: #fff4cc; border: 2px solid #c9a227; }
.swap-cell.picked, .swap-cell.picked:hover:not(:disabled) { color: #fff; background: var(--terracotta-deep); border-color: var(--terracotta-deep); }
.swap-cell.picked span { color: #fff; }
/* 프로필 사진 넣는 곳: 점선 상자 안의 안내를 누르거나 사진을 끌어다 놓는다. 실제 파일 칸은 상자 뒤에 숨긴다. */
.photo-drop { position: relative; display: grid; place-items: center; gap: 4px; min-height: 96px; padding: 16px; margin-bottom: 8px; text-align: center; color: var(--muted); background: var(--paper); border: 2px dashed var(--line); border-radius: 8px; cursor: pointer; }
.photo-drop strong { font-size: 1.0625rem; color: var(--terracotta-deep); }
.photo-drop:hover, .photo-drop:focus-within, .photo-drop.dragging { color: var(--ink); background: var(--terracotta-soft); border-color: var(--terracotta); }
.photo-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
/* 연락: 자리를 누르면 본인이 맞는지 묻는 줄 */
.student-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: calc(0.6 * var(--u)) calc(1 * var(--u)); margin: calc(0.6 * var(--u)) 0; padding: calc(0.8 * var(--u)) calc(1.2 * var(--u)); background: var(--terracotta-soft); border-radius: 6px; }
.student-confirm p { flex: 1 1 14em; margin: 0; font-size: 1.1em; }
.student-photo { display: grid; place-items: center; flex: none; width: 64px; height: 64px; overflow: hidden; font: 600 1.5rem/1 var(--serif); color: var(--terracotta-deep); background: var(--terracotta-soft); border-radius: 50%; }
.student-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; } /* 얼굴이 위쪽에 있어 위를 조금 더 보인다 */
/* 칠판: 1분이 지나 대기 화면으로 돌아간 호출. 반 이름 옆 종이비행기와 숫자, 누르면 다시 뜬다. */
.board-view button.call-plane { width: calc(2.8 * var(--u)); min-height: calc(2.8 * var(--u)); padding: calc(0.35 * var(--u)); }
.board-view .call-plane .plane-count:not(:empty) { min-width: 1.6em; font-size: calc(0.9 * var(--u)); line-height: 1.6em; }
.riro-help { margin: 8px 0 12px; }
.riro-help img { display: block; width: 100%; max-width: 640px; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.riro-help figcaption { margin-top: 6px; font-size: .875rem; }
/* 교사끼리 대화: 학생 연락처럼 말풍선. 받은 것 왼쪽, 보낸 것 오른쪽, 아래에 입력 칸 */
.chat-thread { display: grid; align-content: start; gap: 8px; min-height: 180px; max-height: min(52vh, 460px); margin: 10px 0; padding: 12px; overflow-y: auto; background: var(--oatmeal); border: 1px solid var(--line); border-radius: 6px; }
.chat-thread .bubble-row:not(.mine) { justify-content: flex-start; }
.chat-empty { align-self: center; text-align: center; }
#message-modal .message-form { width: 100%; }
/* 칠판 첫 자료가 다 오기 전: 내용을 가리고 가운데에 안내만 */
/* 처음 자료가 다 올 때까지 화면을 가린다(app.js show). 금방 열리면 안내 글도 보이지 않게 0.4초 뒤에 띄운다. */
#app.app-loading > * { visibility: hidden; }
#app.app-loading::after { content: '불러오는 중…'; position: fixed; inset: 0; display: grid; place-items: center; font-size: 1.5rem; color: var(--muted); animation: loading-late 0s .4s backwards; }
@keyframes loading-late { from { opacity: 0; } }
/* 메뉴를 옮길 때 새 화면을 자료가 다 올 때까지 뒤에 숨겨 만든다(이전 화면은 그대로 보임) */
#app > .app-next { position: fixed; inset: 0; overflow: hidden; visibility: hidden; pointer-events: none; }
/* 지금 교시(I) 아래 줄: 수업 장소 */
.now-place { display: block; margin-top: .2em; font-size: .6em; color: var(--terracotta-deep); }
.night-actions { display: flex; gap: 8px; margin-top: 12px; }
#night-save.night-unsaved { box-shadow: 0 0 0 3px color-mix(in srgb, var(--terracotta) 35%, transparent); }
.swap-table .empty-cell { cursor: default; background: transparent; border-style: dashed; }
/* 칠판 야자 출결 줄 아래 「수정하기」 */
.idle-note .night-edit { display: block; margin: .5em auto 0; font-size: .4em; }
#night-modal .night-list { margin-bottom: calc(1 * var(--u)); }
/* 야자 출결 현황 표: 학년 × 1~9반, 칸마다 남은/재적 */
.night-status { overflow-x: auto; margin-top: 8px; }
.night-status-table { width: 100%; min-width: 640px; border-collapse: collapse; text-align: center; font-size: .9375rem; }
.night-status-table th, .night-status-table td { padding: 6px 4px; border: 1px solid var(--line); }
.night-status-table thead th, .night-status-table tbody th { font-weight: 600; color: var(--muted); background: var(--oatmeal); }
.night-status-table td strong { display: block; font-variant-numeric: tabular-nums; }
.night-status-table td small { display: block; font-size: .75rem; color: var(--muted); }
.night-status-table td.night-none strong { font-weight: 400; color: var(--muted); }
.night-status-table td.night-sum { background: var(--terracotta-soft); }
#night-panel { grid-column: 1 / -1; } /* 현황 표가 넓어서 한 줄 전체 */
/* 야자: 출결 칸과 현황 칸을 위아래로, 현황 앞에 제목 */
.night-block { grid-column: 1 / -1; }
.night-block .block-title, .room-block .block-title { margin: 56px 0 20px; font: 600 clamp(1.75rem, 4vw, 2.5rem)/1.25 var(--serif); letter-spacing: -.02em; } /* 맨 위 큰 제목과 같은 크기, 위 칸과 두어 줄 띄움 */
.room-block { grid-column: 1 / -1; }
@media (max-width: 760px) { .night-block .block-title, .room-block .block-title { display: none; } }
#default-room-panel, #room-change-form { grid-column: 1 / -1; }
/* 칠판 모양: 왼쪽 고르기, 오른쪽 넓게 실제 칠판 미리보기(세 번째 칸 가운데, 넓으면 더 보임) */
.look-board .look-body { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 14px; }
.look-crop { position: relative; height: clamp(300px, 48vh, 460px); overflow: hidden; border: 6px solid #3a332d; border-radius: 6px; background: #3a332d; }
.look-crop iframe { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; }
@media (max-width: 760px) { .look-board .look-body { grid-template-columns: minmax(0, 1fr); } }

/* 방과후학교 강좌 목록: 붙여 넣은 표를 칸마다 고친다. 잘못된 줄은 빨갛게 */
.after-grid { overflow-x: auto; margin: 8px 0 12px; }
.after-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .875rem; }
.after-table th { padding: 6px 4px; font-weight: 600; color: var(--muted); text-align: left; }
.after-table td { padding: 2px; }
.after-table input { width: 100%; padding: 4px 6px; font: inherit; }
.after-table tr.bad input { border-color: #c62828; background: #fdecea; }
#after-add { margin-top: 6px; }
.after-table button { white-space: nowrap; }
