/* 미리보기 시안에서 꺼낸 판형 스타일(tools/make_preview_assets.py가 만듦) */

@font-face{font-family:'RIDIBatang';src:url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_twelve@1.0/RIDIBatang.woff') format('woff');font-display:swap}
:root{--paper:#f7f4ec;--paper2:#efe4cb;--forest:#1d3a2a;--forest2:#2c5440;--soft:#e9efe4;--ink:#24321f;--body:#4d574c;--mut:#7a8077;--line:#e3ddcf;--amber:#b45309;--amber-bg:#fdf3e7;--rose:#b5482f;--rose-bg:#fbe9e4;--text:#241a0c}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body.pv{font-family:'Pretendard','Malgun Gothic',sans-serif;background:#ddd7c8;color:var(--ink);font-size:14.5px;line-height:1.5;word-break:keep-all}
h1,h2,h3,b{text-wrap:balance}
button{font:inherit;color:inherit;cursor:pointer;border:none;background:none}
input{font:inherit}
.wrap{display:grid;grid-template-columns:350px 1fr;height:calc(100vh - 52px)}
.side{background:var(--paper);border-right:1px solid var(--line);overflow:auto;padding:16px 16px 24px;display:flex;flex-direction:column;gap:14px}
.step h3{font-size:14.5px;color:var(--forest);margin-bottom:7px;display:flex;align-items:center;gap:7px}
.step h3 i{font-style:normal;width:21px;height:21px;border-radius:50%;background:var(--forest);color:#fff;font-size:12px;display:inline-flex;align-items:center;justify-content:center}
.drop{border:2px dashed #b9c4b2;border-radius:14px;background:#fff;padding:16px 12px;text-align:center;transition:.15s}
.drop.on{border-color:var(--forest);background:var(--soft)}
.drop b{display:block;font-size:15px;color:var(--forest)}
.drop p{font-size:12.5px;color:var(--mut);margin-top:4px}
.drop .btn{margin-top:9px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border-radius:999px;padding:8px 15px;font-weight:700;font-size:13.5px;white-space:nowrap}
.btn.pri{background:var(--forest);color:#fff}
.btn.line{border:1.5px solid var(--forest);color:var(--forest);background:#fff}
.btn.amber{background:var(--amber);color:#fff}
.btn.sm{padding:5px 11px;font-size:12.5px}
.row{display:flex;gap:7px;flex-wrap:wrap;align-items:center}
.files{display:flex;flex-direction:column;gap:5px;margin-top:8px}
.file{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--line);border-radius:9px;padding:5px 8px;font-size:12.5px}
.file img{width:30px;height:30px;object-fit:cover;border-radius:4px}
.file .ic{width:30px;height:30px;border-radius:4px;background:var(--soft);color:var(--forest);font-weight:800;font-size:10.5px;display:flex;align-items:center;justify-content:center}
.file span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file em{font-style:normal;font-size:11px;font-weight:700;border-radius:999px;padding:1px 7px;background:var(--soft);color:var(--forest)}
.file em.no{background:var(--rose-bg);color:var(--rose)}
.seg{display:flex;background:#fff;border:1.5px solid var(--line);border-radius:12px;padding:3px;gap:3px}
.seg button{flex:1;border-radius:9px;padding:7px 6px;font-size:13px;color:var(--body);text-align:center;line-height:1.3}
.seg button small{display:block;font-size:11px;color:var(--mut)}
.seg button.on{background:var(--forest);color:#fff;font-weight:700}
.seg button.on small{color:#cfe0cb}
label.f{display:block;font-size:12.5px;color:var(--mut);margin:7px 0 3px}
.in{width:100%;border:1.5px solid var(--line);border-radius:10px;padding:8px 10px;background:#fff;outline:none}
.in:focus{border-color:var(--forest)}
.styles{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
.sty{border:2px solid transparent;border-radius:11px;background:#fff;padding:4px;text-align:center;font-size:11.5px;line-height:1.3;color:var(--body)}
.sty img{width:100%;aspect-ratio:3/4;object-fit:cover;border-radius:7px;display:block;margin-bottom:4px}
.sty.on{border-color:var(--forest);color:var(--forest);font-weight:700}
.sum{background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px 12px;font-size:12.5px}
.sum .g{display:grid;grid-template-columns:1fr 1fr;gap:4px 10px}
.sum .g div{display:flex;justify-content:space-between;border-bottom:1px dashed var(--line);padding:2px 0}
.sum .g b{color:var(--forest)}
.warn{background:var(--amber-bg);color:#6a3a0c;border-radius:10px;padding:7px 10px;font-size:12.5px;margin-top:7px}
.note{font-size:12px;color:var(--mut);line-height:1.5}
.main{display:flex;flex-direction:column;min-width:0;overflow:hidden}
.mtabs{display:flex;gap:6px;padding:10px 18px 0;align-items:center}
.mtabs button{padding:7px 14px;border-radius:10px 10px 0 0;font-weight:700;color:var(--body);background:#e9e3d4}
.mtabs button.on{background:#f3efe4;color:var(--forest)}
.mtabs .sp{flex:1}
.stage{flex:1;background:#f3efe4;margin:0 18px;border-radius:0 12px 12px 12px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:14px;min-height:0;position:relative}
.fit{flex:1;width:100%;min-height:0;display:flex;align-items:center;justify-content:center}
.foot{display:flex;align-items:center;gap:10px;padding:10px 18px 14px}
.dots{display:flex;gap:4px;flex-wrap:wrap;flex:1;justify-content:center}
.dots button{min-width:26px;height:22px;border-radius:6px;background:#e5dfcf;font-size:11px;color:var(--body);padding:0 5px}
.dots button.on{background:var(--forest);color:#fff;font-weight:700}
.empty{text-align:center;color:var(--body)}
.empty img{width:120px}
.empty b{display:block;font-family:'Noto Serif KR',serif;font-size:21px;color:var(--forest);margin:6px 0}
.toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);background:var(--forest);color:#fff;padding:9px 16px;border-radius:999px;font-weight:700;font-size:13.5px;opacity:0;transition:opacity .2s;pointer-events:none;z-index:9}
.toast.on{opacity:1}

/* ===== 책: 기준 크기(한 쪽 420×630, 2:3)로 그리고 통째로 줄여 맞춘다 ===== */
.spread{width:840px;height:630px;display:flex;box-shadow:0 10px 30px rgba(36,26,12,.25);border-radius:4px;position:relative;transform-origin:center center;background:var(--paper)}
.pg{width:420px;height:630px;background:var(--paper);position:relative;overflow:hidden;display:flex;flex-direction:column;font-family:'RIDIBatang','Noto Serif KR',serif;color:var(--text)}
.pg.L{box-shadow:inset -18px 0 22px -18px rgba(0,0,0,.25)}
.pg.R{box-shadow:inset 18px 0 22px -18px rgba(0,0,0,.25)}
.pg .art{height:262px;flex:none;position:relative;background:#e9e2d0}
.pg .art img{width:100%;height:100%;object-fit:cover;display:block}
.pg .txt{flex:1;min-height:0;padding:30px 34px 44px;font-size:17.5px;line-height:1.9;overflow:hidden}
.pg .txt p{text-indent:1em;margin-bottom:.15em;text-wrap:pretty}
.pg .txt p.cont{text-indent:0}
.pg.art-top .art{order:0}.pg.art-top .txt{order:1;padding-top:24px}
.pg.art-bottom .art{order:2}.pg.art-bottom .txt{order:1}
.pg .no{position:absolute;bottom:14px;left:0;right:0;text-align:center;font-family:'Pretendard',sans-serif;font-size:11px;color:#9a8f78}
.ph{position:absolute;inset:10px;border:2px dashed #c9b88f;border-radius:10px;background:repeating-linear-gradient(45deg,#f6efdd,#f6efdd 12px,#f1e8d2 12px,#f1e8d2 24px);display:flex;align-items:center;gap:12px;padding:12px 16px;font-family:'Pretendard',sans-serif}
.ph img{width:64px;aspect-ratio:3/4;object-fit:cover;border-radius:6px;opacity:.9;flex:none}
.ph img{width:64px!important;height:auto!important;aspect-ratio:3/4;object-fit:cover}
.ph b{display:block;color:#7a5a1c;font-size:14px}
.ph span{display:block;color:#8a7650;font-size:12.5px;line-height:1.45;margin-top:2px}
/* 표지 */
.cover{justify-content:space-between;background:#f3e3bf}
.cover .cv-art{height:400px;position:relative;background:#e9e2d0}
.cover .cv-art img{width:100%;height:100%;object-fit:cover;display:block}
.cover .cv-t{padding:20px 30px 0;font-family:'Noto Serif KR',serif;font-weight:900;font-size:30px;line-height:1.3;color:var(--forest);text-wrap:balance}
.cover .cv-a{padding:8px 30px 30px;font-family:'Pretendard',sans-serif;font-size:14px;color:#5b5240}
.inner{align-items:center;justify-content:center;gap:10px;color:#9a8f78;font-family:'Pretendard',sans-serif;font-size:13px}
.inner img{width:90px;opacity:.85}
.endpg{align-items:center;justify-content:center;text-align:center;gap:8px}
.endpg b{font-family:'Noto Serif KR',serif;font-size:26px;color:var(--forest)}
.endpg span{font-family:'Pretendard',sans-serif;font-size:13px;color:#7a6f58}
/* 그림책 장면: 두 쪽에 걸친 그림 */
.scene{position:absolute;inset:0;overflow:hidden;border-radius:4px}
.scene>img{width:100%;height:100%;object-fit:cover;display:block}
.scene .ph{inset:16px}
.scene .stx{position:absolute;width:350px;background:rgba(255,250,238,.9);border-radius:14px;padding:16px 20px;font-family:'RIDIBatang','Noto Serif KR',serif;font-size:19px;line-height:1.75;color:var(--text);box-shadow:0 4px 14px rgba(0,0,0,.12)}
.scene .stx.tl{left:34px;top:30px}
.scene .stx.br{right:34px;bottom:34px}
.scene .stx.small{font-size:16px;line-height:1.65}
.onepg{justify-content:center;padding:40px 44px}
.onepg .otx{font-size:21px;line-height:1.85;text-wrap:pretty}
.onepg .otx.small{font-size:18px}
.scene .gut{position:absolute;left:419px;top:0;bottom:0;width:2px;background:linear-gradient(90deg,rgba(0,0,0,.12),rgba(255,255,255,.15))}
/* 서재에 꽂힌 모습 */
.shelfview{width:100%;max-width:980px}
.shelfview h2{font-family:'Noto Serif KR',serif;font-size:22px;color:var(--forest);margin-bottom:4px}
.shelfview p{color:var(--body);margin-bottom:14px}
.shelf{display:grid;grid-template-columns:repeat(5,1fr);gap:16px;background:linear-gradient(#f7f4ec 0 calc(100% - 14px),#c9b48a calc(100% - 14px));padding:16px 16px 24px;border-radius:12px}
.bk{display:flex;flex-direction:column;gap:6px}
.bk .c{aspect-ratio:3/4;border-radius:4px 8px 8px 4px;overflow:hidden;position:relative;box-shadow:inset 5px 0 0 rgba(0,0,0,.14),0 4px 10px rgba(36,26,12,.2);background:#e9e2d0}
.bk .c img{width:100%;height:100%;object-fit:cover;display:block}
.bk .c .ttl{position:absolute;left:0;right:0;bottom:0;padding:22px 9px 8px;background:linear-gradient(transparent,rgba(0,0,0,.55));color:#fff;font-family:'Noto Serif KR',serif;font-weight:900;font-size:13.5px;line-height:1.3}
.bk .c .ribbon{position:absolute;top:8px;left:-4px;background:#f2b33d;color:var(--forest);font-size:11px;font-weight:800;padding:2px 8px;border-radius:0 999px 999px 0}
.bk b{font-size:13px;line-height:1.3}
.bk span{font-size:11.5px;color:var(--mut)}
.bk.mine .c{outline:3px solid #f2b33d;outline-offset:3px}
@media (max-width:1100px){.wrap{grid-template-columns:300px 1fr}.shelf{grid-template-columns:repeat(4,1fr)}}
