/* Rellawings v80.8.108 — scoped Light / Sepia parity and My Page backdrop boundary.
   Load after v107 cosmetics and existing studio/editor assets. No Dark-mode changes
   except restricting selected profile wallpaper to the actual main page surface. */

/* A member's chosen wallpaper belongs to <main> only. The global header/footer,
   other pages, and modal overlays continue to use the visitor's chosen site theme.
   Full-bleed main padding preserves the original 1160px shell's usable 1112px width. */
body:has(.profile-v4:is(.rw8105-backdrop-moonlit,.rw8105-backdrop-softlight,.rw8105-backdrop-celestial)){
  background-image:none!important;
  background-color:var(--bg)!important;
  background-attachment:scroll!important;
}
body .site-main:has(.profile-v4:is(.rw8105-backdrop-moonlit,.rw8105-backdrop-softlight,.rw8105-backdrop-celestial)){
  max-width:none;
  width:100%;
  box-sizing:border-box;
  padding-inline:max(1.5rem,calc((100vw - (var(--page-width) - 3rem))/2));
  background-color:#17152a;
  background-position:center top;
  background-size:cover;
  background-repeat:no-repeat;
}
body .site-main:has(.profile-v4.rw8105-backdrop-moonlit){
  background-image:linear-gradient(90deg,rgba(13,15,29,.27),rgba(13,15,29,.04) 35%,rgba(13,15,29,.04) 65%,rgba(13,15,29,.27)),url('/assets/my-page-wallpaper-moonlit-v80_8_106.webp');
}
body .site-main:has(.profile-v4.rw8105-backdrop-softlight){
  background-color:#524d80;
  background-image:linear-gradient(90deg,rgba(19,20,39,.14),transparent 35%,transparent 65%,rgba(19,20,39,.14)),url('/assets/my-page-wallpaper-softlight-v80_8_106.webp');
}
body .site-main:has(.profile-v4.rw8105-backdrop-celestial){
  background-color:#111b3d;
  background-image:linear-gradient(90deg,rgba(9,14,30,.18),transparent 35%,transparent 65%,rgba(9,14,30,.18)),url('/assets/my-page-wallpaper-celestial-v80_8_106.webp');
}
body:has(.profile-v4:is(.rw8105-backdrop-moonlit,.rw8105-backdrop-softlight,.rw8105-backdrop-celestial)) .site-footer{
  background:var(--bg);color:var(--muted);
}

