
/* Polish the approved two/three-column community window, not a new layout. */
dialog.community-notifications,dialog.community-messages{width:min(1060px,calc(100vw - 40px));height:min(680px,86dvh);max-height:calc(100dvh - 24px);border-radius:15px;overflow:hidden}
dialog:is(.community-notifications,.community-messages)[open]{display:flex;flex-direction:column}
dialog:is(.community-notifications,.community-messages) .dialog-head{flex:none;min-height:45px;padding:10px 17px}
dialog:is(.community-notifications,.community-messages) .dialog-head h3{font-size:15px;font-weight:650}
dialog:is(.community-notifications,.community-messages) .dialog-body{flex:1;min-height:0;overflow:hidden;max-height:none;padding:12px}
.community-notifications .notice-layout,.community-messages .messages{height:100%;min-height:0;gap:12px}
.community-notifications .notice-layout{grid-template-columns:210px minmax(0,1fr)}
.community-notifications .notice-main,.community-notifications .notice-side{min-height:0}
.community-notifications .notice-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
.community-notifications .notice-side>button{min-height:35px;font-size:12px;border-radius:8px}
.community-notifications .notice-side>button.active,.community-messages .thread.active{background:color-mix(in srgb,var(--accent) 14%,var(--surface));color:var(--text);border:1px solid var(--accent)}
.community-notifications .notice{border:1px solid var(--border);border-radius:8px;margin:5px 0;padding:9px;gap:9px;min-height:70px}
.community-notifications .notice.unread{background:color-mix(in srgb,var(--accent) 8%,var(--surface))}
.community-notifications .notice b,.community-messages .thread b{font-size:13px}
.community-notifications .notice p,.community-notifications .notice small,.community-messages .thread small{font-size:11px}
.community-notifications .notice :is(.avatar,.notice-cover){width:36px;height:40px;object-fit:cover}
.community-messages .thread,.community-messages .member-stats .stat{border-radius:9px;padding:8px}
.community-messages .thread .avatar{width:34px;height:34px}
.community-messages .thread-list,.community-messages .chat,.community-messages .member-panel{min-height:0;min-width:0}
.community-messages .chat-scroll,.community-messages .thread-scroll{min-height:0;overflow:auto;overscroll-behavior:contain}
.community-messages .member-identity>.avatar{width:62px;height:62px}
.community-messages .chat-head{padding-bottom:9px}
.community-messages .bubble{font-size:13px}
.community-messages .chat-composer{gap:7px}
.community-messages .member-panel h3{font-size:13px}
body[data-reader-review=yes] .reader-pages{max-width:min(1100px,100%)!important}
body[data-reader-review=yes] .reader-pages:not(.double) .chapter-image{width:100%;height:auto}
body[data-reader-review=yes] .reader-pages.horizontal-mode:not(.double) .chapter-image{width:auto;height:auto;max-height:calc(100dvh - 135px);max-width:100%}
body[data-reader-review=yes] .reader-pages.horizontal-mode{min-height:0;margin-top:8px;margin-bottom:12px}
@media(min-width:701px){body[data-reader-review=yes] .reader-pages.horizontal-mode:not(.double) .chapter-image{min-height:min(65vh,600px);object-fit:contain}}
@media(max-width:700px){dialog.community-notifications,dialog.community-messages{width:calc(100vw - 20px);height:min(660px,85dvh)}dialog:is(.community-notifications,.community-messages) .dialog-body{padding:8px}.community-notifications .notice-layout{display:flex;flex-direction:column}.community-notifications .notice-side{flex-direction:row;flex-wrap:nowrap;overflow-x:auto;flex-shrink:0}.community-notifications .notice-side>h3,.community-notifications .notice-side>.grow{display:none}.community-notifications .notice-side>button{white-space:nowrap;font-size:10px;min-height:28px}.community-notifications .notice-main{flex:1;min-height:0}.community-messages .messages,.community-messages .messages.member-open{grid-template-columns:1fr}.community-messages .member-panel{padding:5px}.community-messages .chat-composer input{min-width:0}}

