/* 창체·공강 연간 계획
   흰 종이(sheet) 한 장 위에 학사력처럼 읽히는 계획표. 포인트는 칠판 녹색, 공강은 호박색. */

:root {
  --bg: #eef1ef;
  --paper: #ffffff;
  --ink: #17212b;
  --ink-2: #44515e;
  --muted: #6b7783;
  --line: #d7ddd9;
  --line-soft: #e9ecea;
  --accent: #24634a;        /* 칠판 녹색 */
  --accent-ink: #1b4d39;
  --accent-soft: #e2efe7;
  --amber: #8f560c;         /* 공강 */
  --amber-soft: #fbefd8;
  --danger: #b3261e;
  --danger-soft: #fdeceb;
  --focus: #2b6cb0;
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  word-break: keep-all;          /* 한국어 어절 단위 줄바꿈 */
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: -0.015em; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0; }
small { font-size: 13px; font-weight: 400; color: var(--muted); }
code { font-size: 13px; background: var(--line-soft); padding: 1px 5px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* 상단 바 */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-in {
  max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 60px;
  display: flex; align-items: center; gap: 32px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand .mark { width: 14px; height: 14px; border-radius: 3px; background: var(--accent); box-shadow: 5px 5px 0 #e6c27a; }
.topnav { display: flex; gap: 4px; height: 100%; }
.topnav a {
  display: flex; align-items: center; padding: 0 12px; color: var(--ink-2); text-decoration: none; font-weight: 500; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.topnav a:hover { color: var(--ink); }
.topnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 650; }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.who .role { color: var(--accent-ink); background: var(--accent-soft); padding: 2px 10px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.who a, .who button.link { color: var(--ink-2); }

main { max-width: 1120px; margin: 0 auto; padding: 28px 24px 80px; }

/* 종이 */
.sheet { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 36px 36px; }
.narrow-sheet { max-width: 760px; margin: 0 auto; }
.sheet.auth { max-width: 420px; margin: 40px auto 0; }
.auth h1 { font-size: 24px; margin-bottom: 8px; }
.auth .desc { margin-bottom: 20px; color: var(--ink-2); font-size: 14px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.kicker { font-size: 14px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.page-head .muted { margin-top: 4px; font-size: 14px; }

.year-switch { display: flex; gap: 2px; font-size: 14px; }
.year-switch a { padding: 4px 10px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; }
.year-switch a:hover { background: var(--line-soft); color: var(--ink); }
.year-switch a[aria-current="page"] { color: var(--ink); font-weight: 700; background: var(--line-soft); }

/* 알림 */
.flash {
  margin: 0 0 20px; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent-ink); border-left: 4px solid var(--accent); font-weight: 500;
}
.flash.error { background: var(--danger-soft); color: var(--danger); border-left-color: var(--danger); }
.sheet .flash { margin-bottom: 16px; }

/* 버튼·입력 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: 15px; white-space: nowrap; cursor: pointer; text-decoration: none;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn.secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--ink-2); color: var(--ink); background: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn.ghost:hover { background: var(--line-soft); color: var(--ink); }
.btn.small { height: 32px; padding: 0 12px; font-size: 14px; }
.btn:not(.secondary):not(.ghost) small { color: inherit; opacity: .85; margin-left: 4px; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #8f1d17; border-color: #8f1d17; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
button.link:hover { text-decoration: underline; }
button.link.danger { color: var(--danger); }
form.inline { display: inline; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
label small { font-weight: 400; margin-left: 4px; }
label > span { display: block; }
input, select {
  font: inherit; font-size: 15px; font-weight: 400; color: var(--ink);
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
}
input:hover, select:hover { border-color: #b9c2bd; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; padding: 0; margin: 0; accent-color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack .btn { margin-top: 4px; }
.fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.fields .grow { flex: 1 1 220px; }

/* 설정: 목차 + 섹션 */
.settings { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 28px; align-items: start; }
.toc { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; padding-top: 8px; }
.toc a { padding: 7px 12px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.toc a:hover { background: var(--paper); color: var(--ink); }
.page-head + .section { border-top: 1px solid var(--line); }
.section { padding: 28px 0; border-top: 1px solid var(--line-soft); scroll-margin-top: 16px; }
.section:last-child { padding-bottom: 0; }
.section > h2 + .desc { margin-top: 6px; }
.section .desc { color: var(--muted); font-size: 14px; max-width: 64ch; }
.section > .desc { margin-bottom: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.section-head .desc { margin-top: 6px; }
.count { display: inline-block; min-width: 24px; padding: 0 7px; margin-left: 6px; border-radius: 999px; background: var(--line-soft); color: var(--ink-2); font-size: 13px; font-weight: 600; text-align: center; vertical-align: 2px; letter-spacing: 0; }
.danger-zone h2 { color: var(--danger); }

.timeline { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; font-size: 14px; }
.timeline span { padding: 6px 12px; border-radius: var(--radius-sm); }
.timeline .t-sem { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.timeline .t-break { background: var(--line-soft); color: var(--ink-2); }

.holiday-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; margin-bottom: 20px; }
.holiday-cols h3 { margin-bottom: 6px; }
.holiday-list { list-style: none; margin: 0; padding: 0; }
.empty + .subform { margin-top: 16px; }
.holiday-list li { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.holiday-list .num { color: var(--ink-2); flex: 0 0 auto; }
.holiday-list .name { flex: 1; font-weight: 500; }
.holiday-list button.link { font-size: 13px; color: var(--muted); }
.holiday-list button.link:hover { color: var(--danger); }

.list { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 20px; }
.list th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.list td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.list tr.editing td { background: #fff8e6; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions > * + * { margin-left: 14px; }
.grades { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--line-soft); font-size: 13px; }
.grades.changche { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.grades.etc { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.grades.exam { background: #fff3b0; color: #6b5500; font-weight: 600; }
.grades.closed { background: var(--danger-soft); color: var(--danger); font-weight: 600; }

.subform { background: #f7f9f8; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 16px; }
.checks { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.checks legend { float: left; margin-right: 8px; padding: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.checks label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); cursor: pointer; }
.form-actions { display: flex; gap: 8px; }

/* 설정: 시간 격자 */
.legend { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); margin-bottom: 18px; }
.legend .sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.legend .sw.gonggang { margin-left: 12px; }
.sw.changche { background: var(--accent); }
.sw.gonggang { background: #e6c27a; }
.grade-block { padding: 20px 0; border-top: 1px dashed var(--line); }
.grade-block:first-of-type { border-top: 0; padding-top: 0; }
.grade-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.grids { display: flex; flex-wrap: wrap; gap: 32px; }
.grid { border-collapse: separate; border-spacing: 3px; }
.grid caption { text-align: left; font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 0 0 4px 3px; }
.grid th { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.grid tbody th { text-align: right; padding-right: 6px; }
.grid td { padding: 0; }
.grid select {
  width: 58px; height: 34px; padding: 0 4px; font-size: 13px; font-weight: 600; text-align: center; text-align-last: center;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background: #f2f4f3; border: 1px solid transparent; color: var(--muted); border-radius: 5px;
}
.grid select:hover { border-color: #b9c2bd; }
.grid select:has(option[value="changche"]:checked) { background: var(--accent); color: #fff; }
.grid select:has(option[value="gonggang"]:checked) { background: var(--amber-soft); color: var(--amber); border-color: #efd29a; }

.save-bar {
  position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  margin: 20px -36px -36px; padding: 14px 36px; background: rgba(255, 255, 255, .95);
  border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
}
.section .save-bar { margin-bottom: 0; border-radius: 0; }
.save-bar .muted { font-size: 14px; }

/* 계획표 */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 20px; }
.seg { display: inline-flex; padding: 3px; background: var(--line-soft); border-radius: 8px; }
.seg a { padding: 7px 16px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.seg a:hover { color: var(--ink); }
.seg a small { margin-left: 4px; font-variant-numeric: tabular-nums; }
.seg a[aria-current="page"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(23, 33, 43, .14); }
.seg.kind a.k-changche[aria-current="page"] { color: var(--accent); }
.seg.kind a.k-gonggang[aria-current="page"] { color: var(--amber); }

.summary { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.summary p { font-size: 15px; color: var(--ink-2); }
.summary strong { font-size: 22px; font-weight: 700; color: var(--ink); margin: 0 2px 0 6px; }
.summary .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; }
.plan { width: 100%; border-collapse: collapse; font-size: 15px; }
.plan thead th {
  text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--ink);
}
.plan thead th:nth-child(4) { text-align: center; }
.plan td { padding: 0 12px; height: 46px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.plan tr.month-start td { border-top: 1px solid var(--line); }
.plan tbody tr:hover td { background: #f8faf9; }

/* 월 표시: 그 달의 행을 묶는 큰 숫자 */
.plan .col-month { width: 84px; padding: 0 16px 0 0; text-align: left; }
.plan tbody th.col-month { vertical-align: top; border-top: 1px solid var(--line); }
.plan tbody tr:first-child th.col-month { border-top: 0; }
.plan tbody th.col-month span {
  position: sticky; top: 8px; display: block; padding: 10px 0 12px;
  font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: var(--accent); font-variant-numeric: tabular-nums;
}
.plan.k-gonggang tbody th.col-month span { color: var(--amber); }
.plan tbody th.col-month small { font-size: 15px; font-weight: 600; letter-spacing: 0; margin-left: 2px; color: inherit; }

.plan .col-date { width: 150px; white-space: nowrap; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-left: 6px; vertical-align: 1px; }
.tag.k-changche { background: var(--accent-soft); color: var(--accent-ink); }
.tag.k-gonggang { background: var(--amber-soft); color: var(--amber); }
.plan .col-date .num { font-weight: 700; font-size: 16px; }
.plan .col-date .wd { color: var(--muted); font-size: 14px; margin-left: 4px; }
.plan .col-period { width: 92px; white-space: nowrap; color: var(--ink-2); }
.plan .col-hours { width: 56px; text-align: center; color: var(--ink-2); }
/* 입력 담당: 날짜·교시·시수도 칸으로 */
/* 입력 화면(넓은 화면): 날짜·교시·시수·부서 칸을 줄여 활동 내용 칸을 넓힘. 휴대폰 배치는 아래 @media 그대로 */
@media (min-width: 641px) {
  .plan.editing td { padding: 0 6px; }
  .plan.editing .col-month { width: 64px; }
  .plan.editing .col-date { width: 150px; white-space: nowrap; }
  .plan.editing.k-all .col-date { width: 196px; }
  .plan.editing .col-period { width: 84px; }
  .plan.editing .col-hours { width: 52px; }
  .plan.editing .col-dept { width: 112px; }
}
.plan .col-date input, .plan .col-period input, .plan .col-hours input { height: 36px; padding: 0 6px; font-size: 14px; }
.plan .col-date input { width: 136px; }
.plan.editing .col-date input { width: 118px; padding: 0 4px; font-size: 13px; }
.plan .col-period input { width: 54px; text-align: center; }
.plan .col-hours input { width: 52px; text-align: center; }
.plan .col-grade { width: 64px; white-space: nowrap; color: var(--ink-2); }
.add-row .checks { min-height: 40px; }
.plan .col-del { width: 44px; padding: 0 0 0 4px; text-align: right; }
.plan .col-del button.link { font-size: 13px; color: var(--muted); }
.plan .col-del button.link:hover { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.add-row { margin-bottom: 20px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 8px; }
.add-row h2 { font-size: 16px; }
.add-row .desc { margin: 4px 0 14px; color: var(--muted); font-size: 14px; }
.plan .col-area { width: 128px; padding: 0 4px; }
.plan .col-area select { width: 100%; height: 36px; padding: 0 6px; font-size: 14px; }
.plan .col-area select:has(option[value=""]:checked) { color: #8a948f; }
.plan .col-content { padding-left: 4px; }
.plan .col-dept { width: 140px; padding: 0 4px; }
.plan :is(.col-content, .col-dept) input { width: 100%; height: 36px; border-color: transparent; background: transparent; padding: 0 8px; }
.plan :is(.col-content, .col-dept) input::placeholder { color: #b8c0bb; }
.plan :is(.col-content, .col-dept) input:hover { background: var(--paper); border-color: var(--line); }
.plan :is(.col-content, .col-dept) input:focus { background: var(--paper); }
.plan tfoot th, .plan tfoot td { padding: 14px 12px; border-top: 1px solid var(--ink); font-weight: 700; height: auto; }
.plan tfoot th { text-align: right; }

.empty { padding: 48px 16px; text-align: center; color: var(--ink-2); border-top: 1px solid var(--line); }
.empty p + p { margin-top: 12px; }
.section .empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px 16px; }

.notice { margin-top: 32px; padding: 20px 22px; border-radius: var(--radius); background: #fff8e6; border: 1px solid #f0dca8; }
.notice h2 { font-size: 17px; }
.notice > p { margin: 6px 0 14px; color: var(--ink-2); font-size: 14px; }
.notice .list { margin-bottom: 0; }
.notice .list th, .notice .list td { border-color: #f0dca8; }

/* 첫 화면 */
.year-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.year-list a {
  display: grid; grid-template-columns: 200px 1fr auto; align-items: center; gap: 16px;
  padding: 20px 8px; border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none;
}
.year-list a:hover { background: #f8faf9; }
.year-list .y { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; color: var(--accent); }
.year-list .y small { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-left: 4px; letter-spacing: 0; }
.year-list .range { color: var(--muted); font-size: 14px; }
.year-list .go { font-weight: 600; font-size: 14px; color: var(--accent); }

/* 좁은 화면 */
/* 학사일정 보기: template/학사일정양식 PDF 양식 */
.acad-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.acad-tools .btn { margin-left: auto; }
.acad-tools .btn ~ .btn { margin-left: 0; }
.acad-wrap { overflow-x: auto; }
.acad { width: 100%; min-width: 860px; max-width: 980px; margin: 0 auto; border-collapse: collapse; table-layout: fixed; border: 2px solid #000; color: #000; font-size: 13px; text-align: center; }
.acad th, .acad td { border: 1px solid #666; padding: 2px; height: 24px; font-weight: 400; }
.acad col.c-mon { width: 76px; }
.acad col.c-day { width: 50px; }
.acad col.c-grade { width: 30px; }
.acad col.c-items { width: 290px; }
.acad .title { background: #d9d9d9; font-size: 20px; height: 40px; border-bottom: 2px solid #000; }
.acad .subt { font-size: 14px; height: 30px; border-bottom: 2px solid #000; }
.acad thead tr:last-child th, .acad thead th[rowspan] { border-bottom: 2px solid #000; }
.acad th.g { font-size: 12px; }
.acad .diag { position: relative; background: linear-gradient(to top right, transparent calc(50% - 0.7px), #666 50%, transparent calc(50% + 0.7px)); }
.acad .diag span { position: absolute; font-size: 11px; }
.acad .diag span:first-child { top: 3px; right: 5px; }
.acad .diag span:last-child { bottom: 3px; left: 5px; }
.acad .sun, .acad .sat, .acad .out { background: #d9d9d9; }
.acad td.red { color: #e00000; font-weight: 700; }
.acad td.exam { background: #ffff00; }
.acad tbody.month { border-top: 2px solid #000; }
.acad .subtotal th { text-align: left; padding-left: 6px; }
.acad .items { text-align: left; vertical-align: middle; padding: 4px 6px; font-size: 12px; line-height: 1.55; }
.acad .items ul { list-style: none; margin: 0; padding: 0; }
.acad .items li { padding-left: 9px; text-indent: -9px; }
.acad .items li::before { content: "• "; }
.acad .items li.red { color: #e00000; font-weight: 700; }
.acad .items li.blue, .acad td.blue { color: #1f5fd1; }
.acad .items li.exam { background: #ffff00; }
.acad .items.foot { text-align: center; font-size: 13px; }
.acad td.tot { color: #1f5fd1; font-weight: 700; }
/* 창체·공강 운영 계획 보기: template/창체양식.xlsx 모양 */
.xplan { min-width: 760px; }
.xplan col.c-m, .xplan col.c-d { width: 36px; }
.xplan col.c-w { width: 40px; }
.xplan col.c-dept { width: 96px; }
.xplan col.c-n { width: 30px; }
.xplan.simple { min-width: 600px; max-width: 900px; }
.xplan col.c-area { width: 96px; }
.xplan col.c-h { width: 48px; }
.xplan thead tr:last-child th { border-bottom: 2px solid #000; }
.xplan tbody tr.m-start > * { border-top: 2px solid #000; }
.xplan td.l { text-align: left; padding: 2px 6px; }
.acad-notes { max-width: 980px; margin: 6px auto 0; font-size: 12px; color: #333; }
@media print {
  @page { size: A4; margin: 8mm; }
  body { background: #fff; }
  .topbar, .acad-tools, .flash { display: none; }
  main { padding: 0; max-width: none; }
  .sheet { border: 0; padding: 0; }
  .acad-wrap { overflow: visible; }
  .acad { min-width: 0; font-size: 11px; }
  .acad th, .acad td { height: 19px; }
  .acad .items { font-size: 10px; }
  .acad, .acad * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 860px) {
  .settings { grid-template-columns: 1fr; gap: 16px; }
  .toc { position: static; flex-direction: row; flex-wrap: wrap; padding: 0; }
  .toc a { background: var(--paper); border: 1px solid var(--line); }
}
/* 좁은 화면: 메뉴를 둘째 줄로, 넘치면 가로 스크롤 */
@media (max-width: 760px) {
  .topbar-in { flex-wrap: wrap; height: auto; column-gap: 12px; row-gap: 0; }
  .brand, .who { height: 52px; white-space: nowrap; }
  .topnav { order: 3; width: 100%; height: 44px; overflow-x: auto; margin: 0 -12px; padding: 0 4px; }
  .topnav a { padding: 0 10px; }
}
@media (max-width: 640px) {
  h1 { font-size: 23px; }
  .topbar-in { gap: 12px; padding: 0 16px; }
  .brand { font-size: 15px; }
  main { padding: 16px 12px 64px; }
  .sheet { padding: 20px 16px 24px; }
  .save-bar { margin: 16px -16px -24px; padding: 12px 16px; }
  .seg { width: 100%; }
  .seg a { flex: 1; text-align: center; padding: 7px 8px; }
  .seg a small { display: none; }
  /* 계획표: 한 일정을 두 줄(날짜·교시·시수 / 활동 내용)로 */
  .plan, .plan tbody, .plan tfoot { display: block; }
  .plan thead { display: none; }
  .plan tr { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 0 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  .plan tr.month-start td { border-top: 0; }
  .plan tbody tr:hover td { background: none; }
  .plan td { display: block; height: auto; padding: 0; border: 0; width: auto; }
  .plan tbody th.col-month { grid-column: 1 / -1; width: auto; padding: 14px 0 4px; border: 0; }
  .plan tbody tr:first-child th.col-month { padding-top: 4px; }
  .plan tbody th.col-month span { position: static; padding: 0; font-size: 24px; }
  .plan .col-hours { text-align: right; }
  .plan .col-hours::after { content: "시간"; margin-left: 1px; }
  .plan .col-area { grid-column: 1 / 2; padding: 6px 0 0; }
  .plan .col-content { grid-column: 2 / -1; padding: 6px 0 0; }
  .plan .col-dept { grid-column: 1 / -1; padding: 6px 0 0; }
  .plan .col-del { grid-column: 1 / -1; width: auto; padding: 6px 0 0; }
  .plan :is(.col-content, .col-dept) input { border-color: var(--line); background: var(--paper); }
  .plan tfoot tr { grid-template-columns: 1fr auto; border: 0; border-top: 1px solid var(--ink); }
  .plan tfoot th, .plan tfoot td { border: 0; padding: 0; }
  .plan tfoot td:empty { display: none; }
  .year-list a { grid-template-columns: 1fr; gap: 4px; }
  .holiday-cols { grid-template-columns: 1fr; gap: 20px; }
}
