/* Rellawings community/studio extensions; color and typography inherit from site.css */
.account-nav{gap:.75rem}.account-nav a{white-space:nowrap}.nav-count{display:inline-block;background:var(--accent);color:#211a2b;border-radius:50%;font-size:.65rem;padding:0 .4em;line-height:1.5}.hero-art>a{display:contents}.hero-art>a img{flex-shrink:0}.hero-art>a:hover img{filter:brightness(1.12)}
.hero-art>a:first-child img{transform:rotate(-11deg) translate(20px,10px)}.hero-art>a:nth-child(2) img{width:39%;z-index:2;position:relative;transform:translateY(-8px)}.hero-art>a:last-child img{transform:rotate(10deg) translate(-20px,10px)}.hero-copy .btn{margin:.35rem .5rem .35rem 0}
.profile-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:1.4rem;align-items:start}.profile-sidebar{position:sticky;top:110px}.profile-sidebar form{margin:0 0 .8rem}.profile-sidebar .btn{margin-bottom:.7rem}.profile-sidebar h1{font-size:1.5rem;margin:.6rem 0}.profile-avatar{width:112px;height:112px;object-fit:cover;background:var(--raised);border-radius:12px;border:1px solid var(--border)}.profile-bio{margin:1rem 0 0;border-top:1px solid var(--border);padding-top:1rem;white-space:normal;overflow-wrap:anywhere}.profile-main{display:grid;gap:1.4rem;min-width:0}.mini-book-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:1rem}.mini-book-grid a{display:flex;flex-direction:column;gap:.5rem;font-size:.83rem}.mini-book-grid img{width:100%;max-width:160px;aspect-ratio:2/3;object-fit:cover;border-radius:7px}.community-form,.community-form label{display:flex;flex-direction:column;gap:.5rem}.community-form textarea{width:100%}.community-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:.5rem}.wall-post{border-top:1px solid var(--border);padding:1.3rem .3rem;overflow-wrap:anywhere}.wall-post p{margin:0 0 .6rem}.wall-post>a,.wall-post p>a{color:var(--accent);font-weight:700}.wall-post small{margin-left:.5rem}.wall-post details{padding:.5rem;background:var(--raised)}
.mail-list-item,.alert-line{display:grid;grid-template-columns:minmax(150px,1fr) 160px 180px;gap:.8rem;padding:.85rem 1rem;border-bottom:1px solid var(--border);align-items:center}.alert-line{display:block}.mail-list-item.unread,.alert-line.unread{background:#352c40}.mail-list-item small,.alert-line small{color:var(--muted);font-weight:400}.mail-body{white-space:normal;line-height:1.8;padding:2rem 0;border-block:1px solid var(--border);margin-bottom:1.5rem;overflow-wrap:anywhere}
.feature-picker{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:1rem;margin:1.2rem 0}.feature-picker label{border:1px solid var(--border);border-radius:9px;padding:.7rem;display:grid;grid-template-columns:1.2rem 54px 1fr;gap:.6rem;align-items:center;font-size:.85rem;font-weight:500;cursor:pointer}.feature-picker img{width:54px;aspect-ratio:2/3;object-fit:cover;border-radius:4px}.studio-shortcuts{margin-top:1.2rem}.studio-shortcuts .btn{margin:.25rem}
.sortable-chapters{list-style:none;padding:0;margin:1rem 0;max-width:960px}.sortable-chapters li{display:flex;align-items:center;gap:.8rem;border:1px solid var(--border);padding:.7rem .8rem;margin:.4rem 0;background:var(--surface);border-radius:8px}.sortable-chapters li.dragging{opacity:.55;border-style:dashed}.sortable-chapters li:hover{border-color:var(--accent-deep)}.sortable-chapters .drag-handle{font-size:1.2rem;cursor:grab;user-select:none}.sortable-chapters .sort-title{flex:1;min-width:0}.sortable-chapters small{margin-left:.4rem}.sortable-chapters button{min-width:2.4rem}.stats-table{width:100%;border-collapse:collapse}.stats-table th,.stats-table td{border-bottom:1px solid var(--border);padding:.75rem;text-align:left}.stats-table th{color:var(--muted)}.traffic-chart{display:flex;align-items:flex-end;gap:.2rem;overflow-x:auto;min-height:200px;margin:1.4rem 0}.traffic-chart .bar-group{display:flex;flex-direction:column;justify-content:end;align-items:center;gap:.4rem;min-width:34px}.traffic-chart .bar-group span{display:block;background:#8d6faf;width:65%;min-height:2px;border-radius:3px 3px 0 0}.traffic-chart small{font-size:.62rem;white-space:nowrap}
.chapter-poll{max-width:var(--content-width,740px);margin:2.2rem auto;padding:1.3rem 1.5rem;background:var(--surface);border:1px solid var(--border);border-radius:10px;color:var(--text)}.chapter-poll h2{font-size:1.3rem}.chapter-poll h3{font-size:1.1rem;font-family:inherit;text-align:left}.chapter-poll label{display:flex;flex-direction:row;align-items:center;font-weight:500;gap:.7rem;margin:.8rem 0}.chapter-poll .btn{margin-top:.65rem}.poll-option{display:grid;grid-template-columns:1fr auto;gap:.4rem;margin:1rem 0}.poll-track{grid-column:1/-1;height:.65rem;border-radius:12px;background:var(--raised);overflow:hidden}.poll-track i{display:block;height:100%;background:var(--accent);border-radius:12px}
.search-book{display:flex;gap:.7rem;max-width:100%;margin-bottom:1.3rem}.search-book input{flex:1;min-width:0}.search-hit{padding:1rem 0;border-bottom:1px solid var(--border)}.search-hit a{color:var(--accent);font-weight:700}.search-hit p{margin:.4rem 0;color:var(--muted)}.chapter-search-link{text-align:center;margin:1rem auto 2rem}.selection-actions{position:absolute;z-index:40;display:flex;gap:.2rem;padding:.35rem;background:#1d2028;color:#fff;border:1px solid #59505f;box-shadow:0 12px 30px #0008;border-radius:8px;max-width:310px}.selection-actions[hidden]{display:none}.selection-actions button{color:#fff;border:0;background:transparent;padding:.4rem .55rem;cursor:pointer;font-size:.8rem}.selection-actions button:hover{background:#3b3b4b}
.rich-editor-shell{position:relative;border:1px solid var(--border);border-radius:10px;overflow:visible;background:var(--surface);min-width:0}.rich-toolbar{display:flex;flex-wrap:wrap;gap:.28rem;background:#161a20;padding:.6rem;position:sticky;top:83px;z-index:8;border-bottom:1px solid var(--border);align-items:center}.rich-toolbar .compact{font-size:.72rem;background:#272d37;padding:.35rem .5rem;min-height:30px}.rich-toolbar .compact:hover,.rich-toolbar .compact:focus{background:#4b435a}.rich-toolbar select{padding:.32rem;width:auto;min-width:120px;font-size:.82rem}.rich-status{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.7rem;color:var(--muted);font-size:.78rem;padding:.5rem .85rem;border-top:1px solid var(--border)}#rich-content{min-height:520px;max-height:780px;overflow-y:auto;padding:2rem max(1.2rem,7%);outline:0;color:#e9e6e2;background:#20252b;font:17px/1.85 Georgia,'Times New Roman',serif;overflow-wrap:break-word;white-space:normal}#rich-content:focus-visible{outline:2px solid var(--accent-deep);outline-offset:-2px}#rich-content img{display:block;max-width:100%;height:auto;margin:1rem auto}#rich-content p{line-height:inherit}#rich-content h1,#rich-content h2,#rich-content h3{text-align:inherit}#rich-content blockquote{border-left:3px solid var(--accent-deep);padding:.5rem 1rem;background:#292c33}#rich-content table,.chapter-prose table{border-collapse:collapse;max-width:100%;width:auto;display:block;overflow:auto;margin:1rem auto}#rich-content td,#rich-content th,.chapter-prose td,.chapter-prose th{border:1px solid #777;padding:.5rem;min-width:54px}#rich-content td:focus{outline:1px solid var(--accent)}.rich-source{display:block!important;width:100%;border:0;min-height:530px;max-height:70vh;padding:1.3rem;font:13px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;resize:vertical;background:#171b23;color:#d6e6df}.rich-source[hidden]{display:none!important}#rich-content[hidden]{display:none}.rich-fullscreen{position:fixed;z-index:500;inset:0;border-radius:0;background:var(--surface);display:flex;flex-direction:column}.rich-fullscreen .rich-toolbar{top:0;position:relative;flex-shrink:0}.rich-fullscreen #rich-content,.rich-fullscreen .rich-source{height:100%;max-height:none;min-height:0;flex:1}.rich-fullscreen .rich-status{flex-shrink:0}.rich-table-grid{position:absolute;z-index:30;max-width:290px;background:#272b34;color:#fff;border:1px solid #888;border-radius:8px;padding:1rem;box-shadow:0 15px 30px #000a}.rich-table-grid p{margin-bottom:.7rem}.table-grid-cells{display:grid;grid-template-columns:repeat(10,18px);gap:3px}.table-grid-cells button{background:#404855;border:1px solid #777;width:18px;height:18px;padding:0;border-radius:2px;cursor:pointer}.table-grid-cells button.selected,.table-grid-cells button:hover{background:#bd9ee1}.rich-editor-shell:has(.rich-fullscreen){z-index:500}
.chapter-prose details.chapter-spoiler,#rich-content details.chapter-spoiler{border:1px solid var(--reader-edge,#64646c);border-radius:8px;background:color-mix(in srgb,var(--reader-card,#222),white 6%);padding:1rem;margin:1.3rem 0}.chapter-spoiler summary{cursor:pointer;font-family:system-ui;font-size:.82em;font-weight:700}.chapter-prose aside,#rich-content aside{margin:1.25rem 0;border-left:4px solid #a78cc0;padding:1rem 1.25rem;background:color-mix(in srgb,var(--reader-card,#222),white 5%)}.chapter-prose .chapter-announcement,#rich-content .chapter-announcement{border-color:#5585b2}.chapter-prose .chapter-author-note,#rich-content .chapter-author-note{border-color:#d4b68e}.chapter-prose .chapter-litrpg,#rich-content .chapter-litrpg{border:1px solid #797ea5;border-radius:9px;background:color-mix(in srgb,var(--reader-card,#222),#504d86 22%);font-family:system-ui}.chapter-prose .chapter-align-center{text-align:center}.chapter-prose .chapter-align-left{text-align:left}.chapter-prose .chapter-align-right{text-align:right}.chapter-prose .chapter-align-justify{text-align:justify}.chapter-prose figure{text-align:center;margin:2rem auto}.chapter-prose figure img{margin:auto}.chapter-prose .chapter-illustration{display:block;margin:1rem auto}.chapter-prose pre{white-space:pre-wrap}.chapter-prose li{margin-bottom:.25em}
@media(max-width:1050px){.account-nav{flex-wrap:wrap;justify-content:flex-end}.head-inner{gap:.8rem;flex-wrap:wrap}.main-nav{order:3;width:100%;justify-content:center;flex-wrap:wrap}.rich-toolbar{top:0}}
@media(max-width:720px){.profile-layout{grid-template-columns:1fr}.profile-sidebar{position:static}.mail-list-item{grid-template-columns:1fr;gap:.15rem}.hero-art{padding:0}.hero-art>a img{max-height:200px}.rich-toolbar{max-height:35vh;overflow-y:auto}.search-book{flex-direction:column}.feature-picker{grid-template-columns:repeat(2,minmax(0,1fr))}.feature-picker label{grid-template-columns:20px 1fr}.feature-picker label span{grid-column:1/-1}}
.cover-preview{display:flex;align-items:center;gap:1.5rem;padding:1rem;border:1px solid var(--border);border-radius:9px;margin:1rem 0}.cover-preview img{max-height:180px;max-width:140px;object-fit:contain}.wall-post.wall-reply{margin-left:1.3rem;padding-left:1.1rem;border-left:3px solid var(--accent-deep)}.wall-reply-form{margin:.7rem 0}.wall-reply-form summary{cursor:pointer;color:var(--accent);font-size:.86rem}.wall-reply-form form{margin-top:.5rem}.wall-reply-form textarea{width:100%}
.author-links{color:var(--muted);font-size:.85rem;margin-top:-.35rem}.author-links a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}
.rich-toolbar button[data-rich-tool="spoiler"]{background:#753244;color:#fff;border-color:#a85b72}.rich-toolbar button[data-rich-tool="announcement"]{background:#254d65;color:#fff}.rich-toolbar button[data-rich-tool="author-note"]{background:#554b37;color:#fff}
.rich-image-dialog{max-width:min(610px,94vw);width:100%;max-height:88vh;overflow-y:auto;border:1px solid var(--border);border-radius:14px;padding:1.6rem;background:var(--surface);color:var(--text);box-shadow:0 20px 80px #000b}.rich-image-dialog::backdrop{background:#000a}.rich-image-dialog label{margin-bottom:1rem}.rich-image-dialog .image-dialog-fields{display:grid;grid-template-columns:1fr 1fr;gap:.7rem}.rich-image-dialog details{margin:1rem 0}.rich-image-dialog summary{cursor:pointer;font-weight:700;margin-bottom:.8rem}.image-dialog-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:.5rem}
/* Rescue patch: feedback and robust alignment for imported manuscript blocks. */
.editor-save-message{min-height:1.5em;margin:.6rem 0;color:var(--accent,#c3a0eb);font-size:.9rem;overflow-wrap:anywhere}
#safe-preview-panel[hidden]{display:none!important}
#safe-preview-panel{margin-top:1.5rem;scroll-margin-top:5rem}
#safe-preview-panel .chapter-prose{margin-inline:auto;max-width:min(100%,850px)}
#rich-content [style*="text-align:justify"],#safe-preview-panel .chapter-prose [style*="text-align:justify"],.chapter-prose [style*="text-align:justify"]{text-align:justify;}
#rich-content [style*="text-align:center"],#safe-preview-panel .chapter-prose [style*="text-align:center"],.chapter-prose [style*="text-align:center"]{text-align:center;}

/* Studio toolbar layout: two deliberate, consistent Scribble Hub-like rows. */
.rich-toolbar{display:flex;flex-direction:column;align-items:stretch;gap:0;padding:0;background:#171b1d;overflow:visible}
.rich-toolbar-row{display:flex;align-items:center;flex-wrap:wrap;gap:3px;padding:7px 8px;min-height:42px}
.rich-toolbar-row + .rich-toolbar-row{border-top:1px solid #303942}
.rich-toolbar .rt-button{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:2px;width:34px;height:32px;min-width:34px;min-height:32px;padding:3px!important;border:1px solid transparent;border-radius:3px;background:transparent;color:#cfdae3;font-family:Arial,sans-serif;font-size:16px;line-height:1;white-space:nowrap;cursor:pointer}
.rich-toolbar .rt-button:hover,.rich-toolbar .rt-button:focus-visible{background:#374754;border-color:#586879;color:#fff;outline:none}
.rich-toolbar .rt-button:active{background:#455f74}
.rich-toolbar .rt-button strong{font-size:17px}.rich-toolbar .rt-button em{font-family:Georgia,serif;font-size:19px}.rich-toolbar .rt-button u{font-family:Georgia,serif;font-size:17px}.rich-toolbar .rt-button s{font-size:12px}.rich-toolbar .rt-icon{width:20px;height:20px;flex:none}
.rich-toolbar select[data-rich-tool="block"]{margin-right:4px;min-height:34px;min-width:140px;padding:5px 24px 5px 10px;font-size:13px;border:1px solid #465461;border-radius:3px;background:#f5f6f7;color:#25313d}
.rich-toolbar .rt-glyph{font-family:Georgia,'Times New Roman',serif;font-size:20px;line-height:1}.rich-toolbar .rt-quote{font-size:25px}.rich-toolbar .rt-code{font:700 11px/1 ui-monospace,monospace}.rich-toolbar .rt-color{border-bottom:2px solid #caa2e7;font-weight:700}
.rich-toolbar .rt-mark{display:inline-flex;align-items:center;justify-content:center;width:22px;min-height:22px;border-radius:3px;background:#d23e55;color:#fff;font-family:Georgia,serif;font-weight:700;font-size:17px}
.rich-toolbar .rt-announcement .rt-mark{font-family:Arial,sans-serif;font-size:7px;letter-spacing:-.5px;background:#eee;color:#d14f45}
.rich-toolbar .rt-footnote .rt-glyph{font-size:18px;color:#ceddf1}.rich-toolbar .rt-footnote sup{font-size:10px;color:#a3cafa}
.rich-toolbar .rt-spoiler,.rich-toolbar .rt-announcement,.rich-toolbar .rt-author-note{background:transparent!important}
.rich-toolbar .rt-spoiler:hover,.rich-toolbar .rt-announcement:hover,.rich-toolbar .rt-author-note:hover{background:#374754!important}
.rich-toolbar .rt-author-note .rt-glyph{color:#e3b86d}.rich-toolbar .rt-litrpg .rt-glyph{color:#b0b5ba}
.comment-text img.emoji,.wall-post img.emoji{display:inline-block!important;width:auto!important;height:24px!important;max-width:30px!important;vertical-align:-6px;margin:0 2px;border:0;object-fit:contain}
@media(max-width:720px){.rich-toolbar{max-height:40vh;overflow-y:auto}.rich-toolbar-row{padding:5px;gap:2px}.rich-toolbar .rt-button{width:32px;min-width:32px}.rich-toolbar select[data-rich-tool="block"]{min-width:125px}}

/* Chapter studio table toolkit. No third-party assets or libraries. */
.rw-table-menu{position:fixed;z-index:710;background:#20252c;border:1px solid #45515e;color:#d9e4ed;min-width:240px;max-width:min(300px,95vw);padding:5px 0;box-shadow:0 14px 36px #000a;font:15px/1.4 system-ui,-apple-system,sans-serif;border-radius:5px}
.rw-table-menu button{font:inherit;color:inherit;cursor:pointer;text-align:left}
.rw-table-menu>button,.rw-table-branch>button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:9px 16px;border:0;background:transparent;min-height:36px}
.rw-table-menu button:hover,.rw-table-menu button:focus-visible,.rw-table-branch.open>button{background:#176a99;color:white;outline:0}
.rw-table-divider{border-top:1px solid #38424c;margin:4px 0}
.rw-table-branch{position:relative}
.rw-table-submenu{display:none;position:absolute;top:-5px;left:100%;min-width:260px;max-width:min(330px,95vw);background:#20252c;border:1px solid #45515e;padding:5px 0;box-shadow:0 12px 30px #0009;z-index:2}
.rw-table-branch.open>.rw-table-submenu{display:block}
.rw-table-submenu.open-left{left:auto;right:100%}
.rw-table-submenu [data-table-action]{display:block;border:0;padding:9px 13px;min-height:36px;background:transparent;width:100%;white-space:normal}
.rw-table-grid{display:grid;grid-template-columns:repeat(10,20px);gap:2px;padding:7px 12px 5px}
.rw-table-grid button{width:20px;height:20px;min-width:20px;min-height:20px;padding:0;border:1px solid #75828f!important;background:#141a20!important;border-radius:1px}
.rw-table-grid button.selected,.rw-table-grid button:hover,.rw-table-grid button:focus-visible{background:#a5cbec!important;border-color:#f3f9ff!important}
.rw-table-size{font-size:12px;color:#b7c6d5;text-align:center;padding:3px 8px 7px}
.rw-table-dialog{width:min(610px,95vw);max-height:90vh;overflow:auto;border:1px solid #566575;border-radius:10px;background:#20272e;color:#e7edf3;padding:0;box-shadow:0 24px 65px #000b}
.rw-table-dialog::backdrop{background:#05080dc4}
.rw-table-form{margin:0}
.rw-table-dialog-head{display:flex;justify-content:space-between;align-items:center;padding:12px 20px;background:#171d23;gap:12px}
.rw-table-dialog-head h2{font:600 20px/1.3 system-ui,sans-serif;margin:0}
.rw-table-x{border:0;background:transparent;color:#e5edf5;font-size:26px;cursor:pointer;padding:0 6px}
.rw-table-tabs{display:flex;gap:0;border-bottom:1px solid #49545f}
.rw-table-tabs button{background:#222a33;color:#d9e4f1;border:0;border-right:1px solid #3c4852;font:600 15px system-ui;padding:12px 22px;cursor:pointer}
.rw-table-tabs button[aria-selected=true]{background:#314d61;box-shadow:inset 0 -3px #60b8f0}
.rw-table-tab{padding:20px}
.rw-table-tab[hidden]{display:none}
.rw-table-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.rw-table-fields label{display:flex;flex-direction:column;gap:6px;font:500 14px/1.35 system-ui;color:#d8e1eb;margin:0}
.rw-table-fields label:has(input[type=checkbox]){flex-direction:row;align-items:center;align-self:end;gap:9px}
.rw-table-fields input:not([type=checkbox]),.rw-table-fields select{display:block;width:100%;min-width:0;min-height:40px;margin:0;padding:7px 10px;color:#18202b;background:#f7f8fa;border:1px solid #92a0ab;border-radius:4px;font:15px/1.3 system-ui}
.rw-table-fields input[type=color]{padding:4px;max-width:140px}
.rw-table-fields input[type=checkbox]{width:auto;min-height:0}
.rw-table-span{grid-column:1/-1}
.rw-table-hint{font:13px/1.5 system-ui;color:#c5d1db;margin:14px 0 0}
.rw-table-dialog-actions{display:flex;justify-content:flex-end;gap:10px;padding:14px 20px;border-top:1px solid #48525e}
.rw-editing-fullscreen{overflow:hidden}
#rich-content table,.chapter-prose table{display:table;overflow:visible;border-collapse:collapse;max-width:100%;width:100%;table-layout:auto}
#rich-content table td,#rich-content table th,.chapter-prose table td,.chapter-prose table th{min-width:0;overflow-wrap:anywhere;vertical-align:top}
#rich-content table caption,.chapter-prose table caption{caption-side:top;font:600 14px/1.5 system-ui;margin-bottom:8px}
@media(max-width:690px){.rw-table-menu{left:8px!important;top:80px!important}.rw-table-submenu,.rw-table-submenu.open-left{left:0;right:auto;top:100%;max-height:45vh;overflow-y:auto}.rw-table-fields{grid-template-columns:1fr}.rw-table-grid{grid-template-columns:repeat(10,18px)}.rw-table-grid button{width:18px;height:18px;min-width:18px;min-height:18px}}
/* Show table icon and caret as one split control, as in the requested editor reference. */
.rich-toolbar .rt-button.rt-table{border-top-right-radius:0;border-bottom-right-radius:0;margin-right:0}
.rich-toolbar .rt-button.rt-table-menu{width:19px;min-width:19px;margin-left:-3px;border-left:1px solid #56616c;border-top-left-radius:0;border-bottom-left-radius:0}
.rich-toolbar .rt-button.rt-table-menu .rt-glyph{font-size:16px}

/* FIX 2026-10-31: One connected Table + caret button. No orphan arrow/popover. */
.rich-toolbar .rt-button.rt-table-toggle{display:inline-flex!important;align-items:stretch!important;gap:0!important;min-width:49px!important;width:49px!important;height:33px!important;padding:0!important;border:1px solid #566575!important;border-radius:4px!important;background:#252e38!important;overflow:hidden}
.rich-toolbar .rt-button.rt-table-toggle:hover,.rich-toolbar .rt-button.rt-table-toggle[aria-expanded="true"]{background:#335976!important;border-color:#8fa8bf!important}
.rich-toolbar .rt-table-symbol{display:flex;align-items:center;justify-content:center;flex:1;min-width:29px}
.rich-toolbar .rt-table-symbol .rt-icon{width:21px;height:21px}
.rich-toolbar .rt-table-chevron{display:flex;align-items:center;justify-content:center;width:18px;flex:0 0 18px;border-left:1px solid #566575;font-size:12px;color:#dce5ed}
