/* 앱 틀과 메인 — 메인(index.html)·과목 목차(c/<과목>/)·절 페이지가 함께 읽는다(틀의 동작은 js/shell.js).
   왼쪽 사이드바, 오른쪽 흰 작업 패널, 찾기는 명령 팔레트.
   움직임 원칙: 누르는 것은 살짝 눌린다(.97), 반응·등장은 강한 ease-out, 화면 위 이동은 ease-in-out, 모두 300ms 안쪽.
   자주 여는 것(팔레트)과 키보드 동작은 움직이지 않는다. 마우스 올림 효과는 마우스가 있는 기기에서만. */
:root { --side-w: 264px; --ease-drawer: cubic-bezier(.32, .72, 0, 1); --forest-deep: #1c3a17; }
[data-theme="dark"] { --forest-deep: #15281a; }
body[data-view="home"] { background: var(--paper); }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; font: 500 11.5px/1 var(--f-mono); color: var(--ink-2); background: var(--paper); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; }
.num { font-variant-numeric: tabular-nums; }

/* ───── 틀 ───── */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.stage { min-width: 0; padding: 8px 8px 8px 0; }
.main { min-height: calc(100dvh - 16px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.main-in { max-width: 1080px; margin: 0 auto; padding: clamp(28px, 4vw, 52px) clamp(20px, 4vw, 52px) 32px; }
.mbar, .scrim { display: none; }
/* 위 메뉴(js/shell.js가 넣는다): 넓은 화면에서 본문 위에 붙어 내려도 보인다. 사이드바의 같은 메뉴는 숨긴다 */
.tbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 48px; margin-top: -8px; padding: 0 6px 0 2px; background: var(--top-bg, var(--paper)); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); }
.tbar nav { display: flex; align-items: center; gap: 2px; }
.tbar a { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; font-size: 14px; color: var(--ink-2); text-decoration: none; border-radius: 8px; transition: background-color 120ms ease, color 120ms ease; }
.tbar svg { flex: none; width: 17px; height: 17px; }
.tbar a[aria-current="page"] { color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.tbar-r a { font-size: 13.5px; color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) { .tbar a:not([aria-current]):hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); } }
@media (min-width: 901px) { .app:has(.tbar) .side-nav { display: none; } .app:has(.tbar) .main { min-height: calc(100dvh - 48px); } }

