/* 차시 지도 v010 (2026-11-19) — 겉모습 C 「앱」(회색 캔버스 + 흰 카드, Pretendard 400·700). U1 2차에서 사용자가 골랐다. 구조는 v009와 같다. 관리 화면은 admin/admin.css. */
:root {
  --bg: #f2f4f6; --card: #ffffff; --ink: #191f28; --ink2: #4e5968; --ink3: #6b7684; --line: #e5e8eb; --soft: #f2f4f6;
  --kor: #2563eb; --math: #c2410c; --soc: #7c3aed; --sci: #047857; --eng: #be185d; --mor: #a16207; --mus: #b91c1c; --art: #0e7490; --pe: #15803d; --prac: #78350f; --int: #6d28d9; --etc: #4e5968;
  --head: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --body: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  --r: 16px; --r2: 10px; --maxw: 1080px; --cell: 36px;
  --hw: 700; --ok: #047857; --err: #b91c1c; --pick: var(--sc);
  --k-lesson: #1d4ed8; --k-play: #9a3412; --k-sheet: #047857; --k-media: #b91c1c; --k-app: #6d28d9; --k-etc: #4e5968;
}
.s-kor { --sc: var(--kor); } .s-math { --sc: var(--math); } .s-soc { --sc: var(--soc); } .s-sci { --sc: var(--sci); } .s-eng { --sc: var(--eng); }
.s-mor { --sc: var(--mor); } .s-mus { --sc: var(--mus); } .s-art { --sc: var(--art); } .s-pe { --sc: var(--pe); } .s-prac { --sc: var(--prac); } .s-int { --sc: var(--int); } .s-etc { --sc: var(--etc); }
:root { --sc: var(--ink); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--body); word-break: keep-all; overflow-wrap: break-word; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: clip; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head); font-weight: var(--hw); line-height: 1.28; margin: 0; letter-spacing: -0.02em; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.tnum { font-variant-numeric: tabular-nums; }
.vh, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--card); padding: 8px 12px; border: 2px solid var(--ink); }
.sico { width: 22px; height: 22px; vertical-align: -5px; margin-right: 6px; }

