/* ════════════════════════════════════════════════════
   담임노트+ · 스타일
   콘셉트: 심플한 파스텔 알림장 — 크림색 바탕, 흰 카드, 살구·하늘·민트·레몬 포인트
   파스텔은 배경에만 쓰고 글자는 진한 색으로 (읽기 쉬운 대비 유지)
   외부 리소스 없음 — file:// 오프라인 환경 대응
   ════════════════════════════════════════════════════ */

:root {
  /* 바탕·글자 */
  --canvas: #fdfaf5;       /* 본문 바탕 (크림) */
  --paper: #ffffff;        /* 카드 */
  --side: #fff5eb;         /* 사이드바 */
  --soft: #fbf6ef;         /* 옅은 칸 바탕 (표 머리, 입력칸) */
  --ink: #3b3531;          /* 본문 글자 */
  --ink-sub: #7d716a;      /* 보조 글자 */
  --line: #f0e6da;         /* 테두리 */
  --line-strong: #e6d6c3;

  /* 파스텔 포인트: 바탕(-bg) + 그 위 글자(-ink) */
  --peach-bg: #ffe2d3;  --peach-ink: #a4441f;  --peach-mid: #ffcdb5;
  --sky-bg: #dff0fb;    --sky-ink: #1f5f8b;    --sky-mid: #b9def5;
  --mint-bg: #dcf3e6;   --mint-ink: #22704a;
  --lemon-bg: #fff3c4;  --lemon-ink: #7a5a00;  --lemon-mid: #f5dc85;
  --lilac-bg: #ebe5fb;  --lilac-ink: #5b45a8;
  --pink-bg: #fde3ea;   --pink-ink: #a8385a;
  --rose-bg: #fdeaea;   --danger: #d34b47;

  --brand: #c85a33;        /* 로고·제목 포인트 */
  --radius: 18px;
  --pill: 999px;           /* 버튼·메뉴 모서리 (심플·시크는 각지게) */
  --shadow: 0 2px 10px rgba(140, 100, 60, 0.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

button { font-family: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 13.5px; color: var(--ink); }
:focus-visible { outline: 3px solid var(--sky-mid); outline-offset: 1px; }

/* ── 레이아웃 ── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 212px;
  flex-shrink: 0;
  background: var(--side);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { padding: 2px 10px 16px; border-bottom: 2px dashed var(--line-strong); }
.brand-title { font-size: 20px; font-weight: 900; letter-spacing: -0.3px; color: var(--brand); }
.brand-title .plus { color: var(--sky-ink); }
.brand-sub { margin-top: 3px; font-size: 11.5px; color: var(--ink-sub); }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; flex: 1; }
.nav-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px;
  border: none; border-radius: var(--pill);
  background: transparent; color: var(--ink-sub);
  font-size: 14px; font-weight: 700; text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-btn:hover { background: #fdebdc; color: var(--ink); }
.nav-btn.active { background: var(--peach-bg); color: var(--peach-ink); }
.nav-ic { font-size: 16px; }

.side-foot { font-size: 10.5px; color: var(--ink-sub); padding: 10px 10px 0; line-height: 1.6; opacity: 0.85; }
.side-foot a { color: inherit; font-size: 12.5px; font-weight: 800; text-decoration: none; }
.side-foot a:hover { text-decoration: underline; }
.m-guide-top { display: block; text-align: center; text-decoration: none; font-weight: 800; font-size: 14.5px; padding: 10px; margin-bottom: 12px;
  border-radius: 12px; background: var(--sky-bg); color: var(--sky-ink); border: 1.5px solid var(--sky-mid); }
.m-guide-home { display: inline-block; margin-top: 10px; font-size: 13.5px; font-weight: 800; color: var(--ink-sub); text-decoration: none;
  padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--paper); }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; max-width: 1180px; }

/* ── 페이지 머리 ── */
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.page-head h1 { font-size: 21px; font-weight: 900; letter-spacing: -0.3px; white-space: nowrap; }
.count-chip {
  background: var(--lemon-bg); color: var(--lemon-ink);
  font-size: 12px; font-weight: 800;
  padding: 3px 11px; border-radius: 999px;
}

/* ── 2단 ── */
.two-col { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.col-left, .col-right { min-width: 0; }

/* ── 카드 ── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head h2 { font-size: 15.5px; font-weight: 800; }
.edit-badge {
  background: var(--lemon-bg); color: var(--lemon-ink);
  font-size: 11px; font-weight: 800;
  padding: 2px 9px; border-radius: 999px;
}

/* ── 폼 ── */
.frow { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.frow.col { flex-direction: column; align-items: stretch; }
.frow label { font-size: 12.5px; font-weight: 700; color: var(--ink-sub); flex-shrink: 0; }

input:not([type]), input[type="text"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  background: var(--soft);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--sky-mid); background: #fff; }
textarea { width: 100%; resize: vertical; }
.frow input[type="text"] { flex: 1; min-width: 120px; }
input[type="checkbox"] { accent-color: var(--brand); }

.section-label {
  margin: 18px 0 8px;
  font-size: 12.5px; font-weight: 800; color: var(--peach-ink);
  display: inline-block;
  background: var(--peach-bg);
  padding: 2px 11px;
  border-radius: 999px;
}

.grade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; }
.grade-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.grade-item label { font-size: 12.5px; color: var(--ink-sub); font-weight: 600; white-space: nowrap; }
.grade-item select { width: 76px; flex-shrink: 0; padding: 6px 2px 6px 7px; font-size: 12.5px; }

.check-grid { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.check-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 12.5px; cursor: pointer;
  padding: 4px 9px; border-radius: 999px;
}
.check-label:hover { background: var(--soft); }

/* ── 버튼 ── */
.btn-primary, .btn-secondary, .btn-cancel, .btn-ghost {
  border-radius: var(--pill);
  font-size: 13.5px; font-weight: 800;
  padding: 9px 18px;
  border: 1.5px solid transparent;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--peach-bg); color: var(--peach-ink); border-color: var(--peach-mid); }
.btn-primary:hover { background: var(--peach-mid); }
.btn-secondary { background: var(--sky-bg); color: var(--sky-ink); border-color: var(--sky-mid); }
.btn-secondary:hover { background: var(--sky-mid); }
.btn-cancel { background: #fff; color: var(--ink-sub); border-color: var(--line-strong); }
.btn-cancel:hover { background: var(--soft); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); padding: 8px 14px; }
.btn-ghost:hover { background: var(--soft); }
button:disabled { opacity: 0.5; cursor: default; }
.full { width: 100%; margin-top: 10px; }

/* ── 검색/일괄 ── */
.search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.search-row input { flex: 1; }

.bulk-box {
  background: #fbfdff;
  border: 1.5px dashed var(--sky-mid);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}
.bulk-box textarea { background: #fff; }
.bulk-help { margin: 0 0 6px; font-size: 12px; line-height: 1.5; color: var(--ink-sub); }
.bulk-help b { color: var(--sky-ink); }
.bulk-preview {
  margin: 6px 0 8px;
  padding: 6px 10px;
  font-size: 12px; line-height: 1.6;
  border-radius: 10px;
  background: var(--sky-bg);
  color: var(--sky-ink);
  white-space: pre-line;
}
.bulk-reset {
  display: flex; align-items: center; gap: 6px;
  margin: 4px 0 2px;
  font-size: 12px; font-weight: 700; color: var(--peach-ink);
  cursor: pointer;
}

/* ── 백업 알림 배너 ── */
.backup-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 10px;
  padding: 9px 14px;
  font-size: 12px;
  border-radius: 14px;
  background: var(--lemon-bg);
  border: 1px solid var(--lemon-mid);
  color: var(--lemon-ink);
}
.backup-hint .hint-close {
  border: none; background: none; color: inherit;
  font-size: 12px; padding: 2px 4px; flex-shrink: 0;
}

/* 모든 화면 위에 뜨는 백업 알림 */
.app-banner { margin-bottom: 14px; font-size: 12.5px; font-weight: 700; }
.app-banner[hidden] { display: none; }
.banner-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.banner-actions .btn-ghost { padding: 4px 12px; font-size: 12px; }

/* ── 설정 화면 ── */
.set-card { max-width: 560px; }
.set-card .section-label:first-child { margin-top: 0; }
.set-grid {
  display: grid; grid-template-columns: 72px minmax(0, 220px);
  align-items: center; gap: 8px 10px;
}
.set-grid label { font-size: 12.5px; font-weight: 700; color: var(--ink-sub); }
.set-help { margin-top: 8px; font-size: 11.5px; color: var(--ink-sub); }
.set-actions { margin-top: 18px; }
.set-meta { margin-top: 12px; font-size: 11px; color: var(--ink-sub); }

/* ── 학생 목록 ── */
.student-list { display: flex; flex-direction: column; gap: 8px; }
.stu-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  transition: border-color 0.15s, background 0.15s;
}
.stu-item:hover { border-color: var(--sky-mid); }
.stu-item.editing { border-color: var(--lemon-mid); background: #fffdf0; }
.stu-no {
  width: 30px; height: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--sky-bg); color: var(--sky-ink);
  font-size: 12.5px; font-weight: 900;
  border-radius: 50%;
}
.stu-body { flex: 1; min-width: 0; }
.stu-name { font-size: 14.5px; font-weight: 800; }
.stu-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag {
  font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--soft); color: var(--ink-sub);
}
.tag.t-m    { background: var(--sky-bg);   color: var(--sky-ink); }
.tag.t-f    { background: var(--pink-bg);  color: var(--pink-ink); }
.tag.t-lv   { background: var(--lilac-bg); color: var(--lilac-ink); }
.tag.t-ld   { background: var(--lemon-bg); color: var(--lemon-ink); }
.tag.t-cf   { background: var(--rose-bg);  color: var(--danger); }
.tag.t-tr   { background: var(--soft);     color: var(--ink-sub); }
.tag.t-care { background: var(--mint-bg);  color: var(--mint-ink); }
.stu-note { margin-top: 5px; font-size: 12px; color: var(--ink-sub); }
.stu-actions { display: flex; gap: 4px; flex-shrink: 0; }
.ic {
  border: none; background: transparent;
  font-size: 14px; padding: 4px 7px; border-radius: 999px;
  transition: background 0.15s;
}
.ic:hover { background: var(--soft); }
.ic.del:hover { background: var(--rose-bg); }

