:root {
  --ink: #1b1b1a;
  --sub: #66655f;
  --line: #e4e3de;
  --bg: #fff;
  --side: #f7f6f3;
  --accent: #1f4d3a;
  --ok: #1f6b45;
  --warn: #a4471c;
  --hold: #66655f;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.7 Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }

/* 뼈대 */
.top { display: none; }
.layout { display: flex; min-height: 100vh; }
.side {
  width: 288px;
  flex: none;
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 20px 12px 32px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.45;
}
.side h1 { font-size: 15px; margin: 0 8px 2px; }
.who { margin: 0 8px 16px; color: var(--sub); font-size: 13px; }
.who button { border: 0; background: none; padding: 0; color: var(--sub); text-decoration: underline; cursor: pointer; font-size: 13px; }
.meter { margin: 0 8px 18px; }
.meter div { height: 4px; background: var(--line); }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter span { display: block; margin-top: 5px; font-size: 12px; color: var(--sub); }
.side h2 { font-size: 12px; font-weight: 600; color: var(--sub); margin: 20px 8px 4px; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side ul ul { padding-left: 14px; }
.side a { display: flex; gap: 6px; padding: 5px 8px; text-decoration: none; border-radius: 4px; }
.side a:hover { background: #eeece6; }
.side a.on { background: #e6e4dc; font-weight: 600; }
.side a.done .t { color: var(--sub); }
.side a.locked { opacity: .5; }
.side a.locked::after { content: "잠김"; margin-left: auto; font-size: 11px; color: var(--sub); flex: none; }
.side a.done::after { content: "완료"; margin-left: auto; font-size: 11px; color: var(--ok); flex: none; }
main { flex: 1; min-width: 0; }
.page { max-width: 760px; margin: 0 auto; padding: 48px 24px 96px; }

/* 본문 */
.page h1 { font-size: 30px; line-height: 1.3; margin: 0 0 24px; }
.page h2 { font-size: 22px; line-height: 1.35; margin: 40px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.page h3 { font-size: 18px; line-height: 1.4; margin: 28px 0 8px; }
.page h4 { font-size: 16px; margin: 22px 0 6px; }
.page p { margin: 6px 0; }
.page ul, .page ol { margin: 6px 0; padding-left: 24px; }
.page li { margin: 3px 0; }
.page hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.page img, .page video { max-width: 100%; height: auto; display: block; background: #f1f0ec; }
.page video { width: 100%; max-height: 72vh; background: #000; }
.page figure { margin: 14px 0; }
figcaption { font-size: 13px; color: var(--sub); margin-top: 4px; }
.page code { background: #f1f0ec; padding: 1px 4px; font-size: .92em; }
blockquote { margin: 10px 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--ink); }
details { margin: 6px 0; }
summary { cursor: pointer; padding: 3px 0; }
details > .in { padding: 4px 0 4px 18px; }
.callout { display: flex; gap: 10px; padding: 12px 14px; margin: 12px 0; background: #f1f0ec; }
.callout .ic:empty { display: none; }
.callout > div { min-width: 0; flex: 1; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 10px 0; }
.tw { overflow-x: auto; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
th { background: #f7f6f3; font-weight: 600; }
.file, .pg { display: block; padding: 9px 12px; margin: 6px 0; border: 1px solid var(--line); text-decoration: none; }
.file:hover, .pg:hover { background: #f7f6f3; }
.file small { color: var(--sub); margin-left: 6px; }
.yt { position: relative; aspect-ratio: 16 / 9; margin: 10px 0; background: #000; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.missing { color: var(--sub); font-size: 14px; }
.foot { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { border: 1px solid var(--ink); background: var(--ink); color: #fff; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-block; font-size: 15px; }
.btn.line { background: none; color: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; }

/* 노션 글자색 */
.c-red { color: #c4342c; } .c-orange { color: #c2620f; } .c-yellow { color: #a07a00; } .c-green { color: #2c7a4b; }
.c-blue { color: #2467b0; } .c-purple { color: #7446ad; } .c-pink { color: #b83a7c; } .c-brown { color: #8a5a3a; } .c-gray { color: #6f6e69; }
mark { background: none; color: inherit; padding: 0 2px; }
.bg-red { background: #fbe9e7; } .bg-orange { background: #fbeedd; } .bg-yellow { background: #fbf3d6; } .bg-green { background: #e5f2e9; }
.bg-blue { background: #e4eefa; } .bg-purple { background: #eee7f7; } .bg-pink { background: #f9e8f1; } .bg-brown { background: #f1e8e1; } .bg-gray { background: #f1f0ec; } .bg-default { background: #f1f0ec; }

/* 연습문제 */
.lead { color: var(--sub); margin: -14px 0 24px; }
.check { list-style: none; padding: 0 !important; }
.check li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.drop { display: block; border: 1px dashed #a9a79f; padding: 26px 16px; text-align: center; cursor: pointer; margin: 14px 0; }
.drop:hover, .drop.over { background: #f7f6f3; }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop small { display: block; color: var(--sub); font-size: 13px; }
.bar { height: 4px; background: var(--line); margin: 12px 0 4px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.state { font-size: 14px; color: var(--sub); }
.result { margin-top: 28px; }
.verdict { font-size: 19px; font-weight: 700; margin: 0 0 4px; }
.verdict.pass { color: var(--ok); }
.verdict.fix { color: var(--warn); }
.row { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tag { font-size: 13px; font-weight: 600; }
.tag.통과 { color: var(--ok); } .tag.고치기 { color: var(--warn); } .tag.확인불가, .tag.사수확인 { color: var(--hold); }
.row b { display: block; }
.row small { color: var(--sub); display: block; font-size: 14px; }
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 14px 0; }
.timeline { display: flex; gap: 2px; height: 14px; margin: 10px 0 14px; }
.timeline i { flex: 1 1 0; min-width: 2px; background: var(--ok); }
.timeline i.고치기 { background: var(--warn); }
.pair { margin: 0; font-size: 13px; }
.pair div { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.pair img { width: 100%; display: block; background: #eee; }
.pair figcaption { margin-top: 4px; }
.list th, .list td { white-space: nowrap; }

/* 입장 */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate form { width: 100%; max-width: 340px; }
.gate h1 { font-size: 24px; margin: 0 0 4px; }
.gate p { margin: 0 0 20px; color: var(--sub); font-size: 15px; }
.gate label { display: block; font-size: 14px; margin: 12px 0 4px; }
.gate input { width: 100%; padding: 10px 11px; border: 1px solid #a9a79f; border-radius: 0; font-size: 16px; }
.gate .btn { width: 100%; margin-top: 18px; }
.gate .err { color: var(--warn); font-size: 14px; min-height: 22px; margin: 8px 0 0; }

@media (max-width: 820px) {
  .layout { display: block; }
  .top {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 5;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 10px 16px; font-size: 15px; font-weight: 600;
  }
  .top button { border: 1px solid var(--line); background: none; padding: 3px 10px; font-size: 14px; }
  .side { position: fixed; z-index: 6; inset: 0 auto 0 0; width: min(86vw, 320px); transform: translateX(-100%); transition: transform .18s; }
  body.open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .28); }
  .page { padding: 28px 16px 72px; }
  .page h1 { font-size: 25px; }
  .row { grid-template-columns: 60px 1fr; }
}
