/* 라미책방(book.js): 책장, 책 화면(표지·듣기·글), 표지 꾸미기. 표지는 크기에 맞춰 글자가 커지고 작아진다(cqw). */
#bkView{position:absolute;inset:0;z-index:4;display:flex;flex-direction:column;background:var(--paper);padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)} /* 시트(z 5)가 이 위에 뜬다 */
#bkView header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.2rem .8rem 2rem;font-size:1.6rem;flex-shrink:0}
#bkView header b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#bkBody{flex:1;min-height:0;overflow:auto;padding:0 2rem 2rem}
#bkView .acts{display:flex;gap:.6rem;padding:1rem 1.4rem 1.2rem;flex-shrink:0;overflow-x:auto;scrollbar-width:none} /* 한 줄로 밀어 본다: 작은 화면(엠원폰 360×413)에서 글 자리를 지킨다 */
#bkView .acts .chip{flex:none}

/* 표지 */
.bk-cv{container-type:inline-size;position:relative;aspect-ratio:2/3;width:100%;border-radius:.3rem .8rem .8rem .3rem;overflow:hidden;background:var(--c);color:#fff;box-shadow:inset .35rem 0 0 rgba(0,0,0,.18),0 .5rem 1.2rem rgba(20,30,50,.22);text-align:left}
.bk-cv .art{position:absolute;inset:0;background:center/cover no-repeat}
.bk-cv .art.none{display:none}
.bk-cv .words{position:absolute;inset:9cqw 9cqw 8cqw;display:flex;flex-direction:column;gap:2.6cqw}
.bk-cv b{font-size:11cqw;line-height:1.16;font-weight:800;word-break:keep-all;overflow-wrap:anywhere}
.bk-cv small{font-size:5.2cqw;line-height:1.35;opacity:.88;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden} /* 두 줄까지: 길면 지은이와 겹친다 */
.bk-cv em{font-style:normal;font-size:4.8cqw;margin-top:auto;opacity:.9;letter-spacing:.02em}
/* 클래식: 테두리, 가운데 제목(그림이 있으면 위에 그림) */
.t-classic::after{content:"";position:absolute;inset:5cqw;border:1px solid rgba(255,255,255,.55);pointer-events:none}
.t-classic .words{align-items:center;text-align:center;justify-content:center;font-family:ui-serif,"Nanum Myeongjo","Noto Serif KR",Georgia,serif}
.t-classic .art{inset:14cqw 14cqw auto;height:62cqw}
.t-classic:has(.art:not(.none)) .words{top:84cqw;justify-content:flex-start}
.t-classic:has(.art:not(.none)) b{font-size:9.5cqw}
/* 사진: 위 62%가 그림, 아래 띠에 제목 */
.t-photo .art{bottom:auto;height:62%}
.t-photo .words{top:calc(62% + 6cqw)}
.t-photo:has(.art.none) .words{top:9cqw}
.t-photo b{font-size:9.5cqw}
/* 굵게: 큰 제목, 그림은 오른쪽 아래 동그라미 */
.t-bold b{font-size:15cqw;line-height:1.05;letter-spacing:-.02em}
.t-bold .art{inset:auto -12cqw -10cqw auto;width:72cqw;height:72cqw;border-radius:50%;border:2cqw solid rgba(255,255,255,.9)}
/* 동화: 밝은 바탕, 둥근 그림, 둥근 글씨 */
.t-kids{background:color-mix(in srgb,var(--c) 28%,#fff);color:#1F2A44}
.t-kids .art{inset:auto 13cqw 22cqw;height:74cqw;border-radius:50%;border:2.4cqw solid #fff;box-shadow:0 2cqw 4cqw rgba(0,0,0,.12)}
.t-kids .words{align-items:center;text-align:center}
.t-kids b{font-size:11.5cqw;font-weight:900;color:color-mix(in srgb,var(--c) 70%,#1F2A44)}
.t-kids em{position:absolute;bottom:0;left:0;right:0;text-align:center}
/* 밤: 어두운 바탕, 그림은 희미하게, 아래에 빛나는 제목 */
.t-night{background:linear-gradient(180deg,color-mix(in srgb,var(--c) 75%,#000),#07070C)}
.t-night .art{opacity:.55;-webkit-mask-image:linear-gradient(180deg,#000 40%,transparent 92%);mask-image:linear-gradient(180deg,#000 40%,transparent 92%)}
.t-night .words{justify-content:flex-end}
.t-night b{text-shadow:0 0 4cqw color-mix(in srgb,var(--c) 60%,#fff)}
.t-night em{margin-top:2cqw}
/* 회고록: 크림빛 종이, 액자 속 사진, 아래 명조 제목 */
.t-memoir{background:#F4EDE1;color:#3A2F25}
.t-memoir .art{inset:12cqw 16cqw auto;height:70cqw;border:2.2cqw solid #fff;box-shadow:0 1.5cqw 3cqw rgba(0,0,0,.18)}
.t-memoir .words{top:92cqw;font-family:ui-serif,"Nanum Myeongjo","Noto Serif KR",Georgia,serif;align-items:center;text-align:center}
.t-memoir:has(.art.none) .words{top:30cqw}
.t-memoir b{font-size:9.5cqw;font-weight:700;border-bottom:.5cqw solid var(--c);padding-bottom:2cqw}

/* 책장 */
.bk-shelf{display:grid;grid-template-columns:repeat(auto-fill,minmax(10.5rem,1fr));gap:1.8rem 1.2rem;margin-top:1.2rem}
.bk-item{display:flex;flex-direction:column;gap:.5rem;text-align:left;background:none;border:0;padding:0;color:inherit;font:inherit;cursor:pointer}
.bk-item>b{font-size:1.4rem;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.bk-item>small{color:var(--muted);font-size:1.1rem}

/* 책 화면 */
.bk-top{display:flex;gap:1.4rem;align-items:flex-end;padding:.4rem 0 1.4rem}
.bk-top .bk-cv{width:11rem;flex-shrink:0}
.bk-top>div:not(.bk-cv){display:flex;flex-direction:column;gap:.4rem;min-width:0}
.bk-top>div>b{font-size:2rem;line-height:1.25}
.bk-top>div:not(.bk-cv) small{color:var(--muted);font-size:1.25rem} /* 표지 안의 부제(.bk-cv small)는 표지 빛깔을 따른다 */
.bk-play{background:var(--sky);border-radius:1.6rem;padding:1.3rem 1.4rem;display:flex;flex-direction:column;gap:.9rem;margin-bottom:1.6rem}
.bk-play p{margin:0;font-size:1.35rem;line-height:1.5}
.bk-play .row{display:flex;justify-content:center;align-items:center;gap:1.8rem}
.bk-play .rb{font-weight:800;font-size:1.3rem}
.bk-play .rb.big{width:5.6rem;height:5.6rem;font-size:2rem;background:var(--navy);color:#fff}
.bk-play .bar{display:flex;justify-content:space-between;gap:1rem;font-size:1.2rem;color:var(--muted)}
.bk-play .bar span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#bkSeek{width:100%;accent-color:var(--navy);margin:0}
.bk-note{color:var(--muted);font-size:1.15rem}
.bk-prog{background:#FFF7E0;border-radius:1rem;padding:.8rem 1.1rem;font-size:1.3rem;margin:0 0 1rem}
.bk-text{font-size:1.7rem;line-height:1.85}
.bk-text h4{font-size:1.75rem;margin:2.2rem 0 .8rem}
.bk-text p{margin:0 0 .9rem;padding:.2rem .5rem;border-radius:.6rem;transition:background .3s}
.bk-text p.on{background:#FFF1B8}
.bk-edit label{display:flex;flex-direction:column;gap:.4rem;font-size:1.3rem;margin-bottom:1.2rem}
.bk-edit textarea{font-size:1.5rem;line-height:1.6}

/* 표지 꾸미기 */
.bk-cvedit{display:grid;grid-template-columns:11rem 1fr;gap:1.4rem;align-items:start}
.bk-cvedit .sec:first-child{margin-top:0}
.bk-sw{display:flex;flex-wrap:wrap;gap:.8rem}
.bk-sw button{width:3rem;height:3rem;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 1px #CCD3DD;padding:0;cursor:pointer}
.bk-sw button.on{box-shadow:0 0 0 3px var(--navy)}
.bk-agree{align-items:flex-start;gap:1rem;font-size:1.3rem;line-height:1.5}
.bk-agree input{margin-top:.3rem;width:1.8rem;height:1.8rem;flex-shrink:0}
.dv-use.sto{width:100%;margin-top:.6rem;background:#fff}

/* 작가 카드, 리뷰, 편지 */
.bk-who{display:flex;flex-direction:column;gap:.4rem;border:1px solid #E3E8EF;border-radius:1.4rem;padding:1.1rem 1.3rem;margin-bottom:1.6rem}
.bk-who b{font-size:1.45rem}.bk-who small{color:var(--muted);font-size:1.2rem}
.bk-rv{margin-top:2.4rem;border-top:1px solid #E3E8EF;padding-top:.6rem}
.bk-stars{display:inline-flex;gap:.1em;vertical-align:-.15em}
.bk-st{width:1.15em;height:1.15em;fill:#D5DCE5}.bk-st.on{fill:#E2A400}
.bk-pick{display:flex;gap:.4rem}
.bk-pick button{background:none;border:0;padding:.2rem;cursor:pointer;font-size:2.6rem;line-height:0}
.bk-rvme{display:flex;flex-direction:column;gap:.7rem;margin-bottom:1.2rem}
.bk-rvrow .wrap{display:flex;flex-direction:column;gap:.35rem}
.bk-rvrow.off{opacity:.55}
.bk-reply{background:var(--sky);border-radius:.8rem;padding:.5rem .8rem;color:var(--navy)!important}
.bk-msgs{display:flex;flex-direction:column;gap:.8rem;max-height:46vh;overflow:auto;margin-bottom:1rem}
.bk-msg{align-self:flex-start;max-width:85%;background:#F1F4F8;border-radius:1.2rem 1.2rem 1.2rem .3rem;padding:.8rem 1.1rem}
.bk-msg.me{align-self:flex-end;background:var(--sky);border-radius:1.2rem 1.2rem .3rem 1.2rem}
.bk-msg p{margin:0;font-size:1.4rem;line-height:1.5;white-space:pre-wrap}
.bk-msg small{color:var(--muted);font-size:1.05rem}
.bk-sum{display:grid;grid-template-columns:repeat(3,1fr);gap:.8rem;margin-bottom:1.2rem}
.bk-sum span{display:flex;flex-direction:column;align-items:center;gap:.2rem;background:var(--sky);border-radius:1.2rem;padding:1rem .4rem}
.bk-sum b{font-size:2.2rem;color:var(--navy)}.bk-sum small{color:var(--muted);font-size:1.1rem}
.bk-sp{display:inline-block;font-style:normal;font-size:1.15rem;font-weight:700;color:var(--navy);background:var(--sky);border-radius:99px;padding:.1rem .7rem;margin-inline-end:.5rem;vertical-align:.15em}
.bk-cast .rowi{gap:.8rem;align-items:center}.bk-cast select{width:auto;min-width:8.5rem;padding:.5rem .8rem}
/* 광고 자리 */
.bk-ad{margin:0 0 1.6rem}.bk-ad .ad{width:100%}
.bk-shelf .bk-ad{grid-column:1/-1;margin:0}
.bk-text+.bk-ad{margin-top:2rem}
