/* Entrance-year curriculum sheet (편성표). Loaded last so the app's table rules do not leak in.
   Every size is in em: the screen and the A4 print copy differ only in the sheet's font size. */
.pd-doc {
  --pd-ink: #1c2420;
  --pd-muted: #66716b;
  --pd-faint: #8b948f;
  --pd-line: #dfe6e1;
  --pd-rule: #c9d3cc;
  --pd-green: #0e6a43;
  --pd-green-soft: #e3f1e8;
  --pd-green-head: #eef6f1;
  --pd-gold: #e2a41c;
  --pd-gold-ink: #9a6a06;
  --pd-gold-soft: #fbf1d8;
  --pd-gray: #c7ccc9;
  --pd-blue: #5373b5;
  --pd-blue-soft: #e5edfa;
  container: plan-sheet / inline-size;
  font-size: calc(14px * var(--reading-scale, 1));
  color: var(--pd-ink);
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.45;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.pd-doc *, .pd-doc *::before, .pd-doc *::after { box-sizing: border-box; }
.pd-doc :where(h2, h3, h4, p, ul, dl, dd, figure) { margin: 0; padding: 0; }
.pd-doc :where(ul) { list-style: none; }
.pd-sheet { padding: 2.2em 2.4em 1.8em; background: #fff; border: 1px solid var(--pd-line); border-radius: .6em; box-shadow: 0 .2em 1.2em rgba(28, 36, 32, .06); }

/* 머리말 */
.pd-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.4em; padding-bottom: 1.1em; border-bottom: .16em solid var(--pd-ink); }
.pd-logo { width: 6.2em; height: 6.2em; object-fit: contain; }
.pd-school { color: var(--pd-green); font-size: 1.05em; font-weight: 800; letter-spacing: -.01em; }
.pd-title h2 { margin-top: .1em; color: var(--pd-ink); font-size: 2.35em; font-weight: 850; line-height: 1.2; letter-spacing: -.045em; word-break: keep-all; }
.pd-lead { margin-top: .45em; color: #3d4742; font-size: 1.02em; word-break: keep-all; }
.pd-runner { position: relative; display: block; width: 6.4em; aspect-ratio: 335 / 379; overflow: hidden; }
.pd-runner img { position: absolute; top: 0; left: -400%; width: 800%; max-width: none; height: 100%; }
.pd-runner-trail { position: absolute; inset: auto -40% 22% -90%; width: 190%; height: auto; overflow: visible; }
.pd-runner-trail path { fill: none; stroke: #8cc4ea; stroke-width: 2.4; stroke-linecap: round; }

/* 구역 머리 */
.pd-section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3em 1em; margin-bottom: .75em; }
.pd-section-head h3 { color: var(--pd-ink); font-size: 1.32em; font-weight: 800; letter-spacing: -.03em; }
.pd-section-head p { color: var(--pd-muted); font-size: .93em; }
.pd-key { display: flex; flex-wrap: wrap; gap: .3em 1em; margin-left: auto; color: #3d4742; font-size: .86em; }
.pd-key li { display: inline-flex; align-items: center; gap: .4em; }
.pd-doc i:is(.is-school, .is-pick, .is-creative, .is-term, .is-pair) { display: inline-block; width: 1.05em; height: .85em; border-radius: .2em; }
.pd-doc i.is-school { background: var(--pd-green); }
.pd-doc i.is-pick { background: var(--pd-gold); }
.pd-doc i.is-creative { background: var(--pd-gray); }
.pd-doc i.is-term { background: var(--pd-green-soft); }
.pd-doc i.is-pair { background: var(--pd-blue-soft); }

/* 학기별 이수 학점 */
.pd-overview { display: grid; grid-template-columns: minmax(0, 1fr) 17.5em; align-items: start; gap: 1.6em; padding: 1.3em 0 1.4em; border-bottom: 1px solid var(--pd-rule); }
.pd-bars { display: grid; gap: .55em; }
.pd-bar-grade { display: grid; grid-template-columns: 3.6em minmax(0, 1fr) 13em; align-items: center; gap: .2em 1em; }
.pd-bar-grade + .pd-bar-grade { padding-top: .55em; border-top: 1px solid var(--pd-line); }
.pd-bar-label { font-size: 1.02em; font-weight: 800; }
.pd-bar-terms { display: grid; gap: .32em; }
.pd-bar-row { display: grid; grid-template-columns: 2.8em minmax(0, 1fr); align-items: center; gap: .6em; }
.pd-bar-term { color: var(--pd-muted); font-size: .86em; }
.pd-bar-track { display: flex; align-items: center; gap: 2px; min-width: 0; }
.pd-seg { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: calc((100% - 3.6em - 6px) * var(--share)); height: 1.45em; border-radius: .22em; color: #fff; font-size: .82em; font-weight: 750; font-variant-numeric: tabular-nums; overflow: hidden; white-space: nowrap; }
.pd-seg.is-school { background: var(--pd-green); }
.pd-seg.is-pick { background: var(--pd-gold); color: #3a2a04; }
.pd-seg.is-creative { background: var(--pd-gray); color: #2f3532; }
.pd-bar-total { flex: 0 0 auto; margin-left: .45em; white-space: nowrap; font-size: 1.05em; font-weight: 850; font-variant-numeric: tabular-nums; }
.pd-phase { display: grid; gap: .1em; align-self: stretch; align-content: center; padding-left: .9em; border-left: .2em solid var(--pd-green); }
.pd-phase.is-pick { border-left-color: var(--pd-gold); }
.pd-phase strong { font-size: .98em; font-weight: 800; }
.pd-phase span { color: var(--pd-muted); font-size: .84em; }
.pd-total { padding: 1.1em 1.2em 1em; background: var(--pd-green-head); border-radius: .7em; }
.pd-total > p { color: #3d4742; font-size: .95em; font-weight: 700; }
.pd-total > strong { display: block; margin: .05em 0 .45em; color: var(--pd-green); font-size: 3em; font-weight: 850; line-height: 1.1; letter-spacing: -.04em; }
.pd-total > strong small { margin-left: .12em; font-size: .4em; font-weight: 800; letter-spacing: 0; }
.pd-total dl > div { display: flex; align-items: center; justify-content: space-between; gap: .8em; padding: .38em 0; border-top: 1px solid #d3e2d7; font-size: .92em; }
.pd-total dt { display: inline-flex; align-items: center; gap: .5em; color: #2f3833; }
.pd-total dd { font-weight: 800; font-variant-numeric: tabular-nums; }
.pd-total .is-sub dt { padding-left: 1.55em; color: var(--pd-muted); }
.pd-total .is-sub dd { color: var(--pd-muted); font-weight: 600; }

/* 학교 지정 과목 */
.pd-designated { padding: 1.3em 0 1.4em; }
.pd-table-wrap { min-width: 0; }
.pd-doc table.pd-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pd-doc table.pd-table .pd-col-group { width: 7.6em; }
.pd-doc table.pd-table .pd-col-kind { width: 3.2em; }
.pd-doc table.pd-table .pd-col-num { width: 3.4em; }
.pd-doc table.pd-table .pd-col-eval { width: 3.6em; }
.pd-doc table.pd-table .pd-col-grade { width: 3.6em; }
.pd-doc table.pd-table .pd-col-sem { width: 4.5em; }
.pd-doc table.pd-table .pd-col-sum { width: 4.4em; }
.pd-doc table.pd-table :is(th, td) { padding: .26em .45em; color: var(--pd-ink); background: none; border: 0; border-bottom: 1px solid var(--pd-line); font-size: .9em; font-weight: 400; line-height: 1.35; text-align: center; vertical-align: middle; white-space: nowrap; }
.pd-doc table.pd-table thead th { color: #3d4742; background: var(--pd-green-head); font-weight: 650; border-bottom-color: var(--pd-rule); }
.pd-doc table.pd-table thead .pd-sub { color: var(--pd-muted); font-size: .8em; font-weight: 500; }
/* 스크롤하면 표 머리 두 줄만 모달 맨 위에 붙어 따라옵니다. ui-polish.css가 모든 th를 고정하므로 본문·소계의 행 제목(교과군·과목)은 제자리에 둡니다.
   모달 본문 위 여백(--modal-body-pad)만큼 끌어올려 머리 위로 행이 비치지 않게 하고, 학기 줄은 학년 줄(높이 2.1em, 글자 .9em) 바로 아래에 붙입니다.
   붙어 있는 칸에는 표 테두리가 따라오지 않으므로 선은 그림자로 그립니다. */
.pd-doc table.pd-table :is(tbody, tfoot) th { position: static; }
.pd-doc table.pd-table thead th { position: sticky; top: calc(-1 * var(--modal-body-pad, 0px)); z-index: 3; border-bottom-width: 0; box-shadow: inset 0 -1px 0 var(--pd-rule); }
.pd-doc table.pd-table thead tr:first-child th:not([rowspan]) { height: 2.1em; }
/* 표 위 초록 선도 머리 칸에 그려야 붙어 따라올 때 그 두께만큼 틈이 생기지 않습니다. */
.pd-doc table.pd-table thead tr:first-child th { background-image: linear-gradient(var(--pd-green), var(--pd-green)); background-size: 100% .14em; background-repeat: no-repeat; }
.pd-doc table.pd-table thead tr + tr th { top: calc(2.1em * .9 / .8 - var(--modal-body-pad, 0px)); }
.pd-doc table.pd-table thead th:is(.is-year-start, .pd-sum-start) { box-shadow: inset 1px 0 0 var(--pd-rule), inset 0 -1px 0 var(--pd-rule); }
.pd-doc table.pd-table :is(thead th.pd-name, th.pd-name) { text-align: left; }
.pd-doc table.pd-table tbody th.pd-name { font-weight: 550; white-space: normal; word-break: keep-all; }
.pd-doc table.pd-table tbody { border-top: .1em solid #a9b8ae; }
.pd-doc table.pd-table tbody tr.pd-group-start :is(th, td) { border-top: 1px solid #a9b8ae; }
.pd-doc table.pd-table th.pd-group { padding-left: .2em; font-size: .98em; font-weight: 800; text-align: left; white-space: normal; word-break: keep-all; }
.pd-doc table.pd-table .pd-kind { color: var(--pd-faint); font-size: .8em; }
.pd-doc table.pd-table .pd-num { color: #4d5751; }
.pd-doc table.pd-table .pd-num.is-base { color: var(--pd-faint); }
.pd-doc table.pd-table :is(.pd-eval, .pd-grade) { font-size: .84em; }
.pd-doc .pd-grade.is-graded { color: var(--pd-green); font-weight: 750; }
.pd-doc .pd-grade.is-none { color: var(--pd-faint); }
.pd-doc .pd-eval.is-pass { color: var(--pd-gold-ink); font-weight: 800; }
.pd-doc table.pd-table .pd-sem { padding: .2em .3em; }
/* 학년 경계: 각 학년의 1학기 칸 왼쪽에만 선을 긋고, 같은 학년의 1·2학기 사이는 비워 한 덩어리로 보이게 합니다. */
.pd-doc table.pd-table td.pd-sem.is-year-start { box-shadow: inset 1px 0 0 var(--pd-rule); }
.pd-doc table.pd-table tfoot td:is(.is-year-start, .pd-sum-start) { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .35); }
.pd-doc .pd-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 2.6em; padding: .05em .4em; color: var(--pd-green); background: var(--pd-green-soft); border-radius: .3em; font-size: .92em; font-weight: 800; line-height: 1.35; }
.pd-doc .pd-chip:is(.is-pair, .is-cross) { color: var(--pd-blue); background: var(--pd-blue-soft); }
.pd-doc .pd-chip.is-cross { outline: 1.5px dashed var(--pd-blue); outline-offset: -1.5px; }
.pd-doc table.pd-table :is(.pd-earned, .pd-required) { font-size: 1em; box-shadow: inset 1px 0 0 var(--pd-line); }
.pd-doc table.pd-table .pd-earned { font-weight: 850; font-size: 1.12em; }
.pd-doc table.pd-table tfoot :is(th, td) { color: #fff; background: var(--pd-green); border: 0; font-size: .98em; font-weight: 800; }
.pd-doc table.pd-table tfoot th { text-align: right; padding-right: 1em; }

/* 학생 선택 과목 */
.pd-picks { padding: 1.3em 0 1.4em; border-top: 1px solid var(--pd-rule); }
.pd-pick-grid { display: grid; grid-template-columns: repeat(var(--terms, 4), minmax(0, 1fr)); gap: 1.2em; align-items: start; }
.pd-pick-term { min-width: 0; }
.pd-pick-term > header { display: flex; align-items: baseline; justify-content: space-between; gap: .6em; padding-top: .55em; border-top: .28em solid var(--pd-gold); margin-bottom: .55em; }
.pd-pick-term h4 { font-size: 1.12em; font-weight: 800; letter-spacing: -.02em; }
.pd-pick-term > header p { color: var(--pd-muted); font-size: .84em; white-space: nowrap; }
.pd-pick-term > header strong { margin: 0 .1em; color: var(--pd-gold-ink); font-size: 1.55em; font-weight: 850; }
.pd-pick + .pd-pick { margin-top: .8em; }
.pd-pick-head { display: flex; align-items: center; justify-content: space-between; gap: .6em; padding: .45em .65em; background: var(--pd-gold-soft); border-radius: .4em; }
.pd-pick-head strong { display: block; font-size: 1em; font-weight: 800; word-break: keep-all; }
.pd-pick-head em { color: var(--pd-gold-ink); font-style: normal; }
.pd-pick-head span { display: block; color: var(--pd-muted); font-size: .8em; }
.pd-pick-head > b { flex-shrink: 0; color: var(--pd-gold-ink); font-size: 1em; font-weight: 850; }
.pd-pick > ul { margin-top: .2em; }
.pd-pick li { display: grid; grid-template-columns: 6.2em 2.2em minmax(0, 1fr) auto; align-items: center; gap: .1em .4em; padding: .28em .1em; border-bottom: 1px solid var(--pd-line); }
.pd-pick-group { color: var(--pd-muted); font-size: .8em; overflow-wrap: anywhere; }
.pd-pick-kind { color: var(--pd-faint); font-size: .78em; }
.pd-pick-name { font-size: .92em; font-weight: 550; word-break: keep-all; }
.pd-pick.is-by-subject > ul > li { display: grid; grid-template-columns: 5.6em minmax(0, 1fr); align-items: center; gap: .1em .6em; padding: .3em .1em; }
.pd-subject-label strong { display: block; font-size: .92em; font-weight: 800; }
.pd-subject-label em { color: var(--pd-gold-ink); font-style: normal; }
.pd-subject-label span { display: block; color: var(--pd-faint); font-size: .74em; }
.pd-pick.is-by-subject li li { display: flex; align-items: center; justify-content: space-between; gap: .4em; padding: .12em 0; border: 0; }
.pd-tags { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: .2em; }
.pd-doc .pd-tag { display: inline-flex; align-items: center; padding: 0 .4em; border: 1px solid currentColor; border-radius: .3em; font-size: .74em; font-weight: 600; line-height: 1.45; white-space: nowrap; }
.pd-doc .pd-tag.is-prereq { color: #b07a0c; background: #fffaf0; }
.pd-doc .pd-tag.is-csat { color: var(--pd-green); }
.pd-doc .pd-tag.is-csat.is-non { color: var(--pd-muted); }

/* 학기말 증배 교육과정 */
.pd-extra { padding: 1.1em 0 1.2em; border-top: 1px solid var(--pd-rule); }
.pd-extra-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13em, 1fr)); gap: .8em; }
.pd-extra-box { padding: .5em .8em .55em; background: var(--pd-green-head); border-radius: .5em; }
.pd-extra-box strong { display: block; padding-bottom: .3em; margin-bottom: .15em; border-bottom: 1px solid #d3e2d7; font-size: .95em; font-weight: 800; }
.pd-extra-box em { color: var(--pd-green); font-style: normal; }
.pd-extra-box li { padding: .16em 0; border-bottom: 1px solid #e1ece4; font-size: .9em; }
.pd-extra-box li:last-child { border-bottom: 0; }

/* 범례 */
.pd-legend { padding-top: 1em; border-top: 1px solid var(--pd-rule); }
.pd-legend ul { display: grid; gap: .4em; color: #3d4742; font-size: .86em; }
.pd-legend li { display: flex; flex-wrap: wrap; align-items: center; gap: .3em .45em; }
.pd-legend .pd-eval { padding: 0 .35em; background: var(--pd-green-head); border-radius: .25em; font-weight: 750; }
.pd-legend .pd-chip { min-width: 2em; font-size: .9em; }
.pd-dot { margin: 0 .3em; color: var(--pd-faint); }

/* 창 안의 도구줄 */
.pd-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6em 1em; margin: 18px 0 14px; }
.pd-toolbar p { color: #6b6f86; font-size: calc(14px * var(--reading-scale, 1)); }
.pd-toolbar .pd-print-button { min-height: 44px; }

/* 좁은 화면: 표는 약 70em이 필요해 그보다 좁으면 과목명을 줄이지 않고 가로로 넘기며, 나머지는 한 줄씩 쌓습니다. */
@container plan-sheet (max-width: 74em) {
  .pd-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pd-doc table.pd-table { min-width: 70em; }
}
@container plan-sheet (max-width: 64em) {
  .pd-overview { grid-template-columns: minmax(0, 1fr); }
  .pd-pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container plan-sheet (max-width: 46em) {
  .pd-sheet { padding: 1.3em 1.1em 1.2em; }
  .pd-head { grid-template-columns: auto minmax(0, 1fr); gap: .9em; }
  .pd-logo { width: 4.2em; height: 4.2em; }
  .pd-title h2 { font-size: 1.6em; }
  .pd-runner { display: none; }
  .pd-bar-grade { grid-template-columns: 3.2em minmax(0, 1fr); }
  .pd-phase { grid-column: 2; padding: .1em 0 .1em .7em; }
  .pd-pick-grid { grid-template-columns: minmax(0, 1fr); }
  .pd-key { margin-left: 0; }
}

/* 인쇄: 화면 밖에 둔 복사본을 A4 한 장에 맞춥니다. */
.pd-print-root { position: fixed; top: 0; left: -10000px; width: 190mm; pointer-events: none; }
.pd-print-root .pd-doc { font-size: calc(9.2px * var(--pd-fit, 1)); }
.pd-print-root .pd-sheet { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
/* Chrome pushes a repeating table footer to the next page; print the subtotal as an ordinary row. */
.pd-print-root table.pd-table tfoot { display: table-row-group; }
/* 종이에서는 구역 사이 여백을 줄여 글자를 덜 줄이고 한 장에 담습니다. */
.pd-print-root .pd-head { padding-bottom: .8em; }
.pd-print-root :is(.pd-overview, .pd-designated, .pd-picks, .pd-extra) { padding-top: .9em; padding-bottom: .9em; }
.pd-print-root table.pd-table :is(th, td) { padding-top: .2em; padding-bottom: .2em; }
.pd-print-root .pd-pick li { padding-top: .2em; padding-bottom: .2em; }
.pd-print-root .pd-legend { padding-top: .7em; }
/* The app prints nothing else, so A4 is also the default page for browsers without named pages. */
@page { size: A4 portrait; margin: 10mm; }
@page plan-sheet { size: A4 portrait; margin: 10mm; }
@media print {
  html:has(> body.pd-printing), body.pd-printing { background: #fff !important; }
  body.pd-printing { margin: 0 !important; padding: 0 !important; }
  body.pd-printing::before, body.pd-printing::after { display: none !important; }
  body.pd-printing > :not(.pd-print-root) { display: none !important; }
  body.pd-printing > .pd-print-root { position: static; left: auto; width: 190mm; page: plan-sheet; }
  .pd-print-root .pd-overview,
  .pd-print-root table.pd-table tr,
  .pd-print-root .pd-pick { break-inside: avoid; }
}