/* ───── 사이드바 ───── */
.side { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding: 14px 10px 10px 12px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.side-brand { display: inline-flex; align-items: center; gap: 10px; padding: 6px 8px; font-size: 15px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.side-brand .brand-mark { width: 22px; height: 22px; }
.side-search { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; margin-top: 12px; padding: 0 8px 0 10px; font-size: 13.5px; color: var(--ink-3); text-align: left; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; transition: transform 160ms var(--ease-out), border-color 150ms ease; }
.side-search svg { flex: none; width: 16px; height: 16px; }
.side-search span { flex: 1; }
.side-search:active { transform: scale(.98); }
.side-nav { display: grid; gap: 1px; margin-top: 14px; }
.side-nav a, .sl { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; font-size: 14px; color: var(--ink-2); text-decoration: none; border-radius: 8px; transition: background-color 120ms ease, color 120ms ease; }
.side-nav svg { flex: none; width: 18px; height: 18px; }
.side-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.side-ctx { flex: 1; margin-top: 10px; }
.sg-h { margin: 16px 0 4px; padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.sl { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; min-height: 31px; font-size: 13.5px; }
.sl-nm { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sl-pc { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sl-dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--tc, var(--ink-3)); }
.sl.soon { color: var(--ink-3); }
.sl.sl-all { grid-template-columns: minmax(0, 1fr) auto; margin-top: 4px; color: var(--ink-3); }
.sl.sl-all .sl-nm::after { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 0 1px 6px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; rotate: 45deg; }
.sl.soon .sl-dot { background: none; box-shadow: inset 0 0 0 1.5px var(--tc, var(--ink-3)); }
body[data-scope="basic"] .side li[data-adv] { display: none; }
.side-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 10px 2px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.side-foot a { color: inherit; text-decoration: none; }
.side-foot .theme-btn { margin-left: auto; width: 32px; height: 32px; }
@media (hover: hover) and (pointer: fine) {
  .side-search:hover { border-color: var(--ink-3); }
  .side-nav a:not([aria-current]):hover, .sl:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
  .side-foot a:hover { color: var(--ink); }
}

/* ───── 머리: 이름 제목(인사말 아님)과 숫자 한 줄. 화면이 열릴 때 등장 움직임은 없다(매일 여는 작업 화면) ───── */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.kpis { display: flex; margin: 0; }
.kpis div { padding: 0 22px; border-left: 1px solid var(--line); }
.kpis div:first-child { padding-left: 0; border-left: 0; }
.kpis div:last-child { padding-right: 0; }
.kpis dt { font-size: 12.5px; color: var(--ink-3); }
.kpis dd { margin: 2px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpis dd small { font-size: 13px; font-weight: 400; color: var(--ink-3); }
.kpis dd a { color: var(--warn); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .kpis dd a:hover { text-decoration: underline; text-underline-offset: .2em; } }
.hello { font-size: 24px; font-weight: 700; letter-spacing: -.025em; line-height: 1.3; }
.sub { margin-top: 4px; font-size: 13.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dash-go { margin-top: 20px; }
.dash-go:empty { display: none; }

/* ───── 이어서 공부하기: 흰 패널 하나. 색은 진도(데이터)에만 ───── */
/* 테두리 없는 옅은 잎 초록 바탕 한 장: 흰 바탕과 한 단계 차이로만 나뉜다 */
.panel { --panel-bg: color-mix(in srgb, var(--forest) 7%, var(--surface)); border-radius: var(--r); background: var(--panel-bg); }
[data-theme="dark"] .panel { --panel-bg: color-mix(in srgb, var(--forest) 14%, var(--surface)); }
.panel.cont { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 32px; align-items: end; padding: 24px 26px; }
.cont-sec { font-size: 22px; font-weight: 700; letter-spacing: -.025em; line-height: 1.35; text-wrap: balance; }
.cont-sec .num { margin-right: 8px; font-weight: 500; color: var(--ink-3); }
.cont-next { margin-top: 6px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.cont-next a { color: var(--ink); font-weight: 600; text-decoration: none; }
.cont-go { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.btn.go, .btn.go-2 { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; font-size: 14px; font-weight: 600; text-decoration: none; border-radius: 8px; transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease; }
.btn.go { color: var(--surface); background: var(--ink); border: 0; }
.btn.go-2 { color: var(--ink); background: transparent; border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); }
.btn.go-2 span { font-size: 12.5px; font-weight: 400; color: var(--ink-3); }
.btn.go:active, .btn.go-2:active { transform: scale(.97); }
.cont-r { display: flex; flex-direction: column; justify-content: flex-end; }
.panel.cont.home { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: stretch; }
.home .cont-l { display: flex; flex-direction: column; }
.cont-prog { margin-top: auto; padding-top: 28px; }
.cont-prog p { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cont-prog p b { font-weight: 600; color: var(--ink-2); }
.cont-prog .chbar { margin-top: 10px; }
/* 이 절의 카드: 절 페이지 사이드바의 단계 표시와 같은 모양(본 카드 = 체크, 다음 카드 = 초록 고리) */
.steps-w { padding-left: 32px; border-left: 1px solid color-mix(in srgb, var(--forest) 18%, transparent); }
.steps-h { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.csteps { margin-top: 8px; }
.csteps a { position: relative; display: block; padding: 6px 0 6px 26px; font-size: 14px; line-height: 1.45; color: var(--ink-2); text-decoration: none; }
.csteps a::before { content: ""; position: absolute; left: 1px; top: 9px; width: 13px; height: 13px; box-sizing: border-box; border: 1.5px solid color-mix(in srgb, var(--ink) 28%, transparent); border-radius: 50%; }
.csteps .k { margin-right: 8px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.csteps .done a { color: var(--ink-3); }
.csteps .done a::before { border: 0; background: var(--ink-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2 5.1 8.2 9 4' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat; }
.csteps .here a { font-weight: 600; color: var(--ink); }
.csteps .here a::before { border: 3.5px solid var(--forest); background: var(--surface); }
@media (hover: hover) and (pointer: fine) { .csteps a:hover { color: var(--ink); } }
.cont-pc { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.cont-pc b { font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.cont-pc span { font-size: 13px; color: var(--ink-3); }
.chbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin-top: 14px; }
.chbar li, .chbar a { display: grid; gap: 6px; color: inherit; text-decoration: none; }
.chbar i { display: block; height: 6px; border-radius: 2px; background: linear-gradient(90deg, var(--forest) calc(var(--p) * 100%), color-mix(in srgb, var(--forest) 16%, var(--surface)) 0); }
.chbar span { font-size: 11.5px; text-align: center; color: var(--ink-3); }
.chbar li.here span { font-weight: 700; color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .btn.go:hover { background: color-mix(in srgb, var(--ink) 84%, var(--surface)); }
  .btn.go-2:hover { border-color: var(--ink-3); }
  .cont-next a:hover { text-decoration: underline; text-underline-offset: .2em; }
}

/* ───── 처음 시작하기 ───── */
.panel.start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 24px 26px; }
.start h2 { font-size: 20px; font-weight: 700; letter-spacing: -.025em; }
.start p { margin-top: 8px; font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.start-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.start-go { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; color: var(--ink); text-decoration: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; transition: transform 160ms var(--ease-out), border-color 150ms ease; }
.start-k { font-size: 12px; color: var(--ink-3); }
.start-go b { font-size: 16px; letter-spacing: -.02em; }
.start-s { font-size: 12.5px; color: var(--ink-2); }
.start-go:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .start-go:hover { border-color: var(--ink-3); } }
.demo { margin: 0; }
.demo svg { display: block; width: 100%; height: auto; background: var(--surface); border-radius: 8px; }
.demo-ax { stroke: var(--line-strong); stroke-width: 1; }
.demo-w { fill: none; stroke: var(--forest); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.demo figcaption { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 13.5px; color: var(--ink-2); }
.demo input[type=range] { flex: 1; margin: 0; }
.demo output { min-width: 4.4em; text-align: right; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ───── 구역 ───── */
.blk { margin-top: 40px; scroll-margin-top: 72px; }
.blk-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.blk-h { font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.blk > .blk-h { margin-bottom: 12px; }

/* 최근 본 절: 줄로 나뉜 목록 하나 */
.recent { border: 1px solid var(--line); border-radius: var(--r); overflow: clip; }
.rc { display: grid; grid-template-columns: 180px minmax(0, 1fr) 88px 120px; align-items: center; gap: 16px; min-height: 46px; padding: 0 16px; color: var(--ink); text-decoration: none; transition: background-color 120ms ease; }
.rc + .rc { border-top: 1px solid var(--line); }
.rc-c { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.rc b { overflow: hidden; font-size: 14.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.rc b .num { margin-right: 6px; font-weight: 500; color: var(--ink-3); }
.rc-t { font-size: 12.5px; color: var(--ink-3); text-align: right; white-space: nowrap; }
.rc-p { display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rc-p .lp { width: 64px; margin: 0; }
.rc-p > span:last-child { min-width: 2.4em; text-align: right; }

/* 분절 단추: 흰 밑판이 고른 쪽으로 미끄러진다(처음 그릴 때는 움직이지 않는다) */
.tools { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; background: var(--paper-2); border-radius: 8px; }
.seg button { position: relative; z-index: 1; height: 30px; padding: 0 14px; font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; background: none; border: 0; border-radius: 6px; transition: color 150ms ease, transform 160ms var(--ease-out); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.seg button:active { transform: scale(.96); }
.seg-thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / 2); background: var(--surface); border-radius: 6px; box-shadow: 0 0 0 1px var(--line); transform: translateX(calc(var(--i, 0) * 100%)); }
.seg.ready .seg-thumb { transition: transform 240ms var(--ease-in-out); }
[data-theme="dark"] .seg-thumb { background: #2a2c31; }

/* 분야 탭: 표 바로 위 밑줄 탭 */
.tabs { display: flex; gap: 24px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.tabs button { height: 40px; padding: 0; font-size: 15px; font-weight: 600; color: var(--ink-3); background: none; border: 0; box-shadow: inset 0 -2px transparent; transition: color 150ms ease, box-shadow 150ms ease; }
.tabs button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px var(--ink); }
@media (hover: hover) and (pointer: fine) { .tabs button:not([aria-selected="true"]):hover { color: var(--ink-2); } }
/* 과목 목록: 표처럼 줄과 정렬로. 선택 구분마다 소제목, 숫자는 오른쪽 맞춤 */
.cgrid { border: 1px solid var(--line); border-radius: var(--r); overflow: clip; }
.ct-h, .ct-r { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 56px 64px 168px; align-items: center; gap: 16px; padding: 0 16px; }
.ct-h { height: 38px; font-size: 12px; color: var(--ink-3); }
.ct-g { padding: 18px 16px 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-top: 1px solid var(--line); }
.ct-r { min-height: 44px; color: var(--ink); text-decoration: none; transition: background-color 120ms ease; }
.ct-g + .ct-r { border-top: 0; }
.ct-r + .ct-r { border-top: 1px solid color-mix(in srgb, var(--ink) 5%, transparent); }
.ct-nm { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ct-nm b { overflow: hidden; font-size: 14.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.ct-k { font-size: 13px; color: var(--ink-2); }
.ct-h .r, .ct-r .r { text-align: right; font-variant-numeric: tabular-nums; }
.ct-r .r { font-size: 13.5px; color: var(--ink-2); }
.ct-r .r small { font-size: 12px; color: var(--ink-3); }
.ct-p { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.ct-p .lp { flex: 1; margin: 0; }
.ct-p .num { min-width: 2.6em; }
.ct-r.soon b { font-weight: 500; color: var(--ink-3); }
.ct-r.soon .r { color: var(--ink-3); }
.cc.soon .sl-dot { background: none; box-shadow: inset 0 0 0 1.5px var(--tc); }
@media (hover: hover) and (pointer: fine) {
  .rc:hover, .ct-r:hover { background: color-mix(in srgb, var(--ink) 3.5%, transparent); }
}
body[data-domain="sci"] .cc[data-dom="math"], body[data-domain="math"] .cc[data-dom="sci"], body[data-scope="basic"] .cc[data-adv] { display: none; }
body[data-cview="cards"] #tree, body[data-cview="tree"] #cgrid { display: none; }
.lp { display: block; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 9%, transparent); overflow: hidden; }
.lp i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--forest); }

/* 체계도(과목 위계 표): tb.css의 .mx 위에 메인용 모양만 */
#tree { padding: 4px 0 0; }
#tree .tbox .lv { font-size: 11.5px; color: var(--ink-3); }
#tree .tbox .pg { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
#tree .tbox .lp { margin-top: 8px; }
.mx-arrow { margin: 14px 0 8px; font-size: 12px; text-align: center; color: var(--ink-3); }
.mx-arrow::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 2px 0; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; rotate: 45deg; }
.note { margin-top: 14px; font-size: 12.5px; color: var(--ink-3); }

.foot { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.6; color: var(--ink-3); }
.foot a { color: inherit; }

/* ───── 명령 팔레트: 열고 닫을 때 움직이지 않는다(하루에도 여러 번 여는 창) ───── */
.pal { width: min(640px, calc(100vw - 24px)); max-width: none; max-height: none; margin: 12vh auto auto; padding: 0; color: var(--ink); background: transparent; border: 0; overflow: visible; }
.pal::backdrop { background: rgba(10, 11, 12, .38); }
.pal-box { overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .08); }
.pal-in { display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 14px 0 18px; border-bottom: 1px solid var(--line); }
.pal-in svg { flex: none; width: 20px; height: 20px; color: var(--ink-3); }
.pal-in input { flex: 1; min-width: 0; height: 100%; padding: 0; font-size: 16.5px; color: var(--ink); background: none; border: 0; outline: none; }
.pal-in input::placeholder { color: var(--ink-3); }
.pal-in input::-webkit-search-cancel-button { display: none; }
.pal-list { max-height: min(56vh, 460px); padding: 6px; overflow-y: auto; overscroll-behavior: contain; }
.pal-list a { display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; padding: 8px 10px; color: var(--ink); text-decoration: none; border-radius: 9px; }
.po-k { grid-row: span 2; align-self: center; padding: 3px 0; font-size: 11.5px; font-weight: 600; text-align: center; color: var(--ink-2); background: var(--paper-2); border-radius: 6px; }
.po-t, .po-s { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.po-t { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.po-s { font-size: 12.5px; color: var(--ink-3); }
.pal-list [aria-selected="true"] a { background: color-mix(in srgb, var(--forest) 11%, var(--surface)); }
.pal-list [aria-selected="true"] .po-k { color: var(--forest); background: color-mix(in srgb, var(--forest) 16%, var(--surface)); }
.po-empty { padding: 28px 16px; font-size: 14px; text-align: center; color: var(--ink-3); }
.pal-foot { display: flex; gap: 18px; padding: 9px 16px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }
.pal-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* ───── 좁은 화면: 사이드바는 왼쪽 서랍, 위에 얇은 막대 ───── */
@media (max-width: 900px) {
  .tbar { display: none; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(300px, 86vw); background: var(--paper); box-shadow: 0 0 40px rgba(0, 0, 0, .25); transform: translateX(-104%); visibility: hidden; transition: transform 320ms var(--ease-drawer), visibility 0s 320ms; }
  .nav-open .side { transform: none; visibility: visible; transition: transform 320ms var(--ease-drawer), visibility 0s; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10, 11, 12, .38); opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .stage { padding: 0; }
  .main { min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .mbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; height: 54px; padding: 0 6px; background: var(--top-bg); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
  .icon-btn { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; color: var(--ink); background: none; border: 0; border-radius: 10px; transition: transform 160ms var(--ease-out); }
  .icon-btn svg { width: 22px; height: 22px; }
  .icon-btn:active { transform: scale(.94); }
  .side-search kbd { display: none; }
  .panel.cont, .panel.start, .panel.cont.home { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 18px; }
  .steps-w { padding: 16px 0 0; border-left: 0; border-top: 1px solid color-mix(in srgb, var(--forest) 18%, transparent); }
  .cont-prog { padding-top: 20px; }
  .kpis { width: 100%; }
  .kpis div { flex: 1; padding: 0 12px; }
  .rc-t { display: none; }
  .cont-r { padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--forest) 18%, transparent); }
  .btn.go { flex: 1; justify-content: center; }
  .ct-h, .ct-r { grid-template-columns: minmax(0, 1fr) 56px 110px; }
  .ct-h > :nth-child(2), .ct-h > :nth-child(3), .ct-r > :nth-child(2), .ct-r > :nth-child(3) { display: none; }
}
@media (max-width: 560px) {
  .start-row { grid-template-columns: minmax(0, 1fr); }
  .tools { width: 100%; }
  .tools .seg { flex: 1; }
  .rc { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 14px; }
  .rc-c { grid-column: 1; font-size: 12px; }
  .rc b { grid-column: 1; }
  .rc-p { grid-column: 2; grid-row: 1 / 3; }
  .rc-p .lp { display: none; }
  .pal { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .seg.ready .seg-thumb, .side { transition: none; }
  .btn.go:active, .btn.go-2:active, .start-go:active, .seg button:active, .side-search:active, .icon-btn:active { transform: none; }
}

/* ───── 과목 목차(c/<과목>/, js/home.js view=course) ───── */
.side .sl[aria-current="page"] { color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.cv-h h1 { display: flex; align-items: center; gap: 12px; font-size: clamp(24px, 2.4vw, 30px); font-weight: 700; letter-spacing: -.03em; line-height: 1.25; }
.cv-h h1 .sl-dot { width: 10px; height: 10px; }
.cv-h + .panel { margin-top: 20px; }
.cv-path { display: flex; flex-wrap: wrap; gap: 14px 40px; margin-top: 22px; padding: 4px 0 0; }
.cv-path p { margin-bottom: 8px; font-size: 12.5px; color: var(--ink-3); }
.cv-path div div { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; font-size: 13.5px; font-weight: 500; color: var(--ink); text-decoration: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; transition: transform 160ms var(--ease-out), border-color 150ms ease; }
.cv-chip.plain { color: var(--ink-2); border-style: dashed; }
.cv-chip:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { a.cv-chip:hover { border-color: var(--ink-3); } }
/* 중학교 과목: 올리거나(키보드·터치는 포커스) 무엇을 알면 되는지 설명이 뜬다 */
.cv-tip { position: relative; cursor: help; }
.cv-tip > svg { width: 14px; height: 14px; color: var(--ink-3); }
.cv-tip .tip { position: absolute; left: 0; top: calc(100% + 8px); z-index: 20; width: min(340px, 80vw); padding: 12px 14px; font-size: 13px; font-weight: 400; line-height: 1.6; color: var(--paper); background: var(--ink); border-radius: 8px; white-space: normal; opacity: 0; translate: 0 -4px; pointer-events: none; transition: opacity 150ms ease, translate 150ms var(--ease-out); }
.cv-tip:hover .tip, .cv-tip:focus-visible .tip, .cv-tip:focus .tip { opacity: 1; translate: 0 0; }
.cv-tip:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .cv-tip .tip { transition: none; translate: 0 0; } }

.cv-ch { margin-top: 40px; scroll-margin-top: 24px; }
.cv-ch-h { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.cv-no { flex: none; min-width: 1.2em; font-size: 18px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cv-ch-h h2 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.cv-ch-m { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cv-ch-m .lp { width: 72px; margin: 0; }
.cv-secs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: clip; }
.cv-sec + .cv-sec { border-top: 1px solid var(--line); }
.cv-row { display: grid; grid-template-columns: 3em minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 18px 6px; color: var(--ink); text-decoration: none; }
.cv-n { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cv-t { display: grid; gap: 2px; }
.cv-t b { font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.cv-t span { font-size: 12.5px; color: var(--ink-3); }
.cv-st { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cv-st.done { width: 20px; height: 20px; border-radius: 50%; background: var(--ink-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2 5.1 8.2 9 4' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.cv-sec.here { box-shadow: inset 2px 0 var(--forest); }
.cv-sec.here .cv-n { color: var(--forest); font-weight: 700; }
.cv-sec.here .cv-st { color: var(--forest); font-weight: 600; }
.cv-sec.soon .cv-row { padding-bottom: 14px; color: var(--ink-3); }
.cv-sec.soon .cv-t b { font-weight: 500; }
.cv-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; padding: 4px 18px 14px calc(3em + 30px); }
.cv-cards a { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); text-decoration: none; }
.cv-k { flex: none; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.cv-cards .done a { color: var(--ink-3); }
.cv-cards .done .cv-k { color: transparent; width: 2.2em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6 9.5 3.6' fill='none' stroke='%23686b72' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 0 50% / 12px no-repeat; }
@media (hover: hover) and (pointer: fine) {
  a.cv-row:hover b { text-decoration: underline; text-underline-offset: .2em; }
  .cv-cards a:hover { color: var(--ink); }
}
@media (max-width: 760px) {
  .cv-ch-h { flex-wrap: wrap; }
  .cv-ch-m { width: 100%; margin-left: 0; }
  .cv-row { grid-template-columns: 2.6em minmax(0, 1fr) auto; padding: 12px 14px 4px; }
  .cv-cards { grid-template-columns: minmax(0, 1fr); padding: 2px 14px 12px calc(2.6em + 26px); }
}