/* Community refinement: visible surfaces, compact rhythm, and deliberate transitions. */
#modal:is(.community-notifications,.community-messages){width:min(1040px,calc(100vw - 48px));height:min(620px,82dvh);border-radius:16px;box-shadow:0 24px 80px #0005}
#modal:is(.community-notifications,.community-messages) .dialog-head{padding:9px 15px;min-height:42px;background:linear-gradient(110deg,var(--raised),var(--surface));border-bottom:1px solid var(--border)}
#modal:is(.community-notifications,.community-messages) .dialog-head h3{display:flex;align-items:center;gap:9px;font-size:15px;font-weight:650;letter-spacing:.1px}
.community-title-icon{display:grid;place-items:center;width:26px;height:26px;border-radius:7px;background:var(--accent-soft);color:var(--accent)}.community-title-icon .ic{width:15px;height:15px}
#modal:is(.community-notifications,.community-messages) .dialog-head [data-action=close-modal]{width:29px;min-width:29px;height:29px;border:1px solid var(--border);border-radius:8px}
#modal:is(.community-notifications,.community-messages) .dialog-body{padding:10px;min-height:0}
#modal .notice-layout,#modal .messages{gap:10px}
#modal .notice-side,#modal .thread-list,#modal .member-panel{background:color-mix(in srgb,var(--raised) 55%,var(--surface));border:1px solid var(--border);border-radius:11px;padding:10px}
#modal.community-notifications .notice-side{gap:4px}
#modal.community-notifications .notice-side h3{font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);margin:2px 4px 8px}
#modal.community-notifications .notice-side button{background:transparent;border:1px solid transparent;border-radius:7px;min-height:35px;font-size:12px;gap:6px;padding:6px 8px;transition:background .22s,border-color .22s,transform .22s}
#modal.community-notifications .notice-side button.active{background:var(--accent-soft);border-color:color-mix(in srgb,var(--accent) 65%,transparent);color:var(--text)}
#modal.community-notifications .notice-side button small{font-size:10px;border-radius:10px;background:var(--raised);padding:2px 5px;color:var(--muted)}
#modal.community-notifications .notice-side button.active small{color:var(--accent)}
#modal.community-notifications .notice-main>.row{background:var(--raised);border:1px solid var(--border);padding:5px 8px;border-radius:9px;gap:5px}
#modal.community-notifications .notice-main .subtabs{gap:3px;margin:0}
#modal.community-notifications .notice-main .subtabs button{padding:5px 8px;font-size:11px;min-height:27px;border-radius:6px}
#modal.community-notifications .notice-main .subtabs button.active{background:var(--accent-soft);color:var(--accent);border-bottom-color:transparent}
#modal.community-notifications .notice-main select{min-height:28px;font-size:11px;padding:4px 8px;border-radius:7px}
#modal.community-notifications .notice-date{display:flex;align-items:center;gap:8px;font-size:10px;letter-spacing:.3px;margin:8px 2px 5px;color:var(--muted)}
#modal.community-notifications .notice-date:after{content:'';height:1px;flex:1;background:var(--border)}
#modal.community-notifications .notice{position:relative;border:1px solid var(--border);border-radius:9px;background:var(--surface);margin:5px 0;padding:9px 10px;gap:9px;min-height:78px;transition:background .24s,border-color .24s,transform .24s}
#modal.community-notifications .notice.unread{background:color-mix(in srgb,var(--accent) 7%,var(--raised));border-inline-start:3px solid var(--accent)}
#modal.community-notifications .notice .grow{display:grid;gap:3px}
#modal.community-notifications .notice .row{gap:5px}
#modal.community-notifications .notice .row :is(a,button){font-size:11px;padding:4px 7px;border:1px solid var(--border);border-radius:6px;line-height:1.2;min-height:23px}
#modal.community-notifications .notice .row a{background:var(--accent-soft);color:var(--accent);border-color:transparent}
#modal.community-messages .messages{grid-template-columns:218px minmax(0,1fr)}
#modal.community-messages .messages.member-open{grid-template-columns:205px minmax(0,1fr) 190px}
#modal.community-messages .thread-list{gap:8px;grid-template-rows:auto auto auto minmax(0,1fr)}
#modal.community-messages .friend-strip{justify-content:flex-start;gap:6px;padding:3px 0}
#modal.community-messages .friend-strip .avatar{width:32px;height:32px}
#modal.community-messages .friend-dot{padding:2px;border-radius:50%}
#modal.community-messages #chat-search{font-size:12px;min-height:32px;border-radius:8px;padding:6px 8px}
#modal.community-messages [data-action=requests]{font-size:11px;min-height:31px;border-radius:8px}
#modal.community-messages .thread{border:1px solid transparent;background:transparent;border-radius:8px;min-height:53px;padding:7px;gap:7px;transition:background .22s,border-color .22s,transform .22s}
#modal.community-messages .thread.active{border-color:color-mix(in srgb,var(--accent) 60%,transparent);background:var(--accent-soft);color:var(--text)}
#modal.community-messages .thread .grow{min-width:0}
#modal.community-messages .thread b{font-size:12px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#modal.community-messages .thread small{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#modal.community-messages .chat{border:1px solid var(--border);border-radius:11px;padding:0;gap:0;overflow:hidden;background:var(--bg);min-height:0}
#modal.community-messages .chat-head{padding:9px 10px;background:var(--surface);gap:8px}
#modal.community-messages .chat-head .avatar{width:34px;height:34px}
#modal.community-messages .chat-head b{font-size:13px}
#modal.community-messages .chat-head small{font-size:11px;color:var(--muted)}
#modal.community-messages .chat-scroll{padding:10px;scrollbar-width:thin}
#modal.community-messages .bubble{border:1px solid var(--border);border-radius:12px 12px 12px 4px;padding:8px 11px;margin:6px 0;font-size:12px}
#modal.community-messages .bubble.mine{background:color-mix(in srgb,var(--accent) 23%,var(--raised));border-color:color-mix(in srgb,var(--accent) 40%,var(--border));border-radius:12px 12px 4px 12px}
[dir=rtl] #modal.community-messages .bubble{border-radius:12px 12px 4px 12px}[dir=rtl] #modal.community-messages .bubble.mine{border-radius:12px 12px 12px 4px}
#modal.community-messages .bubble-time{font-size:9px}
#modal.community-messages .chat-composer{background:var(--surface);padding:7px;gap:5px;border-top:1px solid var(--border)}
#modal.community-messages .chat-composer input{border-radius:9px;font-size:12px;min-height:34px}
#modal.community-messages .chat-composer button{width:30px;height:30px;min-width:30px;border-radius:8px;padding:4px}
#modal.community-messages .member-panel{gap:8px;text-align:center}
#modal.community-messages .member-panel h3{font-size:12px}
#modal.community-messages .member-panel .member-identity{gap:5px}
#modal.community-messages .member-panel .member-identity>.avatar{width:56px;height:56px}
#modal.community-messages .member-stats{gap:6px}
#modal.community-messages .member-stats .stat{font-size:10px;background:var(--surface);border:1px solid var(--border);padding:8px 4px}
#modal.community-messages .member-stats .stat b{font-size:17px}
#modal.community-messages .member-panel [data-action=public-profile]{margin-top:auto;font-size:11px;min-height:31px}
@media(hover:hover){#modal.community-messages .thread:hover,#modal.community-notifications .notice-side button:hover{background:var(--raised);transform:translateY(-1px)}#modal.community-notifications .notice:hover{border-color:color-mix(in srgb,var(--accent) 35%,var(--border))}}
#modal.community-notifications .notice-scroll,#modal.community-messages .chat-scroll,#modal.community-messages .thread-scroll{scrollbar-width:thin}
@media(max-width:700px){
#modal:is(.community-notifications,.community-messages){width:min(350px,calc(100vw - 24px));height:min(520px,72dvh);max-height:calc(100dvh - 24px);border-radius:12px}
#modal:is(.community-notifications,.community-messages) .dialog-head{min-height:36px;padding:6px 9px}
#modal:is(.community-notifications,.community-messages) .dialog-head h3{font-size:13px}
#modal:is(.community-notifications,.community-messages) .dialog-body{padding:6px}
#modal.community-messages :is(.messages,.messages.member-open){grid-template-columns:minmax(0,1fr);gap:6px}
#modal.community-messages :is(.thread-list,.member-panel){padding:7px}
#modal.community-messages .member-panel{width:min(240px,100%);margin-inline:auto}
#modal.community-messages .thread{min-height:45px;padding:5px}
#modal.community-messages .thread .avatar{width:29px;height:29px}
#modal.community-messages .chat-head{padding:6px 7px}
#modal.community-messages .chat-head .avatar{width:28px;height:28px}
#modal.community-messages .chat-scroll{padding:6px}
#modal.community-messages .chat-composer{padding:5px;gap:3px}
#modal.community-messages .chat-composer input{min-height:32px;font-size:11px}
#modal.community-messages .chat-composer button{width:27px;min-width:27px;height:30px}
#modal.community-notifications .notice-layout{gap:6px}
#modal.community-notifications .notice-side{padding:4px;gap:3px;border-radius:7px}
#modal.community-notifications .notice-side button{font-size:10px;min-height:25px;padding:3px 6px;white-space:nowrap}
#modal.community-notifications .notice-main>.row{padding:4px;gap:3px}
#modal.community-notifications .notice-main .subtabs button{font-size:10px;padding:4px 5px}
#modal.community-notifications .notice{min-height:64px;padding:6px;gap:6px}
#modal.community-notifications .notice b{font-size:11px}
#modal.community-notifications .notice p,#modal.community-notifications .notice small{font-size:10px}
#modal.community-notifications .notice :is(.avatar,.notice-cover){width:28px;height:32px}
#modal.community-notifications .notice .row :is(a,button){font-size:10px;min-height:21px;padding:3px 5px}
}
/* Reading area is enlarged independently of the compact navigation controls. */
body[data-reader-review=yes] .reader-pages{max-width:min(1280px,100%)!important}
body[data-reader-review=yes] .reader-pages.horizontal-mode{min-height:0;margin:4px auto 10px}
body[data-reader-review=yes] .reader-pages.horizontal-mode .chapter-image{max-height:calc(100dvh - 90px)!important;object-fit:contain}
body[data-reader-review=yes].focus .reader-pages.horizontal-mode .chapter-image{max-height:100dvh!important}
body[data-reader-review=yes] .reader-controls{width:min(780px,var(--reading-width,780px),calc(100vw - 18px));min-height:36px;height:36px;gap:9px;padding:3px 9px;bottom:10px}
body[data-reader-review=yes] .reader-controls .reader-quick-actions{gap:8px}
body[data-reader-review=yes] .reader-controls .reader-tool{height:26px;width:26px;min-width:26px}
body[data-reader-review=yes] .reader-controls .reader-page-count{padding:3px 7px;min-width:40px;font-size:11px}
body[data-reader-review=yes] .reader-controls input[type=range]{flex:1 1 140px;max-width:265px;height:12px;margin-inline:auto;padding:0 4px}
body[data-reader-review=yes] .reader-controls input[type=range]::-webkit-slider-thumb{width:12px;height:12px;margin-top:-2px}
body[data-reader-review=yes] .reader-controls input[type=range]::-moz-range-thumb{width:12px;height:12px}
body[data-reader-review=yes][data-in-reading=false] :is(.reader-floating,.reader-speed,.reader-controls){visibility:hidden!important;pointer-events:none!important}
body[data-reader-review=yes][data-in-reading=false] .reader-bar{opacity:0!important;pointer-events:none!important}
@media(max-width:700px){body[data-reader-review=yes] .reader-controls{width:calc(100vw - 18px);height:34px;min-height:34px;gap:4px;padding:3px 6px}body[data-reader-review=yes] .reader-controls .reader-quick-actions{gap:3px}body[data-reader-review=yes] .reader-controls .reader-tool{width:23px;min-width:23px;height:25px}body[data-reader-review=yes] .reader-controls input[type=range]{max-width:105px;min-width:30px;flex:1 1 60px}body[data-reader-review=yes] .reader-controls .reader-page-count{min-width:35px;font-size:10px;padding:3px 5px}}
@media(prefers-reduced-motion:reduce){#modal.community-notifications *,#modal.community-messages *{animation:none!important;transition:none!important}}

/* Finish the compact notification dropdown and mobile member pane. */
#modal.fox-notice-menu .fox-notice-toolbar{background:var(--raised);border-radius:7px;padding:4px;margin-bottom:3px}
#modal.fox-notice-menu .fox-notice-scroll .notice{border:1px solid var(--border);border-radius:7px;margin:4px 0;padding:6px!important}
#modal.fox-notice-menu .fox-notice-scroll .notice.unread{border-inline-start:2px solid var(--accent);background:color-mix(in srgb,var(--accent) 8%,var(--raised))}
#modal.fox-notice-menu .fox-notice-scroll .notice-date{font-size:10px;padding:3px 2px}
#modal.fox-notice-menu .review-notice-footer{border-top:1px solid var(--border);padding:3px 0 0}
@media(max-width:700px){
#modal.community-messages:has(.messages.member-open){width:min(278px,calc(100vw - 24px));height:auto;max-height:min(420px,80dvh)}
#modal.community-messages:has(.messages.member-open) .dialog-body{flex:0 1 auto;min-height:0;overflow:auto}
#modal.community-messages .messages.member-open{height:auto;min-height:0}
#modal.community-messages .member-panel{width:100%;gap:7px;padding:8px;max-height:calc(80dvh - 50px)}
#modal.community-messages .member-panel [data-action=public-profile]{margin-top:6px}
#modal.community-messages .member-panel .member-identity>.avatar{width:44px;height:44px}
#modal.community-messages .member-panel h4{font-size:11px;margin:3px 0}
#modal.community-messages .member-panel .row .avatar{width:27px;height:27px}
}
/* Honor explicit fit settings after enlarging the default reading area. */
body[data-reader-review=yes] .reader-pages[data-fit="Fit Page"] .chapter-image{width:auto;max-height:calc(100dvh - 90px);max-width:100%}
body[data-reader-review=yes] .reader-pages[data-fit="Original"] .chapter-image{width:auto;max-width:100%}
