/* 늘다온 교육 사이트. 책(neuldaon.css)과 같은 토큰. 레이아웃: 한 줄 읽기 컬럼 + 상세페이지 문법은 홈/책 표지에만 */
:root {
  --bg: #ffffff; --surface: #f5f4f0; --ink: #1d1d1b; --text: #2b2b28; --muted: #6b6a64; --line: #e4e2dc;
  --seal: #cf3a2c; --seal-soft: #fbecea; --marker: #ffe36e; --pen: #24406e; --pen-soft: #eef2f8;
  --f-mark: "Song Myung", "Noto Serif KR", serif; --f-display: "Gothic A1", "Noto Sans KR", sans-serif;
  --f-body: "Noto Sans KR", "Malgun Gothic", sans-serif; --f-hand: "Nanum Pen Script", cursive;
}
@media (prefers-color-scheme: dark) { :root { --bg: #161614; --surface: #22211e; --ink: #f2f1ec; --text: #dcdad3; --muted: #a3a199; --line: #34332e; --seal: #ef6a5b; --seal-soft: #3a1f1b; --marker: #c9a92e; --pen: #9fb6e0; --pen-soft: #1f2633; color-scheme: dark; } }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--f-body); font-size: 16px; line-height: 1.8; word-break: keep-all; overflow-wrap: break-word; }
a { color: var(--seal); }
.wrap { max-width: 44rem; margin: 0 auto; padding-inline: 18px; }
.wm { font-family: var(--f-mark); font-weight: 400; }
.mk { box-shadow: inset 0 -.4em 0 var(--marker); }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.inline { display: inline; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--seal); cursor: pointer; }
button.link.danger { color: var(--muted); }
code { font-family: var(--f-body); background: var(--surface); padding: .05em .35em; border-radius: 3px; font-size: .92em; }

/* top */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); }
.brand .wm { font-size: 1.5rem; } .brand-sub { font-family: var(--f-display); font-weight: 800; font-size: .8rem; letter-spacing: .1em; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 14px; font-size: .92rem; font-weight: 500; }
.nav a { color: var(--ink); text-decoration: none; } .nav a:hover { color: var(--seal); }
.nav-admin { color: var(--seal) !important; }
.btn { display: inline-block; background: var(--ink); color: var(--bg) !important; font-family: var(--f-display); font-weight: 800; font-size: .92rem; padding: 10px 18px; border-radius: 4px; border: 1.5px solid var(--ink); text-decoration: none; cursor: pointer; line-height: 1.3; }
.btn:hover { background: var(--seal); border-color: var(--seal); }
.btn-ghost { background: transparent; color: var(--ink) !important; } .btn-ghost:hover { color: var(--bg) !important; }
.btn-sm { padding: 6px 12px; font-size: .82rem; } .btn-wide { width: 100%; }
.flash { font-size: .92rem; padding: 10px 0; } .flash-ok { background: #e9f6ea; color: #1b5e20; } .flash-info { background: var(--pen-soft); color: var(--pen); } .flash-err { background: var(--seal-soft); color: var(--seal); }
.foot { border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 0 48px; font-size: .85rem; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; } .foot-links a { margin-left: 14px; color: var(--muted); }

/* home */
.hero { position: relative; padding: 56px 0 40px; border-bottom: 1px solid var(--line); overflow: hidden; }
.eyebrow { font-family: var(--f-display); font-weight: 800; font-size: .8rem; letter-spacing: .1em; color: var(--seal); }
.hero h1 { font-family: var(--f-display); font-weight: 900; font-size: clamp(2rem, 7vw, 3rem); line-height: 1.2; letter-spacing: -.03em; color: var(--ink); margin: 10px 0 16px; }
.lead { font-size: 1.05rem; color: var(--text); max-width: 36rem; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 10px; }
.hero-note { font-size: .88rem; color: var(--muted); }
.hero .grow { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 70px; opacity: .9; pointer-events: none; }
.grow polyline { stroke: var(--seal); } .grow circle { fill: var(--seal); }
.sec { padding: 36px 0 8px; } .sec-h { font-family: var(--f-display); font-weight: 900; font-size: 1.3rem; color: var(--ink); margin: 0 0 14px; }
.sec-h::before { content: ""; display: block; width: 26px; height: 4px; background: var(--seal); margin-bottom: 10px; }
.sec-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sec-top h1 { margin: 0; }
h1 { font-family: var(--f-display); font-weight: 900; color: var(--ink); letter-spacing: -.02em; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; } @media (max-width: 700px) { .two { grid-template-columns: 1fr; } }
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.bookcard { position: relative; display: block; border: 1.5px solid var(--line); border-radius: 6px; padding: 18px 18px 16px; text-decoration: none; color: var(--text); background: var(--bg); min-height: 200px; }
.bookcard:hover { border-color: var(--ink); }
.bookcard h3 { font-family: var(--f-display); font-weight: 900; font-size: 1.15rem; color: var(--ink); margin: 6px 0; line-height: 1.3; }
.bookcard p { margin: 0; font-size: .9rem; color: var(--muted); }
.bookcard-vol { position: absolute; right: 14px; top: 6px; font-family: var(--f-display); font-weight: 900; font-size: 2.6rem; color: var(--seal); letter-spacing: -.05em; line-height: 1; }
.bookcard-badge { font-family: var(--f-display); font-weight: 800; font-size: .72rem; letter-spacing: .08em; color: var(--muted); }
.bookcard-meta { margin-top: 12px; font-size: .78rem; color: var(--muted); }
.bookcard-soon { border-style: dashed; opacity: .8; } .bookcard-soon .bookcard-vol { color: var(--muted); font-size: 1.4rem; top: 16px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.list li a { color: var(--ink); text-decoration: none; font-weight: 500; } .list li a:hover { color: var(--seal); }
.list li .muted { font-size: .82rem; white-space: nowrap; }
.more { display: inline-block; margin-top: 12px; font-size: .9rem; }
.aside p { font-size: .95rem; } .rule { background: var(--surface); padding: 10px 14px; border-radius: 6px; font-size: .9rem; }

/* book page */
.bookhead { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; padding: 40px 0 10px; border-bottom: 1px solid var(--line); }
.bookhead-vol { font-family: var(--f-display); font-weight: 900; font-size: 4.5rem; line-height: .8; color: var(--seal); letter-spacing: -.05em; }
.bookhead h1 { font-size: clamp(1.7rem, 6vw, 2.4rem); margin: 6px 0 10px; }
.pts { list-style: none; padding: 0; margin: 14px 0 0; display: grid; }
.pts li { display: grid; grid-template-columns: 5rem 1fr; padding: 8px 0; border-top: 1px solid var(--line); font-weight: 700; color: var(--ink); font-size: .95rem; }
.pts li:last-child { border-bottom: 1px solid var(--line); } .pts b { font-family: var(--f-display); font-size: .75rem; letter-spacing: .12em; color: var(--seal); font-weight: 900; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li a { display: grid; grid-template-columns: 3.4rem 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; align-items: baseline; }
.toc li a:hover .toc-t { color: var(--seal); }
.toc-n { font-family: var(--f-display); font-weight: 900; color: var(--seal); font-size: .9rem; }
.toc-s { font-size: .78rem; color: var(--muted); font-weight: 500; }
.toc li.done .toc-s { color: #2e7d32; } .toc li.locked .toc-t { color: var(--muted); }
.note { background: var(--surface); padding: 12px 16px; border-radius: 6px; font-size: .92rem; margin-top: 16px; }

/* lesson */
.lesson { max-width: 38rem; margin: 0 auto; padding-top: 20px; }
.crumb { font-size: .85rem; margin: 10px 0; } .crumb a { color: var(--muted); text-decoration: none; }
.ch-band { position: relative; background: var(--seal); color: #fff; padding: 26px 22px 22px; border-radius: 2px; overflow: hidden; margin-bottom: 18px; }
.ch-band.front { background: var(--ink); }
.ch-band small { font-family: var(--f-display); font-weight: 900; font-size: .78rem; letter-spacing: .2em; }
.ch-band h1 { color: #fff; font-size: clamp(1.5rem, 6vw, 2rem); line-height: 1.3; margin: 6px 0 0; max-width: 80%; }
.ch-band .ch-n { position: absolute; right: 16px; top: 6px; font-family: var(--f-display); font-weight: 900; font-size: 5rem; line-height: 1; opacity: .2; letter-spacing: -.05em; }
.book-body { font-size: 1.02rem; line-height: 1.9; }
.book-body .goal { margin: 16px 0 8px; border-top: 3px solid var(--ink); }
.book-body .goal-hd { font-family: var(--f-display); font-weight: 900; font-size: .85rem; letter-spacing: .08em; color: var(--muted); padding: 10px 0 2px; }
.book-body .goal ul { list-style: none; margin: 0; padding: 0; } .book-body .goal li { padding: 9px 0 9px 1.6rem; border-bottom: 1px solid var(--line); position: relative; color: var(--ink); font-weight: 500; }
.book-body .goal li::before { content: "✓"; position: absolute; left: 0; color: var(--seal); font-weight: 900; }
.book-body h2 { font-family: var(--f-display); font-weight: 900; color: var(--ink); font-size: 1.4rem; line-height: 1.4; margin: 48px 0 12px; }
.book-body h2::before { content: ""; display: block; width: 28px; height: 4px; background: var(--seal); margin-bottom: 10px; }
.book-body h3 { font-family: var(--f-display); font-weight: 800; color: var(--ink); font-size: 1.12rem; margin: 30px 0 6px; }
.book-body h4 { font-size: 1rem; color: var(--ink); margin: 20px 0 4px; }
.book-body p { margin: 10px 0; } .book-body ul, .book-body ol { padding-left: 1.3rem; } .book-body li { margin: 5px 0; } .book-body li::marker { color: var(--seal); }
.book-body hr { border: 0; margin: 8px 0; } .book-body strong { color: var(--ink); }
.book-body .table-wrap { overflow-x: auto; margin: 16px 0; }
.book-body table { border-collapse: collapse; width: 100%; font-size: .92rem; line-height: 1.6; }
.book-body th, .book-body td { text-align: left; vertical-align: top; padding: 9px 11px; border-bottom: 1px solid var(--line); }
.book-body th { border-bottom: 2px solid var(--ink); color: var(--ink); white-space: nowrap; } .book-body tbody tr:nth-child(even) td { background: var(--surface); }
.prompt { margin: 16px 0; background: var(--surface); border-radius: 6px; }
.prompt-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px 0 14px; font-family: var(--f-display); font-weight: 800; font-size: .8rem; color: var(--seal); }
.copy { font: inherit; font-size: .76rem; font-weight: 700; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 3px 11px; cursor: pointer; }
.prompt pre { margin: 0; padding: 4px 14px 12px; overflow-x: auto; } .prompt code { background: none; padding: 0; font-size: .94rem; line-height: 1.8; white-space: pre-wrap; color: var(--ink); }
.book-body blockquote { margin: 18px 0; padding: 4px 0 4px 16px; border-left: 4px solid var(--ink); color: var(--ink); font-weight: 500; }
.book-body blockquote p { margin: 6px 0; }
.callout { border-left: 0 !important; border-radius: 6px; padding: 12px 16px !important; font-weight: 400 !important; color: var(--text) !important; }
.callout::before { display: block; font-family: var(--f-display); font-weight: 900; font-size: .78rem; letter-spacing: .06em; margin-bottom: 2px; }
.callout.tip { background: var(--surface); } .callout.tip::before { content: "늘다온 팁"; color: var(--seal); }
.callout.warn { background: var(--seal-soft); } .callout.warn::before { content: "주의"; color: var(--seal); }
.callout.author { background: var(--pen-soft); border: 1.5px dashed var(--pen); } .callout.author::before { content: "저자 한마디 · 출간 전 작성"; color: var(--pen); }
.callout.pen { background: var(--pen-soft); border-left: 4px solid var(--pen) !important; border-radius: 0 6px 6px 0; } .callout.pen::before { content: "늘다온의 한마디"; color: var(--pen); }
.callout.ai { background: var(--bg); border: 1.5px solid var(--line); font-size: .95rem; } .callout.ai::before { content: "AI 답변 예시"; color: var(--muted); }
.callout.ai em { color: var(--seal); font-style: normal; font-size: .9rem; }
.shot { margin: 14px 0; border: 1.5px dashed var(--line); border-radius: 6px; padding: 16px; text-align: center; color: var(--muted); display: grid; gap: 2px; }
.shot span { font-family: var(--f-display); font-weight: 800; font-size: .72rem; letter-spacing: .1em; } .shot figcaption { font-size: .88rem; }
.contains-task-list { list-style: none; padding-left: 0 !important; } .task-list-item { display: flex; gap: 10px; align-items: baseline; }
.task-list-item input { accent-color: var(--seal); width: 1.05rem; height: 1.05rem; flex: none; transform: translateY(.18rem); }
.teaser { position: relative; max-height: 60vh; overflow: hidden; }
.teaser::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 160px; background: linear-gradient(transparent, var(--bg)); }
.paywall { border: 1.5px solid var(--line); border-radius: 8px; padding: 26px 22px; margin: 10px 0 24px; text-align: center; background: var(--surface); }
.paywall h3 { font-family: var(--f-display); font-weight: 900; color: var(--ink); margin: 0 0 8px; } .paywall p { max-width: 30rem; margin: 0 auto 16px; font-size: .95rem; }
.ch-end { display: flex; justify-content: space-between; align-items: center; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); min-height: 40px; }
.hand { font-family: var(--f-hand); font-size: 1.6rem; color: var(--pen); line-height: 1.2; }
.seal { display: inline-grid; place-items: center; writing-mode: vertical-rl; background: var(--seal); color: #fff; font-family: var(--f-mark); line-height: 1.04; transform: rotate(-4deg); width: 34px; height: 70px; font-size: 18px; border-radius: 4px 3px 5px 2px; box-shadow: inset 0 0 0 2px var(--seal), inset 0 0 0 3.5px #fff; }
.done-form { margin: 14px 0; } .done-ok { color: #2e7d32; font-weight: 700; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin: 28px 0; font-weight: 700; } .pager a { text-decoration: none; color: var(--ink); } .pager a:hover { color: var(--seal); }
.comments { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 24px; }
.cmt { padding: 12px 0; border-bottom: 1px solid var(--line); } .cmt-h { display: flex; justify-content: space-between; font-size: .88rem; } .cmt-b { white-space: pre-wrap; font-size: .95rem; margin-top: 4px; }
.cmt-admin { background: var(--pen-soft); padding: 12px; border-radius: 6px; border: 0; }
.cmt-form { display: grid; gap: 8px; margin-top: 14px; } .cmt-form textarea { width: 100%; font: inherit; padding: 10px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); }
.cmt-form .btn { justify-self: end; }

/* review mode */
.review-bar { background: var(--pen-soft); color: var(--pen); font-size: .88rem; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rv-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--pen); vertical-align: middle; }
.rv-anchor { position: relative; }
.rv-btn { position: absolute; left: -28px; top: .5em; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--pen); background: var(--bg); cursor: pointer; opacity: .35; padding: 0; }
.rv-anchor:hover .rv-btn, .rv-btn.has { opacity: 1; } .rv-btn.has { background: var(--pen); }
@media (max-width: 760px) { .rv-btn { left: -18px; } .lesson { padding-inline: 10px; } }
.rv-pop { position: absolute; z-index: 20; left: 0; right: 0; background: var(--bg); border: 1.5px solid var(--pen); border-radius: 8px; padding: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); font-size: .92rem; }
.rv-pop textarea { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); }
.rv-pop .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.rv-pop .prev { font-size: .85rem; color: var(--pen); border-left: 3px solid var(--pen); padding: 4px 8px; margin: 4px 0 8px; white-space: pre-wrap; }
.rv-pop .prev small { color: var(--muted); }
.rv-list { display: grid; gap: 10px; } .rv-item { border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.rv-item.rv-applied { opacity: .6; } .rv-item.rv-skipped { opacity: .5; border-style: dashed; }
.rv-meta { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; flex-wrap: wrap; } .rv-meta a { color: var(--ink); font-weight: 700; text-decoration: none; }
.rv-quote { font-size: .85rem; color: var(--muted); margin: 4px 0; } .rv-body { white-space: pre-wrap; margin: 6px 0; }
.rv-actions { display: flex; gap: 12px; font-size: .85rem; align-items: center; } .rv-status { font-weight: 700; color: var(--pen); }

/* forms */
.auth { max-width: 28rem; margin: 0 auto; padding-top: 36px; } .auth.wide { max-width: 40rem; }
.auth h1 { font-size: 1.8rem; margin: 0 0 8px; }
.form { display: grid; gap: 14px; margin: 18px 0; } .form label { display: grid; gap: 6px; font-weight: 700; font-size: .92rem; color: var(--ink); }
.form input, .form select, .form textarea { font: inherit; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); width: 100%; }
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--seal); outline-offset: 1px; border-color: var(--seal); }
.form .check { display: block; font-weight: 400; font-size: .88rem; } .form .check input { width: auto; margin-right: 6px; }
.form-err { background: var(--seal-soft); color: var(--seal); padding: 10px 12px; border-radius: 6px; font-size: .9rem; }
.form-info { background: var(--pen-soft); color: var(--pen); padding: 10px 12px; border-radius: 6px; font-size: .9rem; }
.tbl { border-collapse: collapse; font-size: .92rem; } .tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 500; white-space: nowrap; } .tbl-full { width: 100%; } .table-wrap { overflow-x: auto; }
.actions .link { margin-right: 8px; font-size: .85rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 14px 0 24px; }
.stat { border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 14px; } .stat small { display: block; color: var(--muted); font-size: .8rem; } .stat b { font-family: var(--f-display); font-size: 1.8rem; color: var(--ink); }
.post-body { white-space: pre-wrap; margin: 16px 0 28px; font-size: 1rem; }
.legal h3 { font-family: var(--f-display); font-size: 1rem; margin: 22px 0 4px; color: var(--ink); } .legal p { font-size: .95rem; margin: 0; }

