.reply-footer { display:flex; align-items:center; justify-content:space-between; gap:.6em; margin:.45em 0; }
.reply-footer time { color:#72747a; }
.reply-footer button { font:inherit; border:0; background:none; color:#b92e36; padding:.4em .25em; cursor:pointer; }
.book-comment-text { color:inherit; overflow-wrap:anywhere; }
.book-reply-more { color:#b92e36; }
.reply-composer { box-sizing:border-box; width:100%; margin:10px 0 0; padding:12px; border:1px solid #e9e5e5; border-radius:12px; background:#faf8f8; color:#302b2b; font:14px/1.5 system-ui,sans-serif; }
.reply-composer label, .reply-composer label span { display:block; }
.reply-composer label span { margin-bottom:7px; font-weight:600; }
.reply-composer textarea { display:block; box-sizing:border-box; width:100%; min-height:78px; padding:10px 12px; border:1px solid #ded8d8; border-radius:8px; background:#fff; color:#2b2727; font:inherit; resize:vertical; }
.reply-composer textarea:focus { outline:2px solid #c33d45; outline-offset:1px; }
.reply-composer-actions { display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:8px 10px; margin-top:10px; }
.reply-composer-actions [role="status"]:not(:empty) { flex:1 1 12em; color:#a22335; }
.reply-composer-actions button { appearance:none; border:1px solid transparent; border-radius:7px; padding:7px 13px; font:600 13px/1.4 system-ui,sans-serif; cursor:pointer; }
.reply-composer-actions [type="button"] { background:#fff; border-color:#ded8d8; color:#514b4b; }
.reply-composer-actions [type="submit"] { background:#be3039; color:#fff; }
.reply-composer-actions [type="submit"]:hover { background:#a1242d; }
.reply-composer-actions [type="submit"]:disabled { opacity:.55; cursor:wait; }
[id^="reply-"]:target { outline:2px solid #d75e61; outline-offset:2px; scroll-margin-top:1em; }
.received-count { color:#b92e36; }
.received-item { overflow-wrap:anywhere; }
.received-item > .flex-item { min-width:0; }
.received-line { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:4px 12px; }
.received-line time, .received-context { font-size:.87em; }
.received-context { margin-top:5px; }
.received-text { line-height:1.55; margin:6px 0; }
.received-unread { display:inline-block; padding:1px 6px; border-radius:9px; background:#fff0f0; color:#a72332; font-size:.84em; white-space:nowrap; }
.received-empty { margin:0; padding:24px 12px; color:#6a6262; text-align:center; }
.received-open { margin:3px 0 0; text-align:right; }
.received-open button { border:1px solid #ead1d4; border-radius:6px; background:#fff; padding:4px 10px; font:inherit; cursor:pointer; }
.received-open button:hover { background:#fff3f3; }

.book-discussion, .book-discussion-compose { --discussion-avatar:42px; --discussion-gap:12px; padding-inline:clamp(12px, 3vw, 24px); }
.book-discussion { color:#282424; font-size:15px; line-height:1.55; }
.book-discussion-item { display:grid; grid-template-columns:var(--discussion-avatar) minmax(0,1fr); align-items:start; gap:var(--discussion-gap); padding-block:18px; }
.book-discussion > .book-discussion-item + .book-discussion-item { border-top:1px solid #efebeb; }
.book-discussion-avatar { display:block; width:var(--discussion-avatar); height:var(--discussion-avatar); object-fit:cover; border-radius:50%; background:#f2eeee; }
.book-discussion-author { margin:0 0 4px; color:#383131; font-weight:600; overflow-wrap:anywhere; }
.book-discussion .book-comment-text { display:block; line-height:1.6; color:inherit; }
.book-discussion a.book-comment-text:hover { color:#b32e36; }
.book-discussion .reply-footer { justify-content:flex-start; flex-wrap:wrap; gap:4px 12px; font-size:13px; margin:5px 0 0; }
.book-discussion .reply-footer time { color:#6a6262; }
.book-discussion .reply-footer button { padding:5px 0; color:#645a5a; background:transparent; width:auto; height:auto; line-height:1.4; }
.book-discussion .reply-footer button:hover, .book-discussion .reply-footer button.active { color:#b32e36; }
.book-discussion .reply-footer button.active .number { color:#b32e36; font-weight:700; }
.book-discussion-actions { margin-left:auto; display:flex; align-items:center; gap:14px; }
.book-discussion-actions button { display:inline-flex; gap:4px; align-items:center; }
.book-discussion-actions img { width:15px; height:15px; object-fit:contain; }
.book-reply-preview { margin-top:4px; }
.book-reply-preview:empty { display:none; }
.book-reply-preview .book-discussion-item { --discussion-avatar:34px; padding-block:10px; }
.book-reply-preview .book-discussion-author { color:#554b4b; }
.book-reply-preview .book-reply-target, .book-reply-preview .book-reply-more { color:#b32e36; }
.book-reply-more { display:inline-block; margin:8px 0 0 calc(34px + var(--discussion-gap)); font-size:14px; }
.book-discussion-empty { padding-block:12px; color:#6a6262; }
@media (max-width:600px) {
    .book-discussion, .book-discussion-compose { --discussion-avatar:34px; --discussion-gap:9px; }
    .book-discussion-item { padding-block:14px; }
    .book-reply-preview .book-discussion-item { --discussion-avatar:26px; }
    .book-reply-more { margin-left:calc(26px + var(--discussion-gap)); }
}

.thread-floors { list-style:none; margin:0; padding:0; }
.thread-floor { display:grid; grid-template-columns:44px minmax(0,1fr); align-items:start; gap:13px; padding:15px 18px; background:#fff; color:#2a2525; font:15px/1.55 system-ui,sans-serif; }
.thread-floors .thread-floor { border-bottom:1px solid #eee9e9; }
.thread-origin { border-bottom:1px solid #eee9e9; }
.thread-avatar { display:block; width:44px; height:44px; object-fit:cover; border-radius:50%; }
.thread-heading { display:flex; align-items:baseline; justify-content:space-between; gap:12px; }
.thread-author { font-weight:650; color:#383131; overflow-wrap:anywhere; }
.thread-number { color:#716666; font-size:12px; white-space:nowrap; }
.thread-text { margin-top:3px; overflow-wrap:anywhere; }
.thread-target { color:#675353; font-weight:550; }
.thread-floor .reply-footer { justify-content:flex-start; gap:12px; margin:6px 0 0; font-size:13px; }
.thread-floor .reply-footer time { color:#6a6262; }
.thread-floor .reply-footer button { color:#be3039; line-height:1.35; }
.thread-actions, .thread-actions button { display:flex; align-items:center; gap:5px; }
.thread-actions { margin-left:auto; gap:12px; }
.thread-actions img { width:15px; height:15px; }
.thread-actions .active .number { font-weight:700; }
.thread-empty { padding:18px; color:#6a6262; }
.thread-floor[id]:target { outline-offset:-2px; background:#fff3f3; }
@media (max-width:600px) {
    .thread-floor { grid-template-columns:34px minmax(0,1fr); gap:10px; padding:12px; font-size:14px; }
    .thread-avatar { width:34px; height:34px; }
    .thread-floor .reply-footer { font-size:12px; }
}

.book-comment-write { display:block; margin:14px 0; }
.book-comment-write summary { display:flex; align-items:center; gap:var(--discussion-gap); cursor:pointer; list-style:none; }
.book-comment-write summary::-webkit-details-marker { display:none; }
.book-comment-prompt { flex:1; box-sizing:border-box; min-height:42px; display:flex; align-items:center; padding:8px 14px; border:1px solid #e8e3e3; border-radius:10px; background:#f8f6f6; color:#655c5c; font:14px/1.4 system-ui,sans-serif; }
.book-comment-write summary:hover .book-comment-prompt { background:#f3eded; border-color:#ded3d3; }
.book-comment-heading { display:none; color:#383131; font:600 14px/1.4 system-ui,sans-serif; }
.book-comment-write[open] .book-comment-prompt { display:none; }
.book-comment-write[open] .book-comment-heading { display:block; }
.book-comment-write:not([open]) > .reply-composer { display:none; }
.book-comment-write .reply-composer { width:auto; margin:0 0 0 calc(var(--discussion-avatar) + var(--discussion-gap)); padding:0; border:0; border-radius:0; background:none; }
.book-comment-write .reply-composer textarea { margin:4px 0 0; padding:10px 12px; min-height:92px; border-radius:10px; background:#fff; resize:none; }
.book-comment-write .reply-composer-actions a { color:#b32e36; }
.book-comment-status { margin:0 clamp(12px, 3vw, 24px); color:#a22335; font-size:13px; line-height:1.5; }
.book-comment-status:empty { display:none; }
@media (max-width:600px) {
    .book-comment-write .reply-composer textarea { font-size:16px; }
}

.book-comment-write summary, [data-thread-reply] { -webkit-tap-highlight-color:transparent; }
.book-comment-write summary:focus:not(:focus-visible), [data-thread-reply]:focus:not(:focus-visible) { outline:none; }
.book-comment-write summary:focus-visible, [data-thread-reply]:focus-visible { outline:2px solid #be3039; outline-offset:3px; border-radius:6px; }
.comment-login { position:fixed; inset:0; margin:auto; box-sizing:border-box; width:min(390px, calc(100% - 32px)); max-height:calc(100% - 32px); padding:20px; border:1px solid #eee7e7; border-radius:14px; background:#fff; color:#322b2b; box-shadow:0 12px 46px #21181840; font:14px/1.5 system-ui,sans-serif; }
.comment-login::backdrop { background:#231a1a66; }
.comment-login h2 { margin:0; font:650 19px/1.4 system-ui,sans-serif; }
.comment-login header, .comment-login footer { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.comment-login form { margin:0; }
.comment-login label { display:block; margin:12px 0 0; font-weight:600; }
.comment-login input { display:block; box-sizing:border-box; width:100%; margin:5px 0 0; padding:8px 10px; min-height:40px; border:1px solid #ded8d8; border-radius:8px; background:#fff; color:#322b2b; font:16px/1.4 system-ui,sans-serif; }
.comment-login input:focus { outline:2px solid #be3039; outline-offset:1px; }
.comment-login button { border:0; cursor:pointer; font:inherit; }
.comment-login header button { padding:0 6px; background:none; color:#655c5c; font-size:24px; }
.comment-login footer { position:static; margin:0; padding:0; background:none; }
.comment-login footer a { color:#a1242d; }
.comment-login footer button { padding:8px 20px; border-radius:8px; background:#be3039; color:#fff; font-weight:600; }
.comment-login footer button:disabled { opacity:.6; }
.comment-login [role="status"] { min-height:1.5em; margin:8px 0; color:#a22335; }
.comment-login [data-login-verify]:not([hidden]) { display:flex; align-items:end; gap:10px; }
.comment-login [data-login-verify] button { background:none; }

.book-comment-list { margin:10px 0; padding:16px 0; }
.book-comment-list-heading { display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding-inline:clamp(12px, 3vw, 24px); font:13px/1.5 system-ui,sans-serif; color:#6a6262; }
.book-comment-list-heading :is(h1,h2) { margin:0; color:#383131; font-size:17px; font-weight:650; }
.book-comment-list .book-discussion-empty { margin:0; padding:22px 0 16px; text-align:center; }

.mobile-comment-history .comment-history-nav { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); padding-inline:10px; background:#fff; border-bottom:1px solid #ebe7e7; }
.comment-history-nav a { position:relative; display:flex; align-items:center; justify-content:center; gap:4px; min-height:46px; padding:0 3px; color:#655c5c; font:14px/1.25 system-ui,sans-serif; white-space:nowrap; text-decoration:none; }
.comment-history-nav a[aria-current="page"] { color:#b32e36; font-weight:650; }
.comment-history-nav a[aria-current="page"]::after { content:""; position:absolute; inset:auto 24% 0; height:3px; border-radius:2px 2px 0 0; background:#be3039; }
.comment-history-badge { min-width:16px; padding:2px 4px; border-radius:12px; background:#fff0f0; color:#a1242d; text-align:center; font:600 11px/1.1 system-ui,sans-serif; }
.mobile-comment-history .comment-history-panel { min-height:148px; padding-top:4px; margin-bottom:.56rem; }
.mobile-comment-history .comment-history-panel .received-empty { border:0; padding:42px 16px; font:14px/1.5 system-ui,sans-serif; }
@media (max-width:350px) {
    .comment-history-nav a { font-size:13px; gap:3px; }
}

/* Chapter-origin comments and reader composer. */
.chapter-comment-context{margin:6px 0 10px;color:#89919b;font-size:14px;line-height:1.6;overflow-wrap:anywhere}
.chapter-comment-panel{box-sizing:border-box;max-width:950px;margin:22px auto;padding:22px 26px;border:1px solid #e8e8e8;border-radius:8px;background:rgba(255,255,255,.65);font-size:16px;line-height:1.6}
.chapter-comment-heading{font-size:18px;font-weight:600;color:#333}
.chapter-comment-hint{font-size:14px;color:#89919b;margin:6px 0 16px}
.chapter-comment-view{display:inline-block;margin-top:8px;color:#f55;font-size:14px}
.chapter-comment-panel .chapter-comment-view:link,.chapter-comment-panel .chapter-comment-view:visited,.chapter-comment-panel .chapter-comment-view:hover,.chapter-comment-panel .chapter-comment-view:active,.chapter-comment-panel .chapter-comment-view:focus{color:#f55}
.chapter-comment-panel textarea{box-sizing:border-box;width:100%;font-size:16px}
.reader-night .chapter-comment-panel{background:#25282b;border-color:#414448;color:#ccc}
.reader-night .chapter-comment-heading{color:#ddd}
@media(max-width:640px){.chapter-comment-panel{margin:16px 15px;padding:18px 16px}.chapter-comment-context{font-size:14px}}


.chapter-discussion{margin-top:22px;border-top:1px solid #e8e8e8;padding-top:18px}
.chapter-discussion-heading{font-size:16px;font-weight:600;color:#555;margin-bottom:12px}
.chapter-discussion-pager{display:flex;justify-content:center;align-items:center;gap:14px;margin-top:16px;font-size:14px}
.chapter-discussion-pager[hidden]{display:none}
.chapter-discussion-pager button{padding:6px 12px;background:transparent;border:1px solid #ddd;border-radius:5px;color:inherit;cursor:pointer;font:inherit}
.chapter-discussion-pager button:disabled{opacity:.4;cursor:default}

.chapter-comment-context .comment-chapter-link:link,.chapter-comment-context .comment-chapter-link:visited,.chapter-comment-context .comment-chapter-link:hover,.chapter-comment-context .comment-chapter-link:active{color:#f55;text-decoration:none}