/* ---------- 머리 ---------- */
.bar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); }
.bar-in { max-width: var(--maxw); margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--head); font-weight: var(--hw); font-size: 20px; white-space: nowrap; }
.mark { display: inline-flex; gap: 2px; } .mark i { width: 6px; height: 16px; display: block; border-radius: 2px; background: var(--ink); }
.mark i:nth-child(2) { background: var(--kor); } .mark i:nth-child(3) { background: var(--math); }
.grades { display: flex; gap: 2px; }
.grades a, .grades .off { padding: 7px 11px; text-decoration: none; font-weight: 700; border-radius: 999px; }
.grades a:hover { background: var(--soft); }
.grades a[aria-current="page"] { background: var(--ink); color: #fff; }
.grades .off { color: #8b95a1; }
.findbtn { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 250px; padding: 9px 14px; background: var(--soft); border: 0; border-radius: 999px; color: var(--ink2); cursor: pointer; text-align: left; }
.findbtn:hover { background: #e8ebee; }
.lens { width: 15px; height: 15px; border: 2px solid currentColor; border-radius: 50%; position: relative; flex: none; }
.lens::after { content: ""; position: absolute; width: 7px; height: 2px; background: currentColor; right: -6px; bottom: -3px; transform: rotate(45deg); }
.mybtn { white-space: nowrap; font-weight: 700; text-decoration: none; padding: 9px 14px; border-radius: 999px; background: var(--ink); color: #fff; }
.mybtn:hover { background: #333d4b; }

main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 64px; outline: none; }
.foot { max-width: var(--maxw); width: 100%; margin: 0 auto; padding: 24px 20px 40px; color: var(--ink2); font-size: 14px; }
.foot p { margin: 2px 0; }
.hint, .meta, .stat { color: var(--ink2); }
.linkbtn { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.page > * + * { margin-top: 16px; }

/* ---------- 첫 화면 ---------- */
.hero { background: var(--card); border-radius: var(--r); padding: 34px 32px 30px; }
.hero h1 { font-size: clamp(28px, 4.2vw, 42px); }
.bigfind { margin-top: 20px; width: 100%; display: flex; align-items: center; gap: 12px; padding: 18px 20px; font-size: 19px; font-weight: 700; background: var(--soft); border: 0; border-radius: 14px; cursor: pointer; text-align: left; color: var(--ink); }
.bigfind .eg { margin-left: auto; color: var(--ink2); font-weight: 400; font-size: 15px; }
.bigfind:hover { background: #e8ebee; }
.resume { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 16px; padding: 18px 22px; text-decoration: none; background: var(--card); border-radius: var(--r); }
.resume::after { content: "→"; margin-left: auto; font-weight: 700; font-size: 20px; }
.resume:hover { box-shadow: 0 0 0 2px var(--ink) inset; }
.resume .lab, .mynext .lab { font-weight: 700; font-size: 14px; color: var(--ink2); }
.resume .tt { font-weight: 700; font-size: 17px; }
.mine { margin-top: 28px; }
.mine h2, .gradepick h2 { font-size: 22px; margin-bottom: 12px; }
.mylist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.myrow { display: grid; grid-template-columns: minmax(200px, 260px) 1fr 140px; gap: 8px 22px; align-items: center; padding: 18px 22px; background: var(--card); border-radius: var(--r); }
.myname { text-decoration: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.myname b { font-family: var(--head); font-weight: var(--hw); font-size: 20px; color: var(--sc); }
.myname span:not(.sico) { color: var(--ink2); font-size: 14px; flex-basis: 100%; padding-left: 28px; }
.mynext { text-decoration: none; display: flex; flex-direction: column; }
.mynext .tt { font-weight: 700; }
.mynext:hover .tt { text-decoration: underline; }
.fill { display: block; height: 8px; background: var(--soft); border-radius: 99px; position: relative; overflow: hidden; }
.fill i { position: absolute; inset: 0 auto 0 0; background: var(--sc); border-radius: 99px; }
.gradepick { margin-top: 32px; }
.glist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gbtn { display: flex; flex-direction: column; gap: 12px; padding: 22px 22px 20px; text-decoration: none; background: var(--card); border-radius: var(--r); }
.gbtn:hover { box-shadow: 0 0 0 2px var(--ink) inset; }
.gbtn b { font-family: var(--head); font-weight: var(--hw); font-size: 34px; line-height: 1; }
.gsubs { display: flex; flex-wrap: wrap; gap: 6px; }
.gsub { font-size: 14px; font-weight: 700; color: #fff; background: var(--sc); padding: 2px 10px; border-radius: 999px; }
.stat { margin-top: 24px; font-size: 14px; }

/* ---------- 학년 화면 ---------- */
.ghead { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; }
.ghead h1 { font-size: 40px; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; padding: 8px 16px 8px 12px; text-decoration: none; font-weight: 700; background: var(--card); color: var(--ink); border-radius: 999px; }
.chip:hover { box-shadow: 0 0 0 2px var(--sc) inset; }
.chip[aria-current="page"] { background: var(--sc); color: #fff; }
.chip .n { font-weight: 400; font-size: 13px; }
.subj { margin-top: 16px; background: var(--card); border-radius: var(--r); padding: 22px 24px 26px; }
.shead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.shead h2 { font-size: 26px; color: var(--sc); }
.shead .pub { font-family: var(--body); font-weight: 400; font-size: 15px; color: var(--ink2); letter-spacing: 0; }
.sfill { color: var(--ink2); } .sfill b { color: var(--ink); font-size: 18px; }
.mytoggle { margin-left: auto; padding: 9px 16px; border: 0; background: var(--soft); border-radius: 999px; font-weight: 700; cursor: pointer; }
.mytoggle:hover { background: #e8ebee; }
.mytoggle[aria-pressed="true"] { background: var(--ink); color: #fff; }
.tbtabs { display: flex; gap: 6px; }
.tbtabs button { padding: 6px 14px; border: 0; background: var(--soft); border-radius: 999px; cursor: pointer; }
.tbtabs button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; font-size: 14px; color: var(--ink2); }
.legend i { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; border-radius: 5px; background: var(--soft); box-shadow: 0 0 0 1px #c9cfd5 inset; }
.legend i.on { background: color-mix(in srgb, var(--sc) 16%, #fff); box-shadow: 0 0 0 1.5px var(--sc) inset; }
.book { margin-top: 24px; }
.book h3 { font-size: 19px; padding-bottom: 8px; }
.book .vol { font-family: var(--body); font-weight: 400; font-size: 14px; color: var(--ink2); letter-spacing: 0; }
.urow { display: grid; grid-template-columns: 48px minmax(180px, 250px) 1fr; gap: 6px 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.unum { font-family: var(--head); font-weight: var(--hw); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; line-height: 1; color: #fff; background: var(--sc); text-decoration: none; text-align: center; }
.uname { text-decoration: none; display: flex; flex-direction: column; }
.uname b { font-weight: 700; line-height: 1.35; }
.uname span { font-size: 14px; color: var(--ink2); }
.uname:hover b { text-decoration: underline; }
.lcs { display: flex; flex-wrap: wrap; gap: 6px; }
.lc { position: relative; min-width: var(--cell); height: var(--cell); padding: 0 8px; display: inline-grid; place-items: center; font-size: 14px; font-weight: 700; text-decoration: none; color: var(--ink2); border-radius: 10px; background: var(--soft); }
.lc.w2 { min-width: calc(var(--cell) * 1.9); }
.lc.on { background: color-mix(in srgb, var(--sc) 14%, #fff); color: color-mix(in srgb, var(--sc) 68%, #000); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--sc) 55%, #fff) inset; }
.lc:hover { box-shadow: 0 0 0 2px var(--ink) inset; z-index: 1; }
.lc.cur { background: var(--sc); color: #fff; box-shadow: none; }
.pk { display: none; }

/* ---------- 단원·차시 화면 ---------- */
.crumb { margin: 0 0 12px; font-size: 14px; color: var(--ink2); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.crumb a { color: var(--ink); font-weight: 700; text-decoration: none; } .crumb a:hover { text-decoration: underline; }
.uhead { display: flex; gap: 18px; align-items: center; background: var(--card); border-radius: var(--r); padding: 24px; }
.unum.big { width: 64px; height: 64px; font-size: 28px; border-radius: 18px; }
.uhead h1 { font-size: 32px; }
.toc { list-style: none; margin: 0; padding: 8px 24px; background: var(--card); border-radius: var(--r); }
.toc a { display: flex; align-items: baseline; gap: 12px; padding: 13px 0; text-decoration: none; border-bottom: 1px solid var(--line); }
.toc li:last-child a { border-bottom: 0; }
.toc a:hover .lt { text-decoration: underline; }
.toc .no { flex: none; width: 66px; font-weight: 700; color: var(--sc); }
.toc .lt { flex: 1 1 auto; font-weight: 700; }
.toc .lk { font-size: 13px; padding: 1px 7px; margin-right: 6px; border-radius: 6px; background: var(--soft); font-weight: 700; }
.toc .dots { display: none; }
.toc .pg { flex: none; color: var(--ink2); }
.toc .c { flex: none; width: 74px; text-align: right; color: #8b95a1; }
.toc .c.has { color: var(--sc); font-weight: 700; }
.lhead { background: var(--card); border-radius: var(--r); padding: 24px 26px 20px; }
.eyebrow { margin: 0 0 8px; color: var(--ink2); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 700; }
.eyebrow .unum { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
.eyebrow b { color: var(--sc); font-size: 16px; }
.eyebrow .of { color: var(--ink3); font-weight: 400; }
.lhead h1 { font-size: clamp(26px, 3.4vw, 36px); }
.pages { margin: 10px 0 0; font-weight: 700; display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: baseline; }
.addlink { font-weight: 700; font-size: 15px; color: var(--ink2); }
.strip { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.strip .nav { flex: none; text-decoration: none; font-weight: 700; padding: 6px 2px; }
.strip .nav:hover { text-decoration: underline; }
.strip .nav[aria-disabled="true"] { color: #8b95a1; }
.strip .nav:last-child { margin-left: auto; }

/* ---------- 먼저 볼 자료 ---------- */
.picks { margin-top: 16px; }
.picks h2 { font-size: 20px; margin-bottom: 10px; }
.pklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pkc { position: relative; padding: 18px 20px 16px; background: var(--card); border-radius: var(--r); display: flex; flex-direction: column; gap: 8px; }
.pkc:hover { box-shadow: 0 0 0 2px var(--sc) inset; }
.pkc .role { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--sc); }
.pkc .pn { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sc); color: #fff; font-size: 14px; }
.pkc .t { font-weight: 700; font-size: 17.5px; line-height: 1.45; text-decoration: none; }
.pkc .t:hover { text-decoration: underline; }
.pkc .why { margin: 0; color: var(--ink2); font-size: 15px; }
.pkc .src { margin: auto 0 0; padding-top: 6px; font-size: 13.5px; color: var(--ink2); display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; }

/* ---------- 자료 목록 ---------- */
.rsec { margin-top: 16px; background: var(--card); border-radius: var(--r); padding: 22px 24px 14px; }
.rsec > h2 { font-size: 20px; }
.cnt { font-family: var(--body); font-weight: 700; font-size: 16px; color: var(--ink3); letter-spacing: 0; }
.rtools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 14px 0 4px; }
.kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.kinds button { padding: 6px 13px; border: 0; background: var(--soft); border-radius: 999px; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--ink2); }
.kinds button:hover { background: #e8ebee; }
.kinds button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.sort { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink2); }
.sort select { padding: 6px 10px; border: 0; background: var(--soft); border-radius: 10px; color: var(--ink); font-weight: 700; }
.loginnote { margin: 6px 0 0; font-size: 14px; color: var(--ink2); }
.rows { list-style: none; margin: 6px 0 0; padding: 0; }
.row { display: flex; gap: 14px; align-items: flex-start; padding: 15px 0; border-top: 1px solid var(--line); }
.row .body { flex: 1; min-width: 0; }
.row .t { display: block; width: fit-content; max-width: 100%; font-weight: 700; font-size: 17px; text-decoration: none; line-height: 1.5; }
.row .t:hover { text-decoration: underline; }
.row .meta { margin: 6px 0 0; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.kind { display: inline-block; font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 6px; color: var(--kc); background: color-mix(in srgb, var(--kc) 11%, #fff); }
.k-lesson { --kc: var(--k-lesson); } .k-play { --kc: var(--k-play); } .k-sheet { --kc: var(--k-sheet); } .k-media { --kc: var(--k-media); } .k-app { --kc: var(--k-app); } .k-etc { --kc: var(--k-etc); }
.row .star { font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 6px; color: #fff; background: var(--sc); }
.site { font-weight: 700; color: var(--ink2); }
.who { font-weight: 700; color: var(--ink); }
.from { color: var(--ink3); white-space: nowrap; }
.row .note { margin: 6px 0 0; font-size: 15px; color: var(--ink2); }
.row .th { flex: none; border-radius: 8px; object-fit: cover; }
.rep { background: none; border: 0; padding: 0; font-size: 13.5px; color: var(--ink3); text-decoration: underline; cursor: pointer; margin-left: auto; }
.repbox { display: flex; gap: 8px; margin-top: 8px; width: 100%; }
.repbox input { flex: 1; padding: 7px 10px; border: 1px solid #c9cfd5; border-radius: 8px; }
.repbox button { padding: 7px 14px; border: 0; background: var(--ink); color: #fff; border-radius: 8px; cursor: pointer; }
.more { margin: 10px 0 8px; width: 100%; padding: 12px 16px; border: 0; background: var(--soft); border-radius: 12px; cursor: pointer; font-weight: 700; }
.more:hover { background: #e8ebee; }
.empty { margin-top: 16px; padding: 22px 24px; background: var(--card); border-radius: var(--r); }
.fold { margin-top: 12px; background: var(--card); border-radius: var(--r); }
.fold summary { padding: 16px 24px; cursor: pointer; font-weight: 700; font-size: 17px; }
.fold .rsec { margin-top: 0; padding-top: 0; }
.msg.ok { color: var(--ok); } .msg.err { color: var(--err); }

/* ---------- 보태기 ---------- */
.addbox { margin-top: 12px; background: var(--card); border-radius: var(--r); }
.addbox summary { padding: 16px 24px; cursor: pointer; font-weight: 700; }
.upload { padding: 0 24px 22px; }
.upload .help { margin: 0 0 12px; color: var(--ink2); font-size: 15px; }
#upform { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
#upform label { display: flex; flex-direction: column; gap: 4px; }
#upform .wide { grid-column: 1 / -1; }
#upform .lt { font-weight: 700; font-size: 15px; } #upform .opt { color: var(--ink2); font-weight: 400; }
#upform input, #upform select, #upform textarea { padding: 10px 12px; border: 1px solid #c9cfd5; background: #fff; border-radius: var(--r2); }
#upform textarea { min-height: 70px; }
#upform button { justify-self: start; padding: 11px 24px; background: var(--ink); color: #fff; border: 0; border-radius: var(--r2); font-weight: 700; cursor: pointer; }
#upform .hp { position: absolute; left: -9999px; }
#upform .msg { grid-column: 1 / -1; margin: 0; }

/* ---------- 찾기 ---------- */
#find { width: min(760px, calc(100vw - 24px)); max-height: min(82vh, 900px); margin: 7vh auto auto; padding: 0; border: 0; border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
#find::backdrop { background: rgba(25, 31, 40, .5); }
.find-in { display: flex; gap: 8px; padding: 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); }
.find-in .fl { flex: 1; } .find-in input { width: 100%; padding: 13px 16px; font-size: 18px; border: 0; border-radius: 12px; background: var(--soft); }
.fclose { padding: 0 16px; border: 0; background: var(--soft); border-radius: 12px; cursor: pointer; font-weight: 700; }
.fhint { margin: 10px 18px 0; color: var(--ink2); font-size: 14px; }
#fres { padding: 4px 18px 18px; }
#fres h3 { font-size: 15px; margin: 16px 0 6px; font-family: var(--body); font-weight: 700; color: var(--ink2); letter-spacing: 0; }
#fres ul { list-style: none; margin: 0; padding: 0; }
#fres li { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
#fres li > a:first-child { flex: 1; display: flex; flex-direction: column; padding: 10px 0; text-decoration: none; }
#fres li > a:first-child:hover b { text-decoration: underline; }
#fres .w { font-size: 13.5px; color: var(--ink2); }
#fres .pg { font-size: 14px; font-weight: 700; }
#fres .go { flex: none; font-size: 14px; }
#fres .none { color: var(--ink2); margin: 16px 0; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 900px) {
  .findbtn { min-width: 0; } .findbtn .ft { display: none; }
  .myrow { grid-template-columns: 1fr; }
  .pklist { grid-template-columns: 1fr; }
  .glist { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .bar-in { flex-wrap: wrap; gap: 6px 10px; padding: 8px 16px; }
  .brand { font-size: 18px; }
  .grades { order: 3; width: 100%; overflow-x: auto; }
  .grades .gl { display: none; }
  .grades a, .grades .off { padding: 4px 14px; }
  .mybtn { padding: 7px 12px; font-size: 15px; }
  .findbtn { padding: 8px 12px; }
  main { padding: 16px 12px 48px; }
  .hero, .lhead, .uhead, .subj, .rsec, .pkc, .myrow, .resume, .empty { padding-left: 18px; padding-right: 18px; }
  .toc, .fold summary, .addbox summary, .upload { padding-left: 18px; padding-right: 18px; }
  .bigfind { font-size: 17px; flex-wrap: wrap; } .bigfind .eg { margin-left: 27px; flex-basis: 100%; }
  .ghead h1 { font-size: 32px; }
  .urow { grid-template-columns: 44px 1fr; } .urow .lcs { grid-column: 1 / -1; }
  .toc .pg { display: none; } .toc .no { width: 58px; }
  .strip { flex-wrap: wrap; } .strip .lcs { order: 3; width: 100%; }
  .sort { margin-left: 0; }
  #upform { grid-template-columns: 1fr; }
  .uhead h1 { font-size: 26px; }
  .mytoggle { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