/* notes / feed */
.feed { display: grid; gap: 12px; }
.notecard { display: block; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text); background: var(--bg); }
.notecard:hover { border-color: var(--ink); }
.notecard-meta { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; } .notecard-meta .lock { color: var(--seal); }
.notecard h3 { font-family: var(--f-display); font-weight: 900; font-size: 1.15rem; color: var(--ink); margin: 4px 0 6px; line-height: 1.35; }
.notecard p { margin: 0; font-size: .92rem; color: var(--muted); }
.notecard-tags { margin-top: 8px; font-size: .8rem; color: var(--seal); display: flex; gap: 8px; flex-wrap: wrap; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.tag { font-size: .82rem; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--text); }
.tag.on, .tag:hover { border-color: var(--seal); color: var(--seal); }
.tags.small { margin-top: 24px; }
.note-head { padding: 10px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.note-head h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); line-height: 1.3; margin: 0 0 8px; }
.note-meta { display: flex; gap: 6px; font-size: .88rem; color: var(--muted); align-items: baseline; flex-wrap: wrap; } .note-meta .wm { color: var(--ink); font-size: 1.05rem; }
.author { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; background: var(--surface); border-radius: 8px; padding: 16px 18px; margin: 28px 0; font-size: .92rem; }
.author p { margin: 4px 0 0; } .author .wm { font-size: 1.1rem; color: var(--ink); }
.lesson-meta { font-size: .85rem; color: var(--muted); margin: -8px 0 16px; display: flex; gap: 8px; }
.row-btns { display: flex; gap: 10px; }
.home-notes { margin-top: 8px; }
