/* wbp1-20261014 — World Builder entry editor polish (8px grid · Cinzel ≥14 · Source Sans ≥13) */
html body.wb-v2 main.world-shell{--we-gold:#C9A25A;--we-gold-hi:#F2D7AC;--we-ink:#EDE3CF;--we-mute:#A99C86;--we-line:rgba(201,162,90,.22);--we-card:rgba(4,19,30,.72);--we-field:#06202e;--we-secret:#B48AD6}
html body.wb-v2 #entry-editor.wbe{display:flex;flex-direction:column;gap:16px;font-family:var(--lc-sans,"Source Sans 3",system-ui,sans-serif);font-size:16px}
html body.wb-v2 #entry-editor.wbe label,html body.wb-v2 #entry-editor.wbe legend{font-family:var(--lc-display,Cinzel,serif);font-size:14px;letter-spacing:.06em;text-transform:uppercase;color:var(--we-gold)}
html body.wb-v2 #entry-editor.wbe .hint{font-size:13px;color:var(--we-mute)}
html body.wb-v2 #entry-editor.wbe #e-title{font-family:var(--lc-display,Cinzel,serif)!important;font-size:24px!important;min-height:48px}
html body.wb-v2 #entry-editor.wbe .wbe-legacy-hidden{display:none!important}
html body.wb-v2 #entry-editor.wbe fieldset{border:1px solid var(--we-line);border-radius:8px;padding:16px;margin:0}
/* hero */
html body.wb-v2 #entry-editor .wb-hero{position:relative}
html body.wb-v2 #entry-editor .wbe-hero-bar{position:absolute;right:8px;bottom:8px;display:flex;gap:8px;flex-wrap:wrap}
html body.wb-v2 #entry-editor .wb-hero.is-fallback .wbe-hero-bar{display:none}
html body.wb-v2 #entry-editor .wbe-hero-empty{position:absolute;inset:0;display:none;align-items:center;justify-content:center}
html body.wb-v2 #entry-editor .wb-hero.is-fallback .wbe-hero-empty{display:flex}
html body.wb-v2 #entry-editor button.wbe-chip{all:unset;box-sizing:border-box;cursor:pointer;min-height:32px;padding:0 12px;display:inline-flex;align-items:center;gap:4px;border-radius:16px;background:rgba(0,15,23,.78);border:1px solid var(--we-line);color:var(--we-gold-hi);font-size:13px;backdrop-filter:blur(4px)}
html body.wb-v2 #entry-editor button.wbe-chip:hover,html body.wb-v2 #entry-editor button.wbe-chip:focus-visible{border-color:var(--we-gold);outline:none}
html body.wb-v2 #entry-editor button.wbe-drop-cta{all:unset;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:4px;padding:16px 24px;border:1px dashed var(--we-gold);border-radius:8px;background:rgba(0,15,23,.7);color:var(--we-gold-hi);text-align:center}
html body.wb-v2 #entry-editor button.wbe-drop-cta b{font-family:var(--lc-display,Cinzel,serif);font-size:16px;font-weight:600}
html body.wb-v2 #entry-editor button.wbe-drop-cta span{font-size:13px;color:var(--we-mute)}
html body.wb-v2 #entry-editor .is-drop{outline:2px dashed var(--we-gold);outline-offset:-4px}
/* meta grid */
html body.wb-v2 #entry-editor.wbe .wb-entry-meta .grid-2{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
@media (max-width:820px){html body.wb-v2 #entry-editor.wbe .wb-entry-meta .grid-2{grid-template-columns:1fr 1fr}}
/* rich text */
html body.wb-v2 #entry-editor .rt-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding:8px;border:1px solid var(--we-line);border-bottom:0;border-radius:8px 8px 0 0;background:rgba(0,15,23,.55);position:relative}
html body.wb-v2 #entry-editor .rt-toolbar button.rt-btn{min-width:32px;min-height:32px;padding:0 8px;font-size:14px;border-radius:6px}
html body.wb-v2 #entry-editor .rt-sep{width:1px;height:24px;background:var(--we-line);margin:0 4px}
html body.wb-v2 #entry-editor .rt-slash-hint{margin-left:auto;font-size:13px;color:var(--we-mute)}
html body.wb-v2 #entry-editor .rt-more{flex-basis:100%;display:flex;flex-wrap:wrap;gap:4px;padding-top:8px;border-top:1px solid var(--we-line)}
html body.wb-v2 #entry-editor .rt-more[hidden]{display:none!important}
html body.wb-v2 #entry-editor .rt-editor{border-radius:0 0 8px 8px;min-height:240px;padding:16px;line-height:1.6}
html body.wb-v2 #entry-editor .rt-shell{position:relative}
html body.wb-v2 .rt-editor aside,html body.wb-v2 aside[data-dm]{margin:8px 0;padding:8px 16px;border-left:3px solid var(--we-secret);background:rgba(180,138,214,.1);border-radius:0 6px 6px 0;color:#E4D6F2}
html body.wb-v2 .rt-editor aside::before{content:"◐ DM secret · players never see this";display:block;font-size:13px;letter-spacing:.04em;color:var(--we-secret);margin-bottom:4px}
html body.wb-v2 [data-dm]:not(aside){background:rgba(180,138,214,.16);outline:1px dashed var(--we-secret);outline-offset:1px;border-radius:3px;color:#E4D6F2}
html body.wb-v2 [data-dm]:not(aside)::before{content:"◐ ";color:var(--we-secret);font-size:.9em}
html body.wb-v2 .rt-editor a[href^="#entry:"]{color:var(--we-gold-hi);text-decoration:underline dotted;text-underline-offset:3px}
html body.wb-v2 .rt-menu{position:absolute;z-index:40;min-width:240px;max-height:280px;overflow:auto;padding:4px;background:#04131E;border:1px solid var(--we-gold);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.5)}
html body.wb-v2 .rt-menu[hidden]{display:none}
html body.wb-v2 .rt-menu .rt-menu-k{margin:4px 8px;font-family:var(--lc-display,Cinzel,serif);font-size:14px;color:var(--we-gold)}
html body.wb-v2 .rt-menu .rt-menu-empty{margin:8px;font-size:13px;color:var(--we-mute)}
html body.wb-v2 .rt-menu button.rt-menu-i{all:unset;box-sizing:border-box;display:flex;justify-content:space-between;gap:16px;width:100%;min-height:36px;padding:0 8px;border-radius:6px;cursor:pointer;color:var(--we-ink);font-size:14px;align-items:center}
html body.wb-v2 .rt-menu button.rt-menu-i em{font-style:normal;font-size:13px;color:var(--we-mute)}
html body.wb-v2 .rt-menu button.rt-menu-i.is-on,html body.wb-v2 .rt-menu button.rt-menu-i:hover{background:rgba(201,162,90,.16)}
/* gallery */
html body.wb-v2 #entry-editor .entry-attach-field.wbe-gallery-field > :not(legend):not(.wbe-gallery):not(input[type=hidden]):not(.toolbar:has(#entry-attach-map)){display:none!important}
html body.wb-v2 #entry-editor .wbe-gallery-field .toolbar:has(#entry-attach-map){margin-top:16px;gap:8px;align-items:flex-end}
html body.wb-v2 #entry-editor .wbe-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(136px,1fr));gap:8px}
html body.wb-v2 #entry-editor .wbe-tile{position:relative;margin:0;aspect-ratio:4/3;border-radius:8px;overflow:hidden;border:1px solid var(--we-line);background:var(--we-card)}
html body.wb-v2 #entry-editor .wbe-tile img{width:100%;height:100%;object-fit:cover;display:block}
html body.wb-v2 #entry-editor .wbe-tile figcaption{position:absolute;left:0;right:0;bottom:0;padding:4px 8px;font-size:13px;color:var(--we-ink);background:linear-gradient(transparent,rgba(0,15,23,.9));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body.wb-v2 #entry-editor .wbe-tile-map{display:flex;align-items:center;justify-content:center;height:100%;font-size:32px;color:var(--we-gold);text-decoration:none}
html body.wb-v2 #entry-editor button.wbe-tile.wbe-drop{all:unset;box-sizing:border-box;cursor:pointer;aspect-ratio:4/3;border:1px dashed var(--we-gold);border-radius:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:var(--we-gold-hi);text-align:center}
html body.wb-v2 #entry-editor button.wbe-drop b{font-size:14px}
html body.wb-v2 #entry-editor button.wbe-drop span{font-size:13px;color:var(--we-mute)}
html body.wb-v2 #entry-editor button.wbe-x{all:unset;box-sizing:border-box;cursor:pointer;position:absolute;top:4px;right:4px;width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:rgba(0,15,23,.85);color:var(--we-gold-hi);font-size:16px;line-height:1}
/* relations */
html body.wb-v2 #entry-editor .wbe-rel{display:flex;flex-direction:column;gap:16px}
html body.wb-v2 #entry-editor .wbe-rel-group h4{margin:0 0 8px;display:flex;align-items:center;gap:8px;font-family:var(--lc-display,Cinzel,serif);font-size:14px;letter-spacing:.06em;color:var(--we-gold-hi);text-transform:uppercase}
html body.wb-v2 #entry-editor .wbe-rel-group h4 span{font-family:var(--lc-sans,sans-serif);font-size:13px;color:var(--we-mute)}
html body.wb-v2 #entry-editor .wbe-swatch{display:inline-block;width:24px;height:0;border-top:2px solid var(--we-gold)}
html body.wb-v2 #entry-editor .wbe-swatch.t-ally{border-color:#7FB685}
html body.wb-v2 #entry-editor .wbe-swatch.t-enemy{border-color:#C9773B;border-top-style:dashed}
html body.wb-v2 #entry-editor .wbe-swatch.t-family{border-color:#E0B25E}
html body.wb-v2 #entry-editor .wbe-swatch.t-member{border-color:#B48AD6;border-top-style:dotted}
html body.wb-v2 #entry-editor .wbe-swatch.t-located{border-color:#6FA8C7}
html body.wb-v2 #entry-editor .wbe-swatch.t-other{border-color:#A99C86;border-top-style:solid}
html body.wb-v2 #entry-editor .wbe-rel-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:8px}
html body.wb-v2 #entry-editor .wbe-rel-card{position:relative;display:grid;grid-template-columns:48px 1fr auto;gap:8px;align-items:center;padding:8px 40px 8px 8px;border:1px solid var(--we-line);border-radius:8px;background:var(--we-card)}
html body.wb-v2 #entry-editor .wbe-rel-card > img{width:48px;height:48px;border-radius:6px;object-fit:cover}
html body.wb-v2 #entry-editor .wbe-rel-main{min-width:0;display:flex;flex-direction:column;gap:4px}
html body.wb-v2 #entry-editor button.wbe-rel-open{all:unset;cursor:pointer;font-family:var(--lc-display,Cinzel,serif);font-size:16px;color:var(--we-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body.wb-v2 #entry-editor button.wbe-rel-open:hover{color:var(--we-gold-hi)}
html body.wb-v2 #entry-editor .wbe-rel-main small{font-size:13px;color:var(--we-mute)}
html body.wb-v2 #entry-editor .wbe-rel-card input.wbe-rel-note{min-height:32px!important;font-size:13px!important;padding:0 8px!important}
html body.wb-v2 #entry-editor .wbe-rel-card select.wbe-rel-type{min-height:32px!important;font-size:13px!important;max-width:112px}
html body.wb-v2 #entry-editor .wbe-rel-card button.wbe-x{top:50%;transform:translateY(-50%)}
html body.wb-v2 #entry-editor .wbe-rel-add{position:relative;display:flex;gap:8px}
html body.wb-v2 #entry-editor .wbe-rel-add input{flex:1}
html body.wb-v2 #entry-editor .wbe-rel-results{position:absolute;z-index:30;top:100%;left:0;right:0;margin-top:4px;padding:4px;background:#04131E;border:1px solid var(--we-gold);border-radius:8px;max-height:280px;overflow:auto}
html body.wb-v2 #entry-editor .wbe-rel-results[hidden]{display:none}
html body.wb-v2 #entry-editor button.wbe-rel-hit{all:unset;box-sizing:border-box;cursor:pointer;display:flex;justify-content:space-between;gap:16px;width:100%;min-height:36px;padding:0 8px;border-radius:6px;color:var(--we-ink);font-size:14px;align-items:center}
html body.wb-v2 #entry-editor button.wbe-rel-hit small{font-size:13px;color:var(--we-mute)}
html body.wb-v2 #entry-editor button.wbe-rel-hit.is-on,html body.wb-v2 #entry-editor button.wbe-rel-hit:hover{background:rgba(201,162,90,.16)}
html body.wb-v2 #entry-editor .wbe-rel-legacy summary{cursor:pointer;font-size:13px;color:var(--we-mute);margin-top:8px}
/* toggles */
html body.wb-v2 #entry-editor .wbe-toggles{display:flex;gap:16px;flex-wrap:wrap}
html body.wb-v2 #entry-editor label.wbe-toggle{position:relative;display:flex;align-items:center;gap:12px;min-height:44px;padding:8px 16px 8px 8px;border:1px solid var(--we-line);border-radius:8px;cursor:pointer;text-transform:none;letter-spacing:0;font-family:var(--lc-sans,sans-serif);color:var(--we-ink);flex:1 1 240px}
html body.wb-v2 #entry-editor label.wbe-toggle input{position:absolute;opacity:0;width:1px;height:1px}
html body.wb-v2 #entry-editor .wbe-switch{flex:0 0 40px;height:24px;border-radius:12px;background:#1b2a35;border:1px solid var(--we-line);position:relative;transition:background .15s}
html body.wb-v2 #entry-editor .wbe-switch::after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:var(--we-mute);transition:transform .15s,background .15s}
html body.wb-v2 #entry-editor label.wbe-toggle input:checked + .wbe-switch{background:rgba(201,162,90,.35);border-color:var(--we-gold)}
html body.wb-v2 #entry-editor label.wbe-toggle input:checked + .wbe-switch::after{transform:translateX(16px);background:var(--we-gold-hi)}
html body.wb-v2 #entry-editor label.wbe-toggle input:focus-visible + .wbe-switch{outline:2px solid var(--we-gold);outline-offset:2px}
html body.wb-v2 #entry-editor label.wbe-toggle span{display:flex;flex-direction:column}
html body.wb-v2 #entry-editor label.wbe-toggle b{font-size:16px;font-weight:600}
html body.wb-v2 #entry-editor label.wbe-toggle small{font-size:13px;color:var(--we-mute)}
/* footer */
html body.wb-v2 #entry-editor .wbe-foot{position:sticky;bottom:0;z-index:5;display:flex;align-items:center;gap:8px;padding:8px 0;background:linear-gradient(transparent,var(--lc-bg,#000F17) 30%)}
html body.wb-v2 #entry-editor .wbe-foot-hint{margin-right:auto;font-size:13px;color:var(--we-mute)}
html body.wb-v2 .badge.wb-saved{font-size:13px}
@media (max-width:600px){
  html body.wb-v2 #entry-editor .rt-slash-hint,html body.wb-v2 #entry-editor .wbe-foot-hint{display:none}
  html body.wb-v2 #entry-editor .rt-toolbar button.rt-btn,html body.wb-v2 #entry-editor button.wbe-chip,html body.wb-v2 #entry-editor .wbe-rel-card select.wbe-rel-type,html body.wb-v2 #entry-editor .wbe-rel-card input.wbe-rel-note{min-height:44px!important}
  html body.wb-v2 #entry-editor button.wbe-x{width:44px;height:44px}
  html body.wb-v2 #entry-editor .wbe-rel-card{grid-template-columns:48px 1fr;padding-right:52px}
  html body.wb-v2 #entry-editor .wbe-rel-card select.wbe-rel-type{grid-column:2;max-width:none}
  html body.wb-v2 #entry-editor .wbe-rel-cards{grid-template-columns:1fr}
}
html body.wb-v2 #entry-editor .wbe-rel-add input#wbe-rel-search{flex:1 1 auto;min-width:0;width:auto}
html body.wb-v2 #entry-editor .wbe-rel-add select.wbe-rel-newtype{flex:0 0 136px;width:136px}
html body.wb-v2 #entry-editor button.wbe-rel-open{min-height:0!important;border:0!important;background:none!important;padding:0!important;text-align:left}
html body.wb-v2 #entry-editor .wbe-rel-cards{grid-template-columns:repeat(auto-fill,minmax(340px,1fr))}
html body.wb-v2 #entry-editor .wbe-rel-card{grid-template-columns:48px minmax(0,1fr) auto}
@media (max-width:820px){html body.wb-v2 #entry-editor button.wbe-rel-open{min-height:44px!important;display:flex;align-items:center}}

/* b3 item 9: the formatting toolbar stays pinned under the site header while a long entry scrolls (the page is the scroll area); opaque so text never shows through */
html body.wb-v2 #entry-editor .rt-shell>.rt-toolbar.rt-toolbar{position:sticky!important;top:var(--wb-hdr,64px);z-index:6;background:var(--lc-navy,#000F17)!important;box-shadow:0 1px 0 var(--lc-line,rgba(242,215,172,.14)),0 8px 12px -8px rgba(0,0,0,.6)}
html body.wb-v2 #entry-editor .rt-shell{overflow:visible!important}/* hidden made the shell a scroll box and stopped the sticky toolbar; toolbar + editor carry their own rounded corners */
html body.wb-v2 #entry-editor .rt-shell>.rt-editor{max-height:none!important;overflow:visible!important}/* the entry grows with its text and the page is the one scroll area, so the toolbar can stay pinned */
