/* Reuse the KoPub font assets used in library-editor.html */
@font-face{font-family:'KoPub Batang';src:url('https://cdn.jsdelivr.net/gh/sweetherofonts/fontshero_pack3/kopub%20batang/kopub%20batang-Light.woff2') format('woff2');font-weight:300;font-style:normal;font-display:swap}
@font-face{font-family:'KoPub Batang';src:url('https://cdn.jsdelivr.net/gh/sweetherofonts/fontshero_pack3/kopub%20batang/kopub%20batang-Medium.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:'KoPub Batang';src:url('https://cdn.jsdelivr.net/gh/sweetherofonts/fontshero_pack3/kopub%20batang/kopub%20batang-Bold.woff2') format('woff2');font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:'KoPub Dotum';src:url('https://cdn.jsdelivr.net/gh/sweetherofonts/fontshero_pack3/kopubdotum/kopubdotum-Light.woff2') format('woff2');font-weight:300;font-style:normal;font-display:swap}
@font-face{font-family:'KoPub Dotum';src:url('https://cdn.jsdelivr.net/gh/sweetherofonts/fontshero_pack3/kopubdotum/kopubdotum-Medium.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:'KoPub Dotum';src:url('https://cdn.jsdelivr.net/gh/sweetherofonts/fontshero_pack3/kopubdotum/kopubdotum-Bold.woff2') format('woff2');font-weight:700;font-style:normal;font-display:swap}
:root{color-scheme:light;--ink:#252528;--muted:#878388;--line:#d8d4d8;--subtle:#f8f7f8;--accent:#65546c;--bg:#fff;--press:#f4f0f5}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--ink)}body{font-family:'KoPub Dotum','Apple SD Gothic Neo','Noto Sans KR','Malgun Gothic',system-ui,sans-serif;font-size:14px;-webkit-font-smoothing:antialiased}
button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:default}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:3px}button{border-radius:0}.muted{color:var(--muted)}.small{font-size:12px;line-height:1.65}.error{color:#a13e55;font-size:12px}.loading{text-align:center;padding:80px 20px;color:var(--muted)}
.topbar{height:56px;display:flex;align-items:center;justify-content:flex-end;padding:0 clamp(18px,4vw,60px);border-bottom:0;gap:16px}.home-link{font-size:12px;letter-spacing:.16em;font-weight:600}.topbar>div{display:flex;align-items:center;gap:13px}.link-button,.plain-btn{border:0;background:transparent;color:#494449;font-size:12px;min-height:32px;padding:5px 2px}.link-button:hover,.plain-btn:hover{text-decoration:underline;text-underline-offset:4px}.primary{background:#312d32;color:white;border:1px solid #312d32;padding:9px 14px;min-height:37px;font-size:12px}.primary:hover{background:#4e4251}.action-wide{width:100%}
.toc-shell{max-width:730px;margin:0 auto;padding:clamp(54px,8vw,96px) clamp(21px,5vw,46px) 100px}.toc-heading{text-align:center;padding:0 0 34px}.kicker{font-family:Georgia,'Times New Roman',serif;font-size:10px;color:#777177;letter-spacing:.26em;margin:0 0 15px}.toc-heading h1{font-family:Georgia,'Times New Roman',serif;font-size:clamp(25px,4vw,34px);font-weight:400;letter-spacing:.1em;margin:0 0 17px}.toc-heading p{font-family:Georgia,'Times New Roman',serif;font-size:11px;letter-spacing:.14em;color:var(--muted);margin:0}.toc-heading .rule{margin:34px auto 0;max-width:72px;border-top:1px solid #aaa4aa}.toc-subtitle{text-align:center;font-size:13px;font-weight:600;letter-spacing:.12em;margin:0 0 26px}
.toc-list{margin:0;padding:0;list-style:none;border:0}.toc-item{border:0}.toc-line{display:flex;align-items:baseline;gap:12px;min-height:60px;padding:19px 2px}.toc-title{font-family:'KoPub Batang','AppleMyungjo','Batang',serif;font-size:15px;line-height:1.55;font-weight:500;overflow-wrap:anywhere;min-width:0;max-width:85%}.toc-title-button{border:0;background:transparent;padding:0;text-align:left;color:inherit;cursor:pointer}.toc-line.openable{cursor:pointer}.toc-line.openable:hover .toc-title-button,.toc-title-button:focus-visible{text-decoration:underline;text-underline-offset:4px}.dot-leader{min-width:12px;flex:1;height:10px;align-self:center;background-image:radial-gradient(circle,#aca7ab .82px,transparent 1px);background-size:6px 4px;background-position:0 6px;background-repeat:repeat-x;opacity:.85}.toc-number{font-family:Georgia,'Times New Roman',serif;font-size:14px;min-width:24px;text-align:right;font-variant-numeric:tabular-nums}.empty{font-size:13px;color:#958d95;text-align:center;padding:50px 0}.private-notice{text-align:center;color:#918991;font-size:13px;padding:48px 0}.footer-note{margin-top:30px;font-size:11px;color:#aaa5aa;text-align:center}
.admin-tools{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;padding:0 0 16px}.admin-tools .checkgroup{display:flex;align-items:center;gap:8px;font-size:12px;color:#534e55}.admin-tools input[type=checkbox],.item-controls input[type=checkbox]{accent-color:var(--accent)}.admin-tools input[type=checkbox]{width:16px;height:16px}.admin-tools .primary{padding:8px 11px}.admin-toc-title{margin-bottom:18px;letter-spacing:.12em}.admin-line{align-items:center;gap:9px;padding-bottom:8px}.drag-handle{touch-action:none;user-select:none;flex:none;width:28px;height:38px;display:grid;place-content:center;border:0;background:transparent;color:#9b939c;cursor:grab}.drag-handle:active{cursor:grabbing}.six-dots{display:grid;grid-template-columns:repeat(2,4px);grid-template-rows:repeat(3,4px);gap:3px}.six-dots i{width:4px;height:4px;background:currentColor;border-radius:50%}.toc-item.dragging{opacity:.45;background:#f3eef4}.toc-item.drop-target{box-shadow:0 -2px 0 var(--accent)}.toc-item.drop-target.end{box-shadow:0 2px 0 var(--accent)}
.item-controls{display:flex;gap:14px;align-items:center;justify-content:flex-end;flex-wrap:wrap;font-size:11px;padding:0 2px 14px 37px;color:#686068}.item-controls label{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}.item-controls input{width:14px;height:14px}.item-controls button{border:0;background:transparent;padding:2px 0;color:#6a5c6d;font-size:11px}.item-controls button:hover{text-decoration:underline}.item-controls .delete{color:#a46b79}
.admin-toc .toc-line{min-height:52px;padding-top:14px;padding-bottom:5px}.admin-toc .toc-title{font-size:15px}.admin-toc .dot-leader{background-position:0 5px}.admin-toc .toc-number{font-size:13px}.admin-toc .toc-item{background:transparent}.admin-toc .toc-item.is-hidden .toc-title{color:#a09aa1}.admin-toc .toc-item.is-hidden .dot-leader{opacity:.35}
.reader-shell{max-width:none;width:100%;margin:0;padding:8px clamp(8px,1.4vw,22px) 0}.reader-head,.edit-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.reader-head{padding:2px 6px 19px}.reader-head h1,.edit-head h1{font-family:'KoPub Batang','AppleMyungjo','Batang',serif;font-weight:500;font-size:14px;margin:0;overflow-wrap:anywhere}.reader-frame{width:100%;height:calc(100vh - 122px);min-height:460px;border:0;background:#fff}.edit-shell{height:calc(100vh - 56px);display:flex;flex-direction:column}.edit-head{padding:10px 24px;border-bottom:1px solid #ece9ed}.edit-head-actions{display:flex;gap:9px;align-items:center}.edit-frame{border:0;flex:1;min-height:400px;width:100%;background:#fafafa}.banner-error{border:1px solid #e7cbd0;background:#fff6f7;color:#8b3d4b;padding:16px;margin:30px auto;max-width:650px;line-height:1.8}
dialog{border:1px solid #d7d0d8;box-shadow:0 22px 90px #24212827;padding:0;width:min(92vw,370px);max-height:90dvh;background:white;color:var(--ink)}dialog::backdrop{background:#16111970}.login-form{padding:25px;display:flex;flex-direction:column;gap:11px}.dialog-head{display:flex;justify-content:space-between;align-items:center}.dialog-head h2{font-size:16px;font-weight:600;margin:0 0 10px}.dialog-head button{border:0;background:white;font-size:25px}.login-form label{font-size:12px}.login-form input{width:100%;border:1px solid #cfc9d0;padding:10px 12px;min-height:42px;border-radius:0}.toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);z-index:60;background:#29242b;color:white;font-size:12px;padding:12px 20px;box-shadow:0 5px 18px #0003}
@media(max-width:600px){.topbar{height:52px;padding:0 16px}.toc-shell{padding-top:58px}.toc-heading{padding-bottom:26px}.toc-line{gap:7px;min-height:53px;padding:14px 0}.toc-title{font-size:13px}.toc-number{font-size:12px;min-width:20px}.admin-tools{align-items:flex-start}.admin-tools .primary{margin-left:auto}.item-controls{justify-content:flex-start;padding:0 0 13px 32px;gap:9px 14px}.edit-head{padding:9px 12px}.reader-shell{padding:10px 0 0}.reader-head{padding:6px 17px 16px}.reader-frame{height:calc(100dvh - 128px)}.edit-shell{height:calc(100dvh - 52px)}.edit-head h1{font-size:12px}.edit-head-actions .primary{padding:8px 9px}}

/* cclibrary reader control: ON=scroll, OFF=page-turn */
.reader-shell{height:calc(100dvh - 56px);min-height:300px;display:flex;flex-direction:column;padding-bottom:0}
.reader-head{flex:0 0 auto}
.reader-controls{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-left:auto}
.reader-scroll-switch{position:relative;display:inline-flex;align-items:center;gap:9px;cursor:pointer;user-select:none;white-space:nowrap;color:#333;font-size:12px}
.reader-switch-input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.reader-switch-track{display:inline-block;width:36px;height:21px;border-radius:999px;background:#c8c8c8;position:relative;flex:none;transition:background .16s ease}
.reader-switch-track::after{content:'';position:absolute;left:3px;top:3px;width:15px;height:15px;border-radius:50%;background:white;box-shadow:0 1px 3px #0003;transition:transform .16s ease}
.reader-switch-input:checked+.reader-switch-track{background:#545454}
.reader-switch-input:checked+.reader-switch-track::after{transform:translateX(15px)}
.reader-switch-input:focus-visible+.reader-switch-track{outline:2px solid #555;outline-offset:3px}
.reader-paging{display:flex;align-items:center;gap:9px}
.reader-paging[hidden]{display:none!important}
.reader-page-button{min-width:31px;height:30px;border:1px solid #d8d4d8;background:white;color:#363038;font-size:23px;line-height:1;display:grid;place-items:center}
.reader-page-button:disabled{opacity:.3}
.reader-page-count{min-width:54px;text-align:center;font-size:12px;white-space:nowrap;font-variant-numeric:tabular-nums}
.reader-frame{flex:1;min-height:0;height:100%;width:100%}
@media(max-width:600px){.reader-shell{height:calc(100dvh - 52px);min-height:260px}.reader-head{gap:9px}.reader-controls{gap:9px}.reader-page-button{min-width:29px;height:29px}.reader-page-count{min-width:45px}}


/* Compact controls following each administrator list number. */
.admin-line{align-items:center;gap:8px}
.admin-line .toc-title{max-width:none;min-width:0;flex:0 1 auto}
.admin-line .dot-leader{flex:1 1 16px;min-width:8px}
.admin-line .toc-number{flex:none;min-width:16px;text-align:right}
.admin-line .item-controls{flex:none;display:flex;align-items:center;justify-content:flex-end;gap:7px;padding:0;margin-left:8px;white-space:nowrap;font-size:11px}
.admin-line .item-controls label{gap:3px}
.admin-line .item-controls input{width:13px;height:13px;margin:0;accent-color:#555}
.admin-line .item-controls button{white-space:nowrap;font-size:11px}
.reader-zoom{display:inline-flex;align-items:center;gap:0;border:1px solid #d0d0d0;background:#fff}
.reader-zoom button{border:0;background:#fff;color:#333;min-height:29px;font-size:13px}
.reader-zoom button:hover{background:#f0f0f0}
.reader-zoom-button{min-width:28px;padding:2px 5px}
.reader-zoom-value{min-width:49px;padding:2px 5px;font-variant-numeric:tabular-nums}
@media(max-width:760px){
 .admin-line{flex-wrap:wrap;gap:7px}
 .admin-line .item-controls{flex:1 0 100%;width:100%;padding:0 0 1px 36px;margin:0;justify-content:flex-end;gap:8px}
 .admin-line .toc-title{flex:0 1 auto;max-width:calc(100% - 88px)}
}
@media(max-width:600px){
 .reader-zoom button{min-height:28px}
 .reader-zoom-button{min-width:26px}
 .reader-zoom-value{min-width:45px}
 .reader-controls{gap:7px}
}

/* Small share panel visible only in authenticated administrator listing. */

.admin-tools{justify-content:flex-end}
.share-panel{margin:2px 0 13px 36px;padding:12px 14px;border:1px solid #e2e2e2;background:#fbfbfb;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.share-panel-label{flex:1 1 100%;font-size:12px;color:#444}
.share-url{flex:1 1 280px;min-width:0;border:1px solid #d3d3d3;background:#fff;color:#333;padding:7px 9px;font:12px/1.5 'KoPub Dotum','Apple SD Gothic Neo',sans-serif}
.share-actions{flex:0 0 auto;display:flex;align-items:center;gap:8px}
.share-copy-button,.share-open-link{display:inline-flex;align-items:center;justify-content:center;border:1px solid #ccc;background:#fff;color:#333;padding:6px 9px;min-height:31px;font-size:11px}
.share-copy-button:hover,.share-open-link:hover{background:#eee}
.share-hint{flex:1 1 100%;margin:0;color:#858585;font-size:11px;line-height:1.6}
@media(max-width:760px){.share-panel{margin:3px 0 12px;padding:10px}.share-actions{width:100%;justify-content:flex-end}}

/* Anonymous share URL has a clean reader toolbar without site navigation. */
body.shared-reader .topbar{display:none!important}
body.shared-reader .reader-shell{height:100dvh;padding-top:6px}
body.shared-reader .reader-head{justify-content:flex-end;padding:7px 8px 13px;min-height:42px}
body.shared-reader .reader-controls{margin-left:auto}
@media(max-width:600px){body.shared-reader .reader-shell{height:100dvh;padding-top:2px}body.shared-reader .reader-head{padding:5px 15px 12px}}