/* Customized Window Borders keep their deliberate dark glass finishes in all site
   themes. Give them a complete local palette so dynamic post menus, both BBCode
   toolbars, inputs, labels and compact controls inherit the *same* readable colors. */
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4.rw8105-panel-silver .panel{
  --bg:#182636;--surface:#242e3e;--raised:#344257;--border:#8498b2;
  --text:#f4f7ff;--muted:#d0dbe9;--subtle:#b7c9da;--accent:#d9ebff;
  color:var(--text);
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4.rw8105-panel-violet .panel{
  --bg:#241c32;--surface:#2c263d;--raised:#443353;--border:#9975ba;
  --text:#faf2ff;--muted:#decde9;--subtle:#d0bae4;--accent:#e6c7ff;
  color:var(--text);
}
/* Profile actions are owned by the member's cosmetic, not the global theme.
   Apply foregrounds to *actual buttons* as well as link buttons. */
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4.rw8105-buttons-pearl :is(a.btn,button.btn,summary.btn),
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4.rw8105-buttons-pearl :is(a.btn,button.btn,summary.btn):is(:hover,:focus-visible){
  color:#281733!important;background:linear-gradient(135deg,#eee0fa,#c3a8dc)!important;border-color:#d7b9ed!important;
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4.rw8105-buttons-graphite :is(a.btn,button.btn,summary.btn),
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4.rw8105-buttons-graphite :is(a.btn,button.btn,summary.btn):is(:hover,:focus-visible){
  color:#f7fbff!important;background:linear-gradient(135deg,#48647f,#293b50)!important;border-color:#97b5cf!important;
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4.rw8105-buttons-violet :is(a.btn,button.btn,summary.btn),
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4.rw8105-buttons-violet :is(a.btn,button.btn,summary.btn):is(:hover,:focus-visible){
  color:#fff7ff!important;background:linear-gradient(135deg,#8a5db5,#593479)!important;border-color:#dab4ff!important;
}
/* The original post button uses its own styling, outside the optional cosmetic. */
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4 .profile-wall-compose .btn.primary,
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4 .rw8099-shared-reply .btn.primary{
  color:#24152e;background:#d8b5f0;border-color:#d8b5f0;
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4 .rw8097-profile-editor>.forum36-toolbar{
  background:var(--raised);color:var(--text);border-color:var(--border)
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4 .rw8097-profile-editor .forum36-toolbar :is(.rt-button,.rt-toolbar-group button){
  color:var(--text);-webkit-text-fill-color:currentColor;
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4 .rw8097-profile-editor .forum36-toolbar :is(.rt-button,.rt-toolbar-group button):is(:hover,:focus-visible){
  color:var(--text);background:var(--surface);border-color:var(--accent)
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4 .rw8097-profile-editor :is(.forum39-visual,textarea[name="body"]){
  background:var(--bg);color:var(--text);caret-color:var(--text);
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4 :is(.rw76-action-menu-list,.rw8097-profile-editor .emoji-picker){
  background:var(--surface);color:var(--text);border-color:var(--border)
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4 .rw76-action-menu-list :is(button,summary){color:var(--text)}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .profile-v4 .rw76-action-menu-list :is(button,summary):is(:hover,:focus-visible){background:var(--raised);color:var(--accent)}
/* Keep normal light-themed profiles native if no colored Window Borders selected. */

/* Written + Graphic Novel Book / Arc switchers currently fall back to a dark
   --panel that is not defined by the global Light/Sepia palettes. */
body[data-site-theme="light"] .book-feature :is(.rw46-volume-select,.rw808-part-form select){
  color:#292532;background:#fff;border-color:#c5b5d0;color-scheme:light
}
body[data-site-theme="sepia"] .book-feature :is(.rw46-volume-select,.rw808-part-form select){
  color:#443320;background:#f9efda;border-color:#b8a181;color-scheme:light
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .book-feature :is(.rw46-volume-select,.rw808-part-form select) option{color:inherit;background:var(--surface)}

/* Story Studio v7's --card and --panel were never defined by the site palette;
   the fallback #1e2430 became dark ink-on-dark cards on Light and Sepia. */
body[data-site-theme="light"] .v7-studio{
  --card:#fff;--panel:#f4ecf7;
}
body[data-site-theme="sepia"] .v7-studio{
  --card:#f8eedc;--panel:#e8d8bd;
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .v7-studio :is(.v7-panel,.v7-status,.v7-label){
  color:var(--text);border-color:var(--border)
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .v7-studio .v7-table :is(th,td){
  color:var(--text);border-color:var(--border)
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .v7-studio .v7-table th{color:var(--muted)}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .v7-studio :is(.v7-panel a:not(.btn),.v7-chapter a,.v7-moderation a){color:var(--accent)}

/* Shared written/Graphic Story Workspace sidebars: the same missing --card
   fallback made them unreadable. Keep the mobile layout, links and anchor states. */
body[data-site-theme="light"] .rw844-story-page .rw844-sidebar{
  --card:#f7f2fa;--surface:#eee4f4;--raised:#e7d9ee;
  --text:#2e2737;--muted:#61566b;--border:#cbb8d5;--accent:#774998;
  background:var(--card);color:var(--text)
}
body[data-site-theme="sepia"] .rw844-story-page .rw844-sidebar{
  --card:#f4e7d0;--surface:#ecdbbd;--raised:#e5d0af;
  --text:#483521;--muted:#705b43;--border:#bea789;--accent:#805374;
  background:var(--card);color:var(--text)
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rw844-sidebar :is(.rw844-sidebar-group-title,.rw844-sidebar-head strong,.rw844-section-links a){color:var(--text)}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rw844-sidebar :is(.rw844-back,.rw844-sidebar-note){color:var(--muted)}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rw844-sidebar .rw844-section-links a:is(:hover,:focus-visible,[aria-current]){
  background:var(--surface);color:var(--accent)
}

/* Written add/edit chapter, written book/arc synopsis and their Graphic Novel
   shared editor shells. The site theme changes the *editor chrome* and default
   foreground; author-supplied inline colors/images/HTML remain untouched. */
body[data-site-theme="light"] .rw844-story-page{
  --rw108-toolbar:#ebe7f1;--rw108-toolbar-divider:#cfc4d9;
  --rw108-control:#f9f7fd;--rw108-control-hover:#ddd2e8;
  --rw108-control-text:#2f2840;--rw108-editor:#fff;--rw108-editor-text:#25232c;
  --rw108-source:#f6f3fa;--rw108-block:#f1ecf6
}
body[data-site-theme="sepia"] .rw844-story-page{
  --rw108-toolbar:#e2d3b9;--rw108-toolbar-divider:#bca888;
  --rw108-control:#f8f0e0;--rw108-control-hover:#d4c09e;
  --rw108-control-text:#463420;--rw108-editor:#fcf4e5;--rw108-editor-text:#3f3022;
  --rw108-source:#f0e3cd;--rw108-block:#f2e5cb
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rich-editor-shell{
  background:var(--rw108-editor);border-color:var(--border)
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rich-toolbar{
  color:var(--rw108-control-text);background:var(--rw108-toolbar);border-color:var(--rw108-toolbar-divider)
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rich-toolbar-row + .rich-toolbar-row{
  border-top-color:var(--rw108-toolbar-divider)
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rich-toolbar .rt-button{
  color:var(--rw108-control-text);border-color:transparent
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rich-toolbar .rt-button:is(:hover,:focus-visible,[aria-expanded="true"]){
  background:var(--rw108-control-hover);border-color:var(--border);color:var(--rw108-control-text)
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rich-toolbar :is(select[data-rich-tool="block"],.rw18-block-button){
  color:var(--rw108-control-text);background:var(--rw108-control);border-color:var(--border);color-scheme:light
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rich-toolbar :is(.rt-footnote .rt-glyph,.rt-footnote sup,.rt-table-chevron,.rw18-list-arrow){
  color:var(--rw108-control-text)
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rich-toolbar .rt-toolbar-group + .rt-toolbar-group::before{background:var(--rw108-toolbar-divider)}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rich-toolbar .rt-button.rt-table-toggle{
  color:var(--rw108-control-text)!important;
  background:var(--rw108-control)!important;border-color:var(--border)!important
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rich-toolbar .rt-button.rt-table-toggle:is(:hover,:focus-visible,[aria-expanded="true"]){
  background:var(--rw108-control-hover)!important
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page :is(#rich-content,#synopsis-content){
  color:var(--rw108-editor-text);background:var(--rw108-editor);caret-color:var(--rw108-editor-text)
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page :is(.rich-source,.rich-fullscreen .rich-source){
  color:var(--rw108-editor-text);background:var(--rw108-source);caret-color:var(--rw108-editor-text)
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page #rich-content :is(blockquote,aside){
  background:var(--rw108-block)
}
body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rich-status{
  color:var(--muted);background:var(--rw108-toolbar);border-color:var(--rw108-toolbar-divider)
}
/* Hover/focus remain clear; keep role-specific colorful toolbar marks as authored. */
@media (max-width:600px){
  body .site-main:has(.profile-v4:is(.rw8105-backdrop-moonlit,.rw8105-backdrop-softlight,.rw8105-backdrop-celestial)){
    padding-inline:1.5rem;background-position:center top
  }
}
@media(prefers-reduced-motion:reduce){
  body:is([data-site-theme="light"],[data-site-theme="sepia"]) .rw844-story-page .rich-toolbar .rt-button{transition:none}
}