.empty { text-align: center; color: var(--ink-sub); padding: 32px 0; font-size: 13px; }

/* ── 백업 화면 ── */
.bk-info {
  font-size: 12.5px; font-weight: 700; color: var(--mint-ink);
  background: var(--mint-bg);
  padding: 9px 14px; border-radius: 14px;
  margin-bottom: 14px;
}
.bk-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 2px;
  border-bottom: 1.5px dashed var(--line);
}
.bk-row:last-of-type { border-bottom: none; }
.bk-text h3 { font-size: 14px; font-weight: 800; margin-bottom: 3px; }
.bk-text p { font-size: 12.5px; color: var(--ink-sub); }
.bk-row button, .bk-file { flex-shrink: 0; }
.bk-file { display: inline-block; cursor: pointer; }
.bk-note {
  margin-top: 12px;
  font-size: 11.5px; color: var(--lemon-ink);
  background: var(--lemon-bg);
  padding: 9px 14px; border-radius: 14px;
}

/* ── 토스트 ── */
.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translate(-50%, 16px);
  background: var(--ink); color: #fff;
  font-size: 13px; font-weight: 700;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(60, 40, 20, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 999;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { background: var(--mint-ink); }
.toast.error { background: var(--danger); }
.toast.info { background: #57504b; }

/* ── 반응형 ── */
@media (max-width: 960px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center;
    padding: 10px 14px; gap: 12px;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .brand { border-bottom: none; padding: 0; flex-shrink: 0; }
  .brand-sub { display: none; }
  .nav { flex-direction: row; margin-top: 0; overflow-x: auto; gap: 2px; }
  .nav-btn { white-space: nowrap; padding: 8px 12px; font-size: 13px; }
  .side-foot { display: none; }
  .main { padding: 18px 14px 60px; }
  .two-col { grid-template-columns: 1fr; }
}

/* ── 학교 일정: 월중행사 미리보기 ── */
.pv-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.pv-top label { font-size: 12.5px; font-weight: 700; color: var(--ink-sub); display: flex; align-items: center; gap: 6px; }
.pv-top input[type="number"] { width: 84px; }
.pv-file { font-weight: 800; color: var(--brand); flex: 1; min-width: 180px; }
.pv-warn { font-size: 12.5px; font-weight: 700; color: var(--lemon-ink); background: var(--lemon-bg); padding: 9px 14px; border-radius: 14px; margin-bottom: 10px; }
.pv-sum { font-size: 13px; font-weight: 800; color: var(--sky-ink); background: var(--sky-bg); padding: 9px 14px; border-radius: 14px; margin-bottom: 10px; }
.pv-bar, .sc-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pv-spacer { flex: 1; }
.pv-toggle { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 5px; cursor: pointer; }
.pv-legend { font-size: 11.5px; color: var(--ink-sub); display: flex; align-items: center; gap: 4px; }
.pv-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 6px; }
.pv-dot.review { background: var(--lemon-bg); border: 1px solid var(--lemon-mid); }
.pv-dot.holiday { background: var(--rose-bg); border: 1px solid #f4bcbc; }
.pv-help { font-size: 11.5px; color: var(--ink-sub); margin-bottom: 10px; }
.pv-scroll { overflow-x: auto; border: 1.5px solid var(--line); border-radius: 14px; }
.pv-table { width: 100%; min-width: 980px; border-collapse: collapse; font-size: 12.5px; }
.pv-table th { background: var(--soft); text-align: left; font-size: 12px; color: var(--ink-sub); padding: 8px 6px; position: sticky; top: 0; }
.pv-table td { border-top: 1px solid var(--line); padding: 5px 6px; vertical-align: top; }
.pv-table input, .pv-table select { width: 100%; padding: 4px 7px; font-size: 12.5px; border-radius: 8px; }
.pv-table tr.review td { background: #fffaea; }
.pv-table tr.holiday td { background: #fff5f5; }
.pv-table tr.holiday .pv-date input[data-f="date"] { color: var(--danger); font-weight: 700; }
.pv-table tr.removed td { opacity: 0.4; }
.pv-table tr.removed .pv-title input { text-decoration: line-through; }
.pv-date { width: 150px; white-space: nowrap; }
.pv-date input[data-f="date"] { width: 118px; }
.pv-wd { font-size: 11.5px; color: var(--ink-sub); margin-left: 4px; }
.pv-end { margin-top: 3px; font-size: 11px; color: var(--ink-sub); }
.pv-end input { width: 118px; font-size: 11.5px; }
.pv-addend { display: block; margin-top: 3px; border: none; background: none; font-size: 11px; color: var(--sky-ink); padding: 0; text-decoration: underline; }
.pv-title { min-width: 300px; }
.pv-grade { width: 70px; }
.pv-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.pv-tags span { font-size: 10.5px; background: var(--mint-bg); color: var(--mint-ink); padding: 1px 7px; border-radius: 999px; }
.pv-reason { margin-top: 3px; font-size: 11px; font-weight: 700; color: var(--lemon-ink); }

/* ── 학교 일정: 월별 목록 ── */
.sc-month { font-size: 15px; font-weight: 900; min-width: 110px; text-align: center; }
.sc-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.sc-day { display: flex; gap: 12px; padding: 10px 4px; border-bottom: 1.5px dashed var(--line); }
.sc-day:last-child { border-bottom: none; }
.sc-date { width: 72px; flex-shrink: 0; font-weight: 800; font-size: 13px; }
.sc-date.holiday { color: var(--danger); }
.sc-day ul { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sc-review { font-size: 10.5px; font-weight: 800; background: var(--lemon-bg); color: var(--lemon-ink); padding: 1px 7px; border-radius: 999px; }

/* ── 학교 일정: 레이아웃 · 도구 막대 ── */
.page-head .bk-file { cursor: pointer; }
.sc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.sc-side { display: flex; flex-direction: column; gap: 14px; }
.sc-side .card { padding: 16px; }
.side-title { font-size: 14.5px; font-weight: 900; margin-bottom: 8px; }
.side-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.side-head .side-title { margin-bottom: 0; }
.side-add { padding: 4px 11px; font-size: 12px; }
.side-empty { font-size: 12.5px; color: var(--ink-sub); padding: 8px 2px; }
.side-empty small { font-size: 11.5px; }
.sc-nav { padding: 5px 11px; font-size: 12px; }
.sc-today { padding: 5px 12px; font-size: 12px; }
button.sc-date { border: none; background: none; text-align: left; font: inherit; font-weight: 800; font-size: 13px; padding: 0; }

.toggle {
  border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink-sub);
  border-radius: 999px; padding: 6px 13px; font-size: 12.5px; font-weight: 800; white-space: nowrap;
}
.toggle[aria-pressed="true"] { background: var(--mint-bg); border-color: #b5e3c8; color: var(--mint-ink); }
.toggle[aria-pressed="true"]::before { content: "✓ "; }
.seg { display: inline-flex; background: var(--soft); border: 1.5px solid var(--line); border-radius: var(--pill); padding: 2px; }
.seg button { border: none; background: none; border-radius: var(--pill); padding: 5px 13px; font-size: 12.5px; font-weight: 800; color: var(--ink-sub); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(140, 100, 60, 0.15); }

/* ── 달력 ── */
.cal { border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--soft); }
.cal-head div { text-align: center; font-size: 12px; font-weight: 800; color: var(--ink-sub); padding: 6px 0; }
.cal-head .sun { color: var(--danger); }
.cal-head .sat { color: var(--sky-ink); }
.cal-week {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: 104px; row-gap: 2px; padding-bottom: 4px;
  border-top: 1px solid var(--line);
}
.cal-cell {
  border: none; border-right: 1px solid var(--line); background: #fff;
  cursor: pointer; transition: background 0.12s;
}
.cal-cell:nth-child(7) { border-right: none; }
.cal-cell:hover { background: #fffaf3; }
.cal-cell.sun, .cal-cell.sat { background: #fffdfa; }
.cal-cell.holiday { background: #fff6f6; }
.cal-cell.other { background: #faf8f5; }
.cal-cell.selected { background: var(--sky-bg); box-shadow: inset 0 0 0 2px var(--sky-mid); }
.cal-num { pointer-events: none; padding: 4px 6px 2px; display: flex; align-items: baseline; gap: 4px; min-width: 0; font-size: 12.5px; font-weight: 800; }
.cal-num.red { color: var(--danger); }
.cal-num.blue { color: var(--sky-ink); }
.cal-num.other { opacity: 0.45; }
.cal-num .n.today { background: var(--peach-bg); color: var(--peach-ink); border-radius: 999px; padding: 0 7px; }
.cal-hname { font-size: 10.5px; font-weight: 800; color: var(--danger); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-bar, .cal-chip, .cal-more {
  display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: inherit; font-size: 11.5px; font-weight: 700; text-align: left; cursor: pointer;
}
.cal-bar {
  margin: 0 3px; height: 20px; line-height: 18px; padding: 0 8px; border-radius: 999px;
  border: 1px solid var(--sky-mid); background: var(--sky-bg); color: var(--sky-ink); z-index: 1;
}
.cal-bar.bar-series { background: var(--mint-bg); border-color: #b5e3c8; color: var(--mint-ink); }
.cal-bar.cont-start { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.cal-bar.cont-end { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.bar-n { font-size: 10px; opacity: 0.8; }
.cal-singles { display: flex; flex-direction: column; gap: 2px; padding: 0 3px; min-width: 0; z-index: 1; pointer-events: none; }
.cal-singles > * { pointer-events: auto; }
.cal-chip { border: none; background: var(--soft); color: var(--ink); border-radius: 7px; padding: 1px 6px; }
.cal-chip:hover, .cal-bar:hover { filter: brightness(0.97); }
.cal-more { border: none; background: none; color: var(--ink-sub); padding: 0 6px; font-size: 11px; }
/* 공통 표시: 내 담당 · 마감 · 완료 · 휴일 */
.cal-chip.is-mine, .cal-bar.is-mine { background: var(--peach-bg); border-color: var(--peach-mid); color: var(--peach-ink); }
.cal-chip.is-deadline, .cal-bar.is-deadline { background: var(--pink-bg); border-color: #f6c3d1; color: var(--pink-ink); }
.cal-bar.is-holiday { background: var(--rose-bg); border-color: #f4bcbc; color: var(--danger); }
.cal-chip.is-done, .cal-bar.is-done { text-decoration: line-through; opacity: 0.55; }
.ev-dl { font-size: 9.5px; font-weight: 900; background: #fff; color: var(--pink-ink); border-radius: 999px; padding: 0 5px; margin-left: 4px; text-decoration: none; }
.ev-clip { margin-left: 3px; font-size: 10.5px; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 11.5px; color: var(--ink-sub); margin-top: 8px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 4px; vertical-align: -1px; }
.lg-mine { background: var(--peach-bg); border: 1px solid var(--peach-mid); }
.lg-dl { background: var(--pink-bg); border: 1px solid #f6c3d1; }
.lg-period { background: var(--sky-bg); border: 1px solid var(--sky-mid); }
.lg-hol { background: var(--rose-bg); border: 1px solid #f4bcbc; }

/* ── 목록·패널 한 줄 ── */
.row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; column-gap: 6px; padding: 5px 4px; border-radius: 10px; }
.row + .row { margin-top: 2px; }
.row:hover { background: var(--soft); }
.row-title { border: none; background: none; text-align: left; font: inherit; font-size: 13px; padding: 2px 0; min-width: 0; color: var(--ink); }
.row-title:hover { text-decoration: underline; }
.row.is-mine .row-title { font-weight: 800; color: var(--peach-ink); }
.row.is-deadline .row-title { color: var(--pink-ink); font-weight: 800; }
.row.is-holiday .row-title { color: var(--danger); font-weight: 800; }
.row.is-done .row-title { text-decoration: line-through; color: var(--ink-sub); font-weight: 600; }
.row-meta { grid-column: 2 / -1; font-size: 11.5px; color: var(--ink-sub); }
.chk {
  width: 20px; height: 20px; border-radius: 7px; border: 2px solid var(--line-strong); background: #fff;
  font-size: 12px; font-weight: 900; line-height: 1; color: #fff; padding: 0;
}
.chk:hover { border-color: var(--mint-ink); }
.chk.on { background: var(--mint-ink); border-color: var(--mint-ink); }
.chk-sp { width: 20px; }
.due { font-size: 11px; font-weight: 800; color: var(--ink-sub); background: var(--soft); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.due.over { background: var(--rose-bg); color: var(--danger); }
.sc-day ul { flex: 1; min-width: 0; }

/* ── 창(모달) ── */
.modal-back {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(59, 53, 49, 0.35);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px; overflow-y: auto;
}
.modal { background: #fff; border-radius: 22px; width: 100%; max-width: 560px; box-shadow: 0 12px 40px rgba(60, 40, 20, 0.2); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.modal-head h2 { font-size: 17px; font-weight: 900; }
.modal-body { padding: 4px 20px 8px; }
.modal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px 18px; }
.fgrid { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px 10px; align-items: center; }
.fgrid label { font-size: 12.5px; font-weight: 700; color: var(--ink-sub); }
.frow-in { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink-sub); }
.frow-in input[type="date"] { width: 150px; }
.md-src { font-size: 11.5px; color: var(--ink-sub); margin-bottom: 10px; }
.md-checks { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.md-label { display: block; margin: 12px 0 6px; font-size: 12.5px; font-weight: 800; color: var(--ink-sub); }
.md-raw { margin-top: 6px; font-size: 11.5px; color: var(--ink-sub); }
.btn-cancel.danger { color: var(--danger); border-color: #f4bcbc; }
.btn-cancel.danger:hover { background: var(--rose-bg); }
.fgrid .seg { justify-self: start; }

/* 첨부 */
.drop {
  display: block; margin-top: 8px; padding: 14px; text-align: center; cursor: pointer;
  border: 2px dashed var(--sky-mid); border-radius: 14px; background: #fbfdff;
  font-size: 12.5px; color: var(--sky-ink);
}
.drop.over { background: var(--sky-bg); }
.file-row { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 5px; }
.file-row.missing { color: var(--ink-sub); font-size: 12px; justify-content: space-between; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-name small { color: var(--ink-sub); }
.file-open { padding: 3px 11px; font-size: 12px; }

/* 메모 날짜 제안 */
.suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.suggest:empty { display: none; }
.suggest-label { font-size: 11.5px; font-weight: 800; color: var(--ink-sub); }
.chip-btn { border: 1.5px solid var(--sky-mid); background: var(--sky-bg); color: var(--sky-ink); border-radius: var(--pill); padding: 3px 11px; font-size: 12px; font-weight: 800; }
.chip-btn.dl { border-color: #f6c3d1; background: var(--pink-bg); color: var(--pink-ink); }

/* 화면이 넓지 않으면 할 일·날짜 패널을 달력 아래로 */
@media (max-width: 1280px) {
  .sc-layout { grid-template-columns: minmax(0, 1fr); }
  .sc-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
}
@media (max-width: 960px) {
  .cal-week { min-height: 84px; }
  .cal-chip .ev-dl, .cal-hname { display: none; }
}

/* ── 관찰·출결 공통: 빠른 기록 카드 · 번호 격자 ── */
.quick { margin-bottom: 18px; }
.quick-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 10px; }
.quick-head .side-title { margin-bottom: 0; }
.quick-date { font-size: 12.5px; font-weight: 700; color: var(--ink-sub); display: flex; align-items: center; gap: 6px; }
.quick-help { font-size: 12px; color: var(--ink-sub); }
.picker-tools { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.picker-count { font-size: 12px; font-weight: 800; color: var(--sky-ink); margin-right: 4px; }
.picker-all { padding: 3px 11px; font-size: 12px; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.no-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 46px; padding: 4px 2px; border-radius: 14px;
  border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink);
  transition: background 0.12s, border-color 0.12s;
}
.no-btn b { font-size: 15px; font-weight: 900; line-height: 1.1; }
.no-btn small { font-size: 10.5px; color: var(--ink-sub); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-btn:hover { border-color: var(--sky-mid); }
.no-btn[aria-pressed="true"] { background: var(--sky-bg); border-color: var(--sky-ink); color: var(--sky-ink); }
.no-btn[aria-pressed="true"] small { color: var(--sky-ink); }
.quick-memo { margin: 10px 0 4px; }
.preset-groups { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.preset-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.preset-gname { width: 58px; flex-shrink: 0; font-size: 12px; font-weight: 900; color: var(--ink-sub); }
.preset-btn {
  border: 1.5px solid var(--peach-mid); background: var(--peach-bg); color: var(--peach-ink);
  border-radius: var(--pill); padding: 8px 15px; font-size: 13px; font-weight: 800;
}
.preset-btn:hover { background: var(--peach-mid); }
.preset-group:nth-child(2) .preset-btn { border-color: #b5e3c8; background: var(--mint-bg); color: var(--mint-ink); }
.preset-group:nth-child(2) .preset-btn:hover { background: #c6ebd5; }
.preset-group:nth-child(3) .preset-btn { border-color: var(--lemon-mid); background: var(--lemon-bg); color: var(--lemon-ink); }
.preset-group:nth-child(3) .preset-btn:hover { background: #ffeaa0; }
.last-save:not(:empty) {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px;
  padding: 7px 8px 7px 14px; border-radius: 14px; background: var(--mint-bg); color: var(--mint-ink); font-size: 12.5px; font-weight: 800;
}
.last-save .btn-ghost { padding: 4px 12px; font-size: 12px; }

/* ── 관찰: 학생별 보기 ── */
.ob-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; align-items: start; }
.period-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; }
.period-text { font-size: 12px; color: var(--ink-sub); }
.stu-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 5px; }
.stu-count {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; text-align: left; font-size: 13px;
}
.stu-count:hover { border-color: var(--sky-mid); }
.stu-count.on { border-color: var(--sky-ink); background: var(--sky-bg); }
.stu-count.zero { opacity: 0.55; }
.sc-no { font-weight: 900; color: var(--sky-ink); min-width: 18px; }
.sc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-c { font-size: 11.5px; font-weight: 800; color: var(--ink-sub); }
.label-counts { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 10px; }
.lc { font-size: 12px; background: var(--soft); border-radius: 999px; padding: 3px 10px; }
.lc b { color: var(--peach-ink); }
.ob-list { display: flex; flex-direction: column; gap: 4px; }
.ob-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1.2fr) auto; align-items: center; gap: 6px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.ob-date { font-size: 12px; font-weight: 800; color: var(--ink-sub); }
.ob-label { font-size: 13px; font-weight: 700; }
.ob-memo { padding: 4px 8px !important; font-size: 12.5px !important; }

/* 상황 버튼 편집 */
.pe-group { margin-bottom: 10px; }
.pe-gname { font-size: 12px; font-weight: 900; color: var(--ink-sub); margin-bottom: 4px; }
.pe-row { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.pe-row input { flex: 1; }
.pe-row .ic:disabled { opacity: 0.25; }
.pe-new { display: flex; gap: 6px; flex-wrap: wrap; }
.pe-new #peGroup { width: 120px; }
.pe-new #peLabel { flex: 1; min-width: 160px; }

/* ── 출결 ── */
.notice {
  margin-bottom: 14px; padding: 10px 16px; border-radius: 14px;
  background: var(--lemon-bg); border: 1px solid var(--lemon-mid); color: var(--lemon-ink);
  font-size: 13px; font-weight: 800;
}
.notice.small { font-size: 12px; margin-bottom: 10px; }
.at-choose { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.at-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.at-lbl { width: 36px; font-size: 12.5px; font-weight: 900; color: var(--ink-sub); }
.at-line #atMemo { width: 260px; max-width: 100%; }
.memo-hint { font-size: 11.5px; font-weight: 700; color: var(--pink-ink); }
.at-save { margin-top: 12px; }
.at-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.at-legend-t { font-size: 11.5px; color: var(--ink-sub); margin-left: 4px; }
.at-mark {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 7px; font-size: 11.5px; font-weight: 900;
}
.at-legend .at-mark { font-size: 11px; }
.r-ill { background: var(--sky-bg); color: var(--sky-ink); }
.r-un  { background: var(--rose-bg); color: var(--danger); }
.r-ok  { background: var(--mint-bg); color: var(--mint-ink); }
.r-etc { background: var(--lemon-bg); color: var(--lemon-ink); }
.at-table { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.at-table th, .at-table td { border: 1px solid var(--line); text-align: center; padding: 0; }
.at-table thead th { background: var(--soft); font-weight: 800; padding: 4px 0; min-width: 28px; line-height: 1.2; }
.at-table thead th small { display: block; font-size: 10px; color: var(--ink-sub); font-weight: 600; }
.at-table thead th.today { background: var(--peach-bg); color: var(--peach-ink); }
.at-table th.off, .at-table td.off { background: #fbf6f0; }
.at-table .at-stu { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; padding: 3px 10px; white-space: nowrap; font-weight: 800; min-width: 96px; }
.at-table .at-stu small { font-weight: 600; color: var(--ink-sub); }
.at-cell { width: 100%; min-height: 28px; border: none; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 2px 0; }
.at-cell:hover { background: var(--sky-bg); }
.at-cell .at-mark { min-width: 18px; height: 18px; font-size: 11px; padding: 0 3px; }
.at-edit { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.at-edit input { flex: 1; min-width: 120px; }
.sum-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.sum-table th, .sum-table td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; }
.sum-table thead th { background: var(--soft); font-size: 12px; color: var(--ink-sub); }
.sum-table td small { display: block; font-size: 11px; color: var(--ink-sub); }
.sum-table .zero { color: #cbbfb3; }

@media (max-width: 1100px) {
  .ob-grid { grid-template-columns: 1fr; }
}
#peList { margin-top: 12px; }

/* ── 새 버전 안내 (서비스 워커) ── */
.update-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px; padding: 9px 10px 9px 16px; border-radius: 14px;
  background: var(--sky-bg); border: 1px solid var(--sky-mid); color: var(--sky-ink); font-size: 13px; font-weight: 800;
}
.update-bar[hidden] { display: none; }
.update-bar .btn-primary { padding: 6px 14px; font-size: 12.5px; }

/* 좁은 화면에서 PC 화면을 고른 경우에만 보이는 “핸드폰 화면” 메뉴 */
.nav-btn.to-mobile { display: none; }
@media (max-width: 640px) { .nav-btn.to-mobile { display: flex; } }

/* ── 핸드폰 화면 ── */
.m-mode .sidebar { display: none; }
.m-mode .main { padding: 0; max-width: none; }
.m-mode .update-bar { margin: 10px 12px 0; }
.m-wrap {
  max-width: 560px; margin: 0 auto;
  padding: 0 14px calc(96px + env(safe-area-inset-bottom, 0px));
}
.m-wrap:has(> .m-send[hidden]) { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.m-send[hidden] { display: none; }
.m-cloud small { font-size: 11.5px; color: var(--ink-sub); }
.m-head {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 8px;
  margin: 0 -14px 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  background: var(--side); border-bottom: 1px solid var(--line);
}
.m-brand { font-size: 18px; font-weight: 900; color: var(--brand); flex: 1; white-space: nowrap; }
.m-brand .plus { color: var(--sky-ink); }
.m-brand.big { font-size: 26px; text-align: center; margin: 28px 0 8px; }
.m-back { flex: 1; text-align: left; border: none; background: none; font-size: 15px; font-weight: 900; color: var(--peach-ink); padding: 6px 0; }
.m-date { width: 150px; padding: 6px 8px !important; font-weight: 800; }
.m-menu { border: none; background: #fff; border-radius: 999px; width: 38px; height: 38px; font-size: 17px; border: 1.5px solid var(--line-strong); }
.m-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.m-card h2 { font-size: 15.5px; font-weight: 900; margin-bottom: 8px; }
.m-card h2 small { font-size: 12px; font-weight: 700; color: var(--ink-sub); margin-left: 4px; }
.m-card h2 { display: flex; align-items: center; gap: 4px; }
.m-ev-add { margin-left: auto; border: 1.5px solid var(--peach-mid); background: var(--peach-bg); color: var(--peach-ink); border-radius: var(--pill); padding: 5px 12px; font-size: 13px; font-weight: 900; }
/* 핸드폰 일정 넣기: 아래에서 올라오는 시트 + 눌러서 고르는 칩 */
.modal.me-sheet { max-width: 480px; }
.me-form input { width: 100%; font-size: 16px; }
.me-form .me-title { font-size: 17px; font-weight: 800; padding: 13px 14px; border-radius: 14px; }
.me-label { margin: 16px 0 7px; font-size: 13.5px; font-weight: 900; color: var(--ink); }
.me-label small { font-weight: 600; color: var(--ink-sub); }
.me-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.me-chip { border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink); border-radius: var(--pill); padding: 8px 14px; font-size: 14px; font-weight: 800; }
.me-chip[aria-pressed="true"] { background: var(--peach-bg); border-color: var(--peach-mid); color: var(--peach-ink); }
.me-pick { margin-top: 7px; }
.me-help { margin-top: 14px; font-size: 12.5px; color: var(--ink-sub); }
.me-sheet .modal-foot .m-big { margin-top: 0; }
.m-mode .modal-back:has(.me-sheet) { align-items: flex-end; padding: 0; }
.m-mode .modal.me-sheet { border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
/* 핸드폰 첫 화면: 큰 버튼 세 개 + 접는 시간표 */
/* 첫 화면: 큰 버튼 세 개를 위아래로 크게 */
.m-actions.home { grid-template-columns: 1fr; gap: 12px; margin-top: 4px; }
.m-actions.home .m-action { flex-direction: row; justify-content: flex-start; gap: 16px; min-height: 112px; padding: 0 26px; font-size: 21px; }
.m-actions.home .m-action span { font-size: 40px; }
/* 첫 화면 아래 그림과 한마디 */
.m-illust { margin-top: 18px; text-align: center; }
.m-cheer { font-size: 14.5px; font-weight: 800; color: var(--ink-sub); margin-bottom: 4px; }
.m-illust svg { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto; }
.m-illust .il-steam { animation: il-steam 2.6s ease-in-out infinite; }
@keyframes il-steam { 0%, 100% { opacity: .25; transform: translateY(2px); } 50% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .m-illust .il-steam { animation: none; } }
/* 네이비: 핸드폰 윗줄이 남색이므로 글자를 밝게 */
html[data-look="navy"] .m-head { border-bottom-color: #1e3a6e; }
html[data-look="navy"] .m-brand, html[data-look="navy"] .m-back { color: #fff; }
html[data-look="navy"] .m-brand .plus { color: #ffc933; }
.m-action.ev { background: var(--mint-bg); border-color: #b5e3c8; color: var(--mint-ink); }
.m-action .m-badge { font-style: normal; vertical-align: 2px; display: inline-block; margin-left: 4px; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--mint-ink); color: #fff; font-size: 12px; line-height: 20px; }
.m-tt summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 15.5px; font-weight: 900; }
.m-tt summary::-webkit-details-marker { display: none; }
.m-tt summary::after { content: '▾'; margin-left: auto; color: var(--ink-sub); transition: transform 0.15s; }
.m-tt:not([open]) summary::after { transform: rotate(-90deg); }
.m-tt[open] summary { margin-bottom: 8px; }
.m-ev-bigadd { width: 100%; margin-bottom: 12px; }
.m-ev-del {border: none; background: none; color: var(--ink-sub); font-size: 13px; padding: 2px 6px; }
.m-empty { font-size: 13px; color: var(--ink-sub); padding: 4px 0; }
.m-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.m-ev { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.m-ev .chk, .m-ev .chk-sp { flex-shrink: 0; width: 24px; height: 24px; margin-top: 1px; }
.m-ev-t { flex: 1; min-width: 0; }
.m-ev-t small { display: block; font-size: 12px; color: var(--ink-sub); }
.m-ev.hol { color: var(--danger); font-weight: 800; }
.m-ev.mine .m-ev-t { font-weight: 800; color: var(--peach-ink); }
.m-ev.done .m-ev-t { text-decoration: line-through; color: var(--ink-sub); font-weight: 600; }
.m-day { display: flex; gap: 10px; padding: 8px 0; border-top: 1.5px dashed var(--line); }
.m-day:first-of-type { border-top: none; padding-top: 2px; }
.m-day-d { width: 64px; flex-shrink: 0; font-size: 13px; font-weight: 900; padding-top: 2px; }
.m-day-d.hol { color: var(--danger); }
.m-day-d.today { color: var(--peach-ink); }
.m-day .m-list { flex: 1; min-width: 0; }
.m-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.m-action {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 104px; border-radius: 22px; font-size: 17px; font-weight: 900; border: 2px solid transparent;
}
.m-action span { font-size: 30px; }
.m-action.obs { background: var(--peach-bg); border-color: var(--peach-mid); color: var(--peach-ink); }
.m-action.att { background: var(--sky-bg); border-color: var(--sky-mid); color: var(--sky-ink); }
.m-action:active { transform: scale(0.98); }
.m-mode .picker { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 7px; }
.m-mode .no-btn { min-height: 52px; border-radius: 16px; }
.m-mode .no-btn b { font-size: 17px; }
.m-preset-g { margin-bottom: 10px; }
.m-gname { font-size: 12px; font-weight: 900; color: var(--ink-sub); margin-bottom: 5px; }
.m-presets { display: flex; flex-wrap: wrap; gap: 7px; }
.m-presets .preset-btn { padding: 11px 16px; font-size: 14.5px; }
.m-preset-g:nth-of-type(2) .preset-btn { border-color: #b5e3c8; background: var(--mint-bg); color: var(--mint-ink); }
.m-preset-g:nth-of-type(3) .preset-btn { border-color: var(--lemon-mid); background: var(--lemon-bg); color: var(--lemon-ink); }
.m-memo { margin-top: 8px; }
.m-memo textarea { font-size: 15px; }
.m-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.m-seg button {
  min-height: 46px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: #fff;
  font-size: 14.5px; font-weight: 800; color: var(--ink);
}
.m-seg button[aria-pressed="true"] { background: var(--sky-bg); border-color: var(--sky-ink); color: var(--sky-ink); }
.m-big { width: 100%; min-height: 50px; font-size: 16px; margin-top: 10px; }
.m-send {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -2px 12px rgba(140, 100, 60, 0.08);
  font-size: 13.5px; color: var(--ink-sub);
}
.m-send b { color: var(--peach-ink); font-size: 15px; }
.m-undo {
  position: fixed; left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); z-index: 70;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  max-width: 536px; margin: 0 auto; padding: 11px 12px 11px 16px; border-radius: 16px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 800; box-shadow: 0 6px 20px rgba(60, 40, 20, 0.25);
}
.m-undo[hidden] { display: none; }
.m-undo button { border: none; background: var(--lemon-bg); color: var(--lemon-ink); border-radius: 999px; padding: 7px 14px; font-weight: 900; font-size: 13.5px; }
.m-mode .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
.m-setup { padding-top: 10px; }
.m-lead { text-align: center; font-size: 14.5px; color: var(--ink-sub); margin-bottom: 18px; }
.m-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 15px; font-weight: 800; }
.m-field input, .m-field select { width: 150px; font-size: 16px; }
.m-check { margin: 8px 0; font-size: 13.5px; }
.m-guide { margin-top: 18px; padding: 14px; border-radius: 18px; background: var(--sky-bg); color: var(--sky-ink); font-size: 13.5px; }
.m-guide > b { display: block; margin-bottom: 4px; }
.m-guide p { margin-top: 4px; }
.m-guide .warn { color: var(--danger); font-weight: 800; }
.m-guide .btn-secondary { margin-top: 8px; background: #fff; }
.m-install-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.m-install-h .hint-close { color: var(--sky-ink); border: none; background: none; font-size: 16px; padding: 2px 6px; }
#mBody > .m-install { margin: 0 0 12px; }
.m-guide .m-install-btn { background: var(--sky-ink); color: #fff; border-color: var(--sky-ink); }
.m-escape { margin-top: 18px; padding: 18px 16px; border-radius: 18px; background: var(--peach-bg); color: var(--peach-ink); font-size: 14px; }
.m-escape > b { display: block; font-size: 17px; margin-bottom: 6px; }
.m-escape p { margin-top: 4px; color: var(--ink); }
.m-escape a.m-big { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.m-escape .btn-secondary { width: 100%; margin-top: 10px; background: #fff; }
.m-steps { margin: 10px 0 0 20px; color: var(--ink); line-height: 1.7; }
.m-escape .m-addr { font-size: 12px; color: var(--ink-sub); word-break: break-all; text-align: center; margin-top: 8px; }
.m-link { display: block; margin: 16px auto 0; border: none; background: none; color: var(--ink-sub); font-size: 13px; text-decoration: underline; }
.m-menu-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* 핸드폰에서 입력칸 글자가 16px 미만이면 아이폰이 화면을 확대하므로 */
.m-mode input, .m-mode select, .m-mode textarea { font-size: 16px; }

/* ── 핸드폰 연결 (동기화) ── */
.sync-lead { margin: -8px 0 14px; font-size: 13px; }
.sync-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.sync-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 4px 0 14px; font-size: 13px; color: var(--ink); }
.sync-plan { margin-top: 14px; padding: 12px; border: 1.5px dashed var(--sky-mid); border-radius: 16px; background: #fbfdff; }
.sync-file { font-weight: 800; font-size: 13px; margin-bottom: 8px; }
.sync-file small { color: var(--ink-sub); font-weight: 600; }
.sync-actions { display: flex; justify-content: flex-end; gap: 8px; }
.m-menu .md-label, .modal .md-label { margin-top: 14px; }
.stu-name.no-name { color: var(--ink-sub); font-weight: 700; }

/* ── 시간표 (주간학습안내) ── */
.subj-peach { background: var(--peach-bg); color: var(--peach-ink); border-color: var(--peach-mid); }
.subj-sky   { background: var(--sky-bg);   color: var(--sky-ink);   border-color: var(--sky-mid); }
.subj-mint  { background: var(--mint-bg);  color: var(--mint-ink);  border-color: #b5e3c8; }
.subj-lemon { background: var(--lemon-bg); color: var(--lemon-ink); border-color: var(--lemon-mid); }
.subj-lilac { background: var(--lilac-bg); color: var(--lilac-ink); border-color: #d3c8f5; }
.subj-pink  { background: var(--pink-bg);  color: var(--pink-ink);  border-color: #f6c3d1; }
.wk-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.wk-empty { line-height: 1.8; }
.wk-table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; }
.wk-table th, .wk-table td { border: 1px solid var(--line); padding: 6px; vertical-align: top; text-align: left; }
.wk-table thead th { background: var(--soft); text-align: center; font-size: 13px; font-weight: 900; }
.wk-table thead th small { font-weight: 600; color: var(--ink-sub); }
.wk-table thead th.today { background: var(--peach-bg); color: var(--peach-ink); }
.wk-table tbody th { width: 58px; background: var(--soft); text-align: center; vertical-align: middle; font-size: 12px; color: var(--ink-sub); }
.wk-chip { display: inline-block; border: 1px solid transparent; border-radius: 999px; padding: 1px 10px; font-size: 12.5px; font-weight: 900; }
.wk-content { margin-top: 3px; line-height: 1.45; }
.wk-table col.wk-col-h { width: 56px; }
.wk-table td.wk-today { background: #fffaf4; }
/* 간단히: 학습 내용은 두 줄까지, 행사·준비물은 한 줄 (마우스를 올리면 전체) */
.wk-table.simple td { padding: 6px 7px; }
.wk-table.simple .wk-content { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-sub); font-size: 12px; }
.wk-table.simple .wk-evrow .wk-txt { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.wk-table.detail .wk-evrow .wk-txt { white-space: normal; }
.wk-pages-t { margin-top: 2px; font-size: 11px; color: var(--ink-sub); }
.wk-cont { background: #fcfaf7; }
.wk-cont .wk-chip { opacity: 0.55; }
.wk-off { background: #fff5f5 !important; color: var(--danger); font-weight: 900; text-align: center !important; vertical-align: middle !important; font-size: 14px; }
.wk-evrow td { font-size: 12px; color: var(--ink-sub); }
/* 미리보기(수정) */
.wk-edit { min-width: 900px; }
.wk-edit input, .wk-edit textarea { width: 100%; padding: 3px 6px; font-size: 12px; border-radius: 8px; }
.wk-edit textarea { margin: 3px 0; resize: vertical; }
.wk-edit thead input { font-weight: 800; }
.wk-wd { font-size: 12px; margin-top: 2px; }
.wk-subj { font-weight: 900; border-width: 1.5px !important; }
.wk-pages { font-size: 11px !important; }
.wk-sum { margin: 0; }
/* 핸드폰 오늘 시간표 */
.wk-mlist { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.wk-m { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.wk-no { width: 20px; flex-shrink: 0; text-align: center; font-weight: 900; color: var(--ink-sub); padding-top: 1px; }
.wk-m .wk-chip { flex-shrink: 0; font-size: 13px; }
.wk-m-t { flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; }
.wk-m-t small { color: var(--ink-sub); }
.wk-m-extra { margin-top: 8px; font-size: 13px; font-weight: 700; }

/* ── 자리·모둠 배치 ── */
.empty-card { text-align: center; padding: 28px; }
.empty-card p { margin-bottom: 12px; color: var(--ink-sub); }
.seat-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 6px 0 12px; }
.seat-hint { font-size: 12.5px; font-weight: 800; color: var(--sky-ink); }
.seat-conds { margin-bottom: 4px; }
.seat-run { width: 100%; margin-top: 12px; padding: 12px; font-size: 15px; }
.seat-sum { cursor: pointer; font-weight: 900; font-size: 14px; }
.seat-sum small { font-weight: 700; color: var(--ink-sub); }
.seat-tip { margin: 0 0 10px; }
.seat-actions { margin-top: 14px; }
.seat-card { margin-top: 16px; }
#stResult:empty { display: none; }

.rel-editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 12px; }
.rel-block h3 { font-size: 13.5px; font-weight: 900; margin-bottom: 6px; }
.rel-block h3 small { font-weight: 600; color: var(--ink-sub); font-size: 11.5px; }
.rel-input { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rel-input select { flex: 1; min-width: 72px; }
.rel-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rel-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; padding: 3px 4px 3px 11px; border-radius: 999px; }
.rel-tag.rc { background: var(--rose-bg); color: var(--danger); }
.rel-tag.rf { background: var(--mint-bg); color: var(--mint-ink); }
.rel-tag button { border: none; background: none; color: inherit; font-size: 11px; padding: 2px 6px; }
.rel-sugg { grid-column: 1 / -1; background: var(--lemon-bg); border-radius: 14px; padding: 10px 14px; }
.rel-sugg-h { font-size: 13.5px; font-weight: 900; color: var(--lemon-ink); margin-bottom: 6px; }
.rel-sugg-h small { font-weight: 600; color: var(--ink-sub); font-size: 11.5px; }
.rel-sugg-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; font-size: 13px; font-weight: 700; }
.rel-sugg-row span { flex: 1; min-width: 0; }
.rel-sugg-row small { font-weight: 600; color: var(--ink-sub); }
.free-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.free-row input { flex: 1; min-width: 0; }
.m-free textarea { width: 100%; font-size: 16px; }
.preset-tip { font-size: 11.5px; color: var(--ink-sub); margin: 2px 0 4px; }
.preset-group .preset-tip { flex-basis: 100%; margin: 0 0 4px 64px; }
.rel-empty { font-size: 12px; color: var(--ink-sub); }

.board-wrap { overflow-x: auto; }
.blackboard {
  text-align: center; font-weight: 900; letter-spacing: 0.3em; font-size: 13px;
  background: var(--mint-bg); color: var(--mint-ink); border: 1.5px solid #b5e3c8;
  border-radius: 12px; padding: 8px; margin-bottom: 14px; min-width: 520px;
}
.bd-grid { display: grid; gap: 14px; min-width: 520px; }
.bd-island { border: 1.5px solid var(--line); border-top-width: 4px; border-radius: 16px; background: #fff; overflow: hidden; }
.bd-label { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 13px; font-weight: 900; border-bottom: 1px solid var(--line); cursor: default; }
.bd-label[data-glabel] { cursor: pointer; }
.bd-label.drop { outline: 2px dashed currentColor; outline-offset: -4px; }
.bd-count { font-size: 11.5px; font-weight: 700; opacity: 0.8; }
.bd-move { margin-left: auto; font-size: 11.5px; }
.bd-desks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; }
.bd-desk {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 38px; padding: 6px 4px; border: 1.5px solid var(--line-strong); border-radius: 10px;
  background: var(--soft); font-size: 13px; font-weight: 800; text-align: center;
}
.bd-desk.clickable { cursor: pointer; }
.bd-desk.clickable:hover { border-color: var(--sky-mid); background: #fff; }
.bd-desk.sel { border-color: var(--sky-ink); background: var(--sky-bg); box-shadow: 0 0 0 2px var(--sky-mid); }
.bd-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-g { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.bd-g.male { background: #6aa9d8; }
.bd-g.female { background: #ea8fae; }
.bd-care { position: absolute; top: 1px; right: 4px; font-size: 10px; }

.hist-item { padding: 10px 2px; border-bottom: 1.5px dashed var(--line); }
.hist-item:last-child { border-bottom: none; }
.hist-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.hist-groups { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.hist-gid { display: inline-block; font-size: 11px; font-weight: 900; padding: 0 8px; border-radius: 999px; }

/* ── 구글 드라이브 동기화 ── */
.cloud-card { margin-bottom: 18px; border: 2px solid var(--sky-mid); }
.cloud-on { font-size: 12px; font-weight: 900; background: var(--mint-bg); color: var(--mint-ink); padding: 2px 10px; border-radius: 999px; }
.cloud-acct { font-weight: 800; margin: 2px 0 4px; }
.sync-alt { margin: 6px 0 2px; font-size: 13.5px; color: var(--ink-sub); }
.cloud-bar[hidden] { display: none; }
.m-mode .cloud-bar { display: none; }
.m-cloud { font-size: 12.5px; line-height: 1.4; }

/* ════════════════════════════════════════════════════
   화면 스타일 (⚙️ 설정에서 고름, 기기마다 따로) — 기본은 위의 “귀여운”(파스텔)
   sky 맑은 하늘 · mint 민트 · black 블랙&오렌지 · navy 네이비 — 모두 흰 바탕에 또렷한 색 하나
   ════════════════════════════════════════════════════ */
/* 맑은 하늘 (흰 바탕 + 밝은 파랑) */
html[data-look="sky"] {
  --canvas: #ffffff; --paper: #ffffff; --side: #f4f8ff; --soft: #f5f8fc;
  --ink: #1d2433; --ink-sub: #667085; --line: #e6ebf2; --line-strong: #d3dbe6;
  --peach-bg: #e8f1ff; --peach-ink: #1f63c6; --peach-mid: #c9ddff;
  --sky-bg: #e8f1ff; --sky-ink: #1f63c6; --sky-mid: #c9ddff;
  --mint-bg: #e5f7ee; --mint-ink: #12824d;
  --lemon-bg: #fff5d1; --lemon-ink: #8a6200; --lemon-mid: #ffe28a;
  --lilac-bg: #efebff; --lilac-ink: #5a3fc0; --pink-bg: #ffecf1; --pink-ink: #b0325a;
  --rose-bg: #ffeeee; --danger: #d9362f; --brand: #2f80ed; --radius: 14px; --pill: 10px;
  --shadow: 0 1px 3px rgba(30, 60, 120, 0.06);
}
html[data-look="sky"] .btn-primary { background: #2f80ed; color: #fff; border-color: #2f80ed; }
html[data-look="sky"] .nav-btn.active { background: #2f80ed; color: #fff; }
html[data-look="sky"] .nav-btn:hover { background: #e8f1ff; }
html[data-look="sky"] .sidebar { border-right-color: #e6ebf2; }

/* 민트 (흰 바탕 + 청록) */
html[data-look="mint"] {
  --canvas: #ffffff; --paper: #ffffff; --side: #f2fbf8; --soft: #f4f9f7;
  --ink: #1c2a27; --ink-sub: #62716d; --line: #e3eeea; --line-strong: #cfe0da;
  --peach-bg: #ffefe4; --peach-ink: #c2521c; --peach-mid: #ffd6bd;
  --sky-bg: #e6f4ff; --sky-ink: #1d65a6; --sky-mid: #c4e2fb;
  --mint-bg: #dff7ef; --mint-ink: #0e7a5f;
  --lemon-bg: #fff6d6; --lemon-ink: #876100; --lemon-mid: #ffe391;
  --lilac-bg: #efebff; --lilac-ink: #5a3fc0; --pink-bg: #ffecf1; --pink-ink: #b0325a;
  --rose-bg: #ffeeee; --danger: #d9362f; --brand: #0fa37f; --radius: 14px; --pill: 10px;
  --shadow: 0 1px 3px rgba(20, 90, 70, 0.06);
}
html[data-look="mint"] .btn-primary { background: #0fa37f; color: #fff; border-color: #0fa37f; }
html[data-look="mint"] .nav-btn.active { background: #0fa37f; color: #fff; }
html[data-look="mint"] .nav-btn:hover { background: #dff7ef; }
html[data-look="mint"] .sidebar { border-right-color: #e3eeea; }

/* 블랙&오렌지 (흰 바탕, 검정 글씨, 주황 포인트) */
html[data-look="black"] {
  --canvas: #fafafa; --paper: #ffffff; --side: #ffffff; --soft: #f5f5f5;
  --ink: #111111; --ink-sub: #6b6b6b; --line: #ebebeb; --line-strong: #dadada;
  --peach-bg: #fff0e6; --peach-ink: #d8570f; --peach-mid: #ffd3b8;
  --sky-bg: #eaf3ff; --sky-ink: #1e5fb8; --sky-mid: #cfe2fb;
  --mint-bg: #e6f6ec; --mint-ink: #1a7a45;
  --lemon-bg: #fff4d4; --lemon-ink: #8a6100; --lemon-mid: #ffe08a;
  --lilac-bg: #f0ebff; --lilac-ink: #5a3fc0; --pink-bg: #ffecf1; --pink-ink: #b0325a;
  --rose-bg: #ffeeee; --danger: #d9362f; --brand: #111111; --radius: 12px; --pill: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
html[data-look="black"] .btn-primary { background: #111; color: #fff; border-color: #111; }
html[data-look="black"] .brand-title .plus { color: #ff6b2c; }
html[data-look="black"] .nav-btn.active { background: #111; color: #fff; }
html[data-look="black"] .nav-btn:hover { background: #f2f2f2; }
html[data-look="black"] .sidebar { border-right-color: #ebebeb; }

/* 네이비 (흰 바탕 + 남색 메뉴 + 노랑 포인트) */
html[data-look="navy"] {
  --canvas: #f7f9fc; --paper: #ffffff; --side: #1e3a6e; --soft: #f3f6fb;
  --ink: #1a2440; --ink-sub: #62708a; --line: #e3e9f2; --line-strong: #cfd9e8;
  --peach-bg: #fff4d1; --peach-ink: #7a5500; --peach-mid: #ffe08a;
  --sky-bg: #e8f0ff; --sky-ink: #1e4fa8; --sky-mid: #c8dafc;
  --mint-bg: #e3f6ec; --mint-ink: #157a47;
  --lemon-bg: #fff4d1; --lemon-ink: #7a5500; --lemon-mid: #ffe08a;
  --lilac-bg: #efebff; --lilac-ink: #5a3fc0; --pink-bg: #ffecf1; --pink-ink: #b0325a;
  --rose-bg: #ffeeee; --danger: #d9362f; --brand: #1e3a6e; --radius: 14px; --pill: 10px;
  --shadow: 0 1px 3px rgba(30, 58, 110, 0.07);
}
html[data-look="navy"] .btn-primary { background: #ffc933; color: #1a2440; border-color: #ffc933; }
html[data-look="navy"] .sidebar { border-right-color: #1e3a6e; }
html[data-look="navy"] .brand { border-bottom-color: rgba(255, 255, 255, 0.15); border-bottom-style: solid; border-bottom-width: 1px; }
html[data-look="navy"] .brand-title { color: #fff; }
html[data-look="navy"] .brand-title .plus { color: #ffc933; }
html[data-look="navy"] .brand-sub, html[data-look="navy"] .side-foot { color: #a9b8d6; }
html[data-look="navy"] .nav-btn { color: #d5deef; }
html[data-look="navy"] .nav-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
html[data-look="navy"] .nav-btn.active { background: #ffc933; color: #1a2440; }

/* 딸기우유 (분홍 바탕 + 진분홍 포인트, 동글동글) */
html[data-look="berry"] {
  --canvas: #fff7fa; --paper: #ffffff; --side: #ffe9f1; --soft: #fff1f6;
  --ink: #3d2a33; --ink-sub: #8a6b78; --line: #fbdfea; --line-strong: #f5c9da;
  --peach-bg: #ffe0ea; --peach-ink: #c2335f; --peach-mid: #ffc4d7;
  --sky-bg: #e3f2ff; --sky-ink: #2a6aa8; --sky-mid: #c2e1fb;
  --mint-bg: #ddf6e9; --mint-ink: #1d7a4c;
  --lemon-bg: #fff3c2; --lemon-ink: #8a6100; --lemon-mid: #ffe38a;
  --lilac-bg: #f1e8ff; --lilac-ink: #7a45c0; --pink-bg: #ffe0ea; --pink-ink: #c2335f;
  --rose-bg: #ffecef; --danger: #e0445b; --brand: #ff4f8b; --radius: 20px; --pill: 999px;
  --shadow: 0 3px 12px rgba(255, 92, 147, 0.10);
}
html[data-look="berry"] .btn-primary { background: #ff5c93; color: #fff; border-color: #ff5c93; }
html[data-look="berry"] .nav-btn.active { background: #ff5c93; color: #fff; }
html[data-look="berry"] .nav-btn:hover { background: #ffd6e5; }
html[data-look="berry"] .brand-title .plus { color: #ffb400; }

/* 레몬소다 (노랑 바탕 + 하늘 포인트) */
html[data-look="lemon"] {
  --canvas: #fffdf2; --paper: #ffffff; --side: #fff6c9; --soft: #fffae0;
  --ink: #33301f; --ink-sub: #7c7556; --line: #f6eec6; --line-strong: #eedf9e;
  --peach-bg: #fff0b3; --peach-ink: #8a5a00; --peach-mid: #ffe07a;
  --sky-bg: #dff2ff; --sky-ink: #1767a8; --sky-mid: #b9e1ff;
  --mint-bg: #dcf6e6; --mint-ink: #1a7a45;
  --lemon-bg: #fff0b3; --lemon-ink: #8a5a00; --lemon-mid: #ffe07a;
  --lilac-bg: #efebff; --lilac-ink: #5a3fc0; --pink-bg: #ffe6ee; --pink-ink: #b8325c;
  --rose-bg: #ffeeee; --danger: #d9362f; --brand: #e89a00; --radius: 20px; --pill: 999px;
  --shadow: 0 3px 12px rgba(230, 170, 0, 0.12);
}
html[data-look="lemon"] .btn-primary { background: #ffc21a; color: #33301f; border-color: #ffc21a; }
html[data-look="lemon"] .nav-btn.active { background: #ffc21a; color: #33301f; }
html[data-look="lemon"] .nav-btn:hover { background: #fff0b3; }
html[data-look="lemon"] .brand-title .plus { color: #2f9be8; }

/* 포도젤리 (라벤더 바탕 + 보라 포인트) */
html[data-look="grape"] {
  --canvas: #faf8ff; --paper: #ffffff; --side: #efe9ff; --soft: #f5f1ff;
  --ink: #2d2640; --ink-sub: #756c8c; --line: #e9e2fb; --line-strong: #d8cdf7;
  --peach-bg: #ffe3f0; --peach-ink: #b8327a; --peach-mid: #ffc6e1;
  --sky-bg: #e6edff; --sky-ink: #3b55c4; --sky-mid: #c9d6ff;
  --mint-bg: #dff6ec; --mint-ink: #1b7a50;
  --lemon-bg: #fff3cc; --lemon-ink: #876100; --lemon-mid: #ffe18f;
  --lilac-bg: #ece4ff; --lilac-ink: #6a3fd1; --pink-bg: #ffe3f0; --pink-ink: #b8327a;
  --rose-bg: #ffecf0; --danger: #d9364f; --brand: #7c4dff; --radius: 20px; --pill: 999px;
  --shadow: 0 3px 12px rgba(124, 77, 255, 0.10);
}
html[data-look="grape"] .btn-primary { background: #8b5cf6; color: #fff; border-color: #8b5cf6; }
html[data-look="grape"] .nav-btn.active { background: #8b5cf6; color: #fff; }
html[data-look="grape"] .nav-btn:hover { background: #e9e1ff; }
html[data-look="grape"] .brand-title .plus { color: #ff6fae; }

/* 상황 버튼 무리 색: 참여 하늘 · 관계 초록 · 태도 노랑 */
html[data-look] .preset-group:nth-child(1) .preset-btn, html[data-look] .m-preset-g:nth-of-type(1) .preset-btn { background: var(--sky-bg); color: var(--sky-ink); border-color: var(--sky-mid); }
html[data-look] .preset-group:nth-child(2) .preset-btn, html[data-look] .m-preset-g:nth-of-type(2) .preset-btn { border-color: #c9ecd8; }

/* 설정: 스타일 고르기 */
.look-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 6px; }
.look-opt { border: 2px solid var(--line); border-radius: 12px; background: var(--paper); padding: 10px; text-align: left; font-weight: 800; color: var(--ink); }
.look-opt[aria-pressed="true"] { border-color: var(--ink); }
.look-opt small { display: block; font-weight: 600; color: var(--ink-sub); font-size: 11.5px; margin-top: 2px; }
.look-sw { display: flex; height: 38px; border-radius: 8px; overflow: hidden; margin-bottom: 8px; border: 1px solid rgba(0, 0, 0, 0.06); }
.look-sw span { flex: 1; }

/* 백업: 기록 보호 상태 */
.bk-guard { margin-top: 14px; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.6; }
.bk-guard.on { background: var(--mint-bg); color: var(--mint-ink); }
.bk-guard.off { background: var(--lemon-bg); color: var(--lemon-ink); }
.bk-guard .btn-ghost { margin-left: 6px; padding: 3px 10px; font-size: 12.5px; }
.bk-newyear { margin-top: 14px; border: 1.5px dashed var(--line-strong); border-radius: 14px; padding: 10px 14px; }
.bk-newyear summary { cursor: pointer; font-weight: 900; font-size: 14.5px; }
.bk-newyear summary small { font-weight: 600; color: var(--ink-sub); margin-left: 4px; }
.ny-parts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0; }
.ny-grid { margin: 8px 0 12px; }
.m-top-links { display: flex; gap: 8px; margin-bottom: 12px; }
.m-top-links .m-guide-top { flex: 1; margin-bottom: 0; }
.m-top-links .m-guide-top.fb { background: var(--mint-bg); color: var(--mint-ink); border-color: #b5e3c8; }
.m-period { margin-top: 4px; }
.m-period-t { font-size: 13px; font-weight: 800; color: var(--ink-sub); margin: 4px 0 6px; }
.m-seg.six { grid-template-columns: repeat(3, 1fr); }
.at-mark sub { font-size: 9px; font-weight: 800; margin-left: 1px; vertical-align: baseline; position: relative; top: 2px; }

/* ── 교과 수업 반 (중등) ── */
.cls-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.cls-chip { border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink); border-radius: var(--pill); padding: 7px 14px; font-size: 13.5px; font-weight: 800; }
.cls-chip small { font-weight: 700; color: var(--ink-sub); margin-left: 2px; }
.cls-chip[aria-pressed="true"] { background: var(--sky-ink); border-color: var(--sky-ink); color: #fff; }
.cls-chip[aria-pressed="true"] small { color: rgba(255, 255, 255, 0.85); }
.cls-edit { margin-left: 4px; }
.cls-tag { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 900; color: #fff; background: var(--sky-ink); border-radius: 8px; padding: 1px 8px; vertical-align: 2px; }
.ce-row, .ce-add { display: flex; align-items: center; gap: 6px; margin: 6px 0; flex-wrap: wrap; }
.ce-row .ce-name, .ce-add #ceName { width: 90px; }
.ce-row .ce-subj, .ce-add #ceSubj { flex: 1; min-width: 90px; }
.ce-row .ce-count, .ce-add #ceCount { width: 64px; }
.ce-unit { font-size: 13px; color: var(--ink-sub); }
.ce-add { border-top: 1px dashed var(--line-strong); padding-top: 10px; margin-top: 12px; }
.ce-names-box { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--soft); }
.ce-ta { width: 100%; font-family: inherit; }
.ce-names-box .set-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
/* 핸드폰: 반 고르기 */
.m-cls { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 2px; }
.m-cls .cls-chip { flex: 0 0 auto; padding: 9px 14px; font-size: 14.5px; }
.m-cls { scrollbar-width: none; }
.m-cls::-webkit-scrollbar { display: none; }

/* ── 담임 / 교과전담 ── */
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 4px; }
.role-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 12px; border-radius: 16px;
  border: 2px solid var(--line-strong); background: var(--paper); color: var(--ink); cursor: pointer; font: inherit; }
.role-opt span { font-size: 34px; }
.role-opt b { font-size: 17px; }
.role-opt small { font-size: 12px; color: var(--ink-sub); text-align: center; }
.role-opt:hover { border-color: var(--sky-ink); background: var(--sky-bg); }
.cls-empty { text-align: center; padding: 36px 20px; }
.cls-empty-ic { font-size: 44px; }
.cls-empty h2 { font-size: 18px; margin: 8px 0 4px; }
.cls-empty .btn-primary { margin-top: 10px; }
.cls-chip.add { border-style: dashed; color: var(--ink-sub); }
.cls-chip.add[aria-pressed="true"] { background: var(--soft); border-color: var(--line-strong); color: var(--ink); }
.m-cls-row { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.m-cls-row input { min-width: 0; font-size: 16px; }
.m-cls-row #mcName { flex: 1.1; }
.m-cls-row #mcSubj { flex: 1.2; }
.m-cls-row #mcCount { width: 62px; flex: 0 0 auto; }
.m-cls-row span { font-size: 13px; color: var(--ink-sub); }
.m-seg.two { grid-template-columns: 1fr 1fr; margin: 4px 0 6px; }
.m-seg.two button { padding: 12px 6px; font-size: 15px; }
.at-line[hidden], .m-field[hidden], .m-period[hidden] { display: none; }

/* ── 🏆 보상 ── */
.rw-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.rw-tab { border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink); border-radius: var(--pill); padding: 9px 18px; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.rw-tab[aria-pressed="true"] { background: var(--lemon-bg); border-color: var(--lemon-mid); color: var(--lemon-ink); }
.rw-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.rw-reason { border: 1.5px solid var(--lemon-mid); background: var(--lemon-bg); color: var(--lemon-ink); border-radius: var(--pill); padding: 8px 15px; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.rw-reason[aria-pressed="true"] { background: var(--lemon-ink); border-color: var(--lemon-ink); color: #fff; }
.free-row input[type="number"]#rwAmt { width: 64px; flex: 0 0 auto; }
.rw-grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .rw-grid2 { grid-template-columns: 1fr; } }
.rw-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 8px; }
.rw-stu { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink); font: inherit; cursor: pointer; }
.rw-stu small { font-size: 11.5px; color: var(--ink-sub); }
.rw-stu .rw-score { font-size: 13px; font-weight: 900; color: var(--lemon-ink); }
.rw-stu.can { border-color: var(--mint-ink); background: var(--mint-bg); }
.rw-list { list-style: none; margin: 8px 0; }
.rw-list li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 2px; border-bottom: 1px dashed var(--line); font-size: 14px; }
.rw-list b { color: var(--lemon-ink); white-space: nowrap; }
.rw-me { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.rw-big-score { font-size: 26px; font-weight: 900; color: var(--lemon-ink); }
.rw-spend { display: flex; flex-wrap: wrap; gap: 6px; }
.rw-spend button[disabled] { opacity: .45; cursor: default; }
.rw-hist { max-height: 300px; overflow-y: auto; }
.rw-h { display: grid; grid-template-columns: 44px 44px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.rw-h .pos { color: var(--mint-ink); font-weight: 900; } .rw-h .neg { color: var(--danger); font-weight: 900; }
.rw-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 12px 0; }
.rw-group { border: 1.5px solid var(--line-strong); border-radius: var(--radius); padding: 12px; background: var(--paper); }
.rw-group.best { border-color: var(--lemon-mid); background: var(--lemon-bg); }
.rw-gh { display: flex; justify-content: space-between; align-items: baseline; }
.rw-week { font-size: 12px; color: var(--ink-sub); }
.rw-gscore { font-size: 34px; font-weight: 900; color: var(--ink); margin: 4px 0; }
.rw-gscore small { font-size: 14px; color: var(--ink-sub); margin-left: 2px; }
.rw-gnames { font-size: 12px; color: var(--ink-sub); margin-bottom: 8px; }
.rw-gbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.rw-gbtns .btn-secondary.big { font-size: 18px; padding: 12px 22px; }
.rw-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.rw-class { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
@media (max-width: 760px) { .rw-class { grid-template-columns: 1fr; } }
.rw-thermo { display: flex; align-items: center; gap: 16px; }
.rw-temp b { font-size: 44px; font-weight: 900; color: var(--danger); }
.rw-temp span { font-size: 16px; color: var(--ink-sub); margin-left: 4px; }
.rw-temp p { font-size: 14.5px; font-weight: 800; margin: 4px 0 10px; }
.thermo { width: 80px; height: auto; flex: 0 0 auto; }
.thermo.big { width: 150px; }
.th-glass { fill: var(--paper); stroke: var(--line-strong); stroke-width: 3; }
.th-fill { fill: #ff6b6b; }
.th-tick { stroke: var(--ink-sub); stroke-width: 2; }
.rw-count { font-size: 13.5px; font-weight: 900; color: var(--mint-ink); }
.hw-no[aria-pressed="true"] { background: var(--mint-bg); border-color: var(--mint-ink); color: var(--mint-ink); }
.hw-miss { margin: 12px 0 4px; font-size: 14px; line-height: 1.6; }
.hw-miss b { color: var(--danger); margin-right: 4px; }
.hw-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.hw-item { display: grid; grid-template-columns: 50px 1fr auto; gap: 8px; text-align: left; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; }
.hw-item[aria-pressed="true"] { border-color: var(--sky-ink); background: var(--sky-bg); }
.hw-item .pos { color: var(--mint-ink); font-weight: 800; } .hw-item .neg { color: var(--danger); font-weight: 800; }
.hw-often { margin-top: 10px; font-size: 13px; color: var(--danger); font-weight: 700; }
/* 칠판에 크게 보기 */
.modal-back.rw-full .modal { width: min(1100px, 96vw); max-width: none; }
.rw-bigboard { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; padding: 10px 6px 20px; }
@media (max-width: 700px) { .rw-bigboard { grid-template-columns: 1fr; } }
.rw-bigthermo { display: flex; align-items: center; gap: 20px; }
.rw-bigtemp b { display: block; font-size: 72px; font-weight: 900; color: var(--danger); line-height: 1; }
.rw-bigtemp span { font-size: 20px; font-weight: 800; }
.rw-bigbars { display: flex; flex-direction: column; gap: 14px; }
.rw-bar { display: grid; grid-template-columns: 96px 1fr 50px; align-items: center; gap: 12px; font-size: 20px; font-weight: 900; }
.rw-bar-t { height: 26px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.rw-bar-t i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffd166, #ff8fab); }
/* 핸드폰 */
.m-actions.home.four .m-action { min-height: 88px; }
.m-action.rw { background: var(--lemon-bg); border-color: var(--lemon-mid); color: var(--lemon-ink); }
.m-seg.four { grid-template-columns: repeat(4, 1fr); margin-bottom: 12px; }
.m-seg.four button { font-size: 13px; padding: 0 2px; }
.m-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.m-gbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 6px; border-radius: 16px; border: 1.5px solid var(--lemon-mid); background: var(--lemon-bg); color: var(--lemon-ink); font: inherit; }
.m-gbtn b { font-size: 18px; } .m-gbtn span { font-size: 14px; font-weight: 800; }
.m-thermo { display: flex; align-items: center; gap: 18px; }
.m-input { width: 100%; font-size: 16px; margin-bottom: 8px; }
.hw-done { margin-top: 10px; border-top: 1px dashed var(--line-strong); padding-top: 8px; }
.hw-done > summary { cursor: pointer; font-size: 14px; font-weight: 800; color: var(--mint-ink); padding: 6px 2px; list-style: revert; }
.hw-done > summary small { font-weight: 600; color: var(--ink-sub); margin-left: 6px; font-size: 12px; }
.hw-done .picker, .hw-done .hw-list { margin-top: 8px; }
.hw-alldone { padding: 14px; text-align: center; font-weight: 900; color: var(--mint-ink); background: var(--mint-bg); border-radius: 14px; }
.neis-btn { cursor: pointer; white-space: nowrap; }

/* ── 📎 상세 기록 ── */
#lgText, #leText { width: 100%; font: inherit; font-size: 14.5px; line-height: 1.6; margin-top: 10px; }
.lg-files { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.lg-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 12.5px; color: var(--ink); margin: 2px 0; }
.lg-chip small { color: var(--ink-sub); }
.lg-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.lg-filter input[type="search"] { flex: 1; min-width: 140px; }
.lg-list { display: flex; flex-direction: column; gap: 6px; }
.lg-item { display: grid; grid-template-columns: 112px 118px 150px 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; }
.lg-item:hover { border-color: var(--line-strong); background: var(--soft); }
@media (max-width: 900px) { .lg-item { grid-template-columns: 1fr 1fr; } .lg-text { grid-column: 1 / -1; } }
.lg-when { font-weight: 800; color: var(--ink-sub); }
.lg-cat { display: inline-block; font-size: 12px; font-weight: 900; color: var(--lilac-ink); background: var(--lilac-bg); border-radius: 8px; padding: 2px 8px; }
.lg-who { font-weight: 800; }
.lg-text { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-meta { font-size: 12.5px; white-space: nowrap; }
.lg-meta i { font-style: normal; font-size: 11px; color: var(--ink-sub); border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 4px; }
.lg-head { margin-bottom: 8px; }
.lg-arch { font-size: 12px; color: var(--ink-sub); border: 1px solid var(--line-strong); border-radius: 6px; padding: 1px 6px; }
.lg-full { font-size: 15px; line-height: 1.7; white-space: normal; padding: 12px; background: var(--soft); border-radius: 12px; }
.lg-stamp { font-size: 12.5px; color: var(--ink-sub); margin: 8px 0; }
.lg-atts { display: flex; flex-direction: column; gap: 10px; }
.lg-att { display: grid; grid-template-columns: 180px 1fr; gap: 12px; align-items: start; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
@media (max-width: 600px) { .lg-att { grid-template-columns: 1fr; } }
.lg-prev { min-height: 60px; display: flex; align-items: center; justify-content: center; background: var(--soft); border-radius: 10px; font-size: 13px; color: var(--ink-sub); overflow: hidden; }
.lg-prev img, .lg-prev video { width: 100%; max-height: 220px; object-fit: contain; display: block; }
.lg-prev audio { width: 100%; }
.lg-sha { font-family: ui-monospace, Consolas, monospace; color: var(--ink-sub); }
.lg-att-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.lg-hist { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.lg-h { font-size: 13px; line-height: 1.6; padding: 8px 10px; border-left: 3px solid var(--line-strong); background: var(--soft); border-radius: 6px; }
.btn-ghost.danger { color: var(--danger); }

/* 핸드폰 📎 상세 기록 */
.m-actions.home.five .m-action { min-height: 74px; }
.m-action.mlog { background: var(--lilac-bg); border-color: #d8ccf5; color: var(--lilac-ink); }
.m-action.mlog small { font-size: 12px; font-weight: 700; opacity: .75; margin-left: 4px; }
.m-caps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.m-cap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 84px; border-radius: 16px; border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink); font: inherit; font-size: 26px; cursor: pointer; }
.m-cap b { font-size: 14px; }
.m-cap.rec { background: #ffe5e5; border-color: var(--danger); color: var(--danger); animation: recpulse 1.2s infinite; }
@keyframes recpulse { 50% { opacity: .65; } }
.m-lg-files { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
#mLgText { width: 100%; font-size: 16px; margin: 8px 0; }
.m-lg-list { display: flex; flex-direction: column; gap: 6px; }
.m-lg-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; }
.m-lg-who { font-weight: 800; font-size: 13px; }
.m-lg-text { flex-basis: 100%; color: var(--ink-sub); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
