.cloud-save-picker{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px;margin:8px 0;border:1px solid currentColor;border-radius:6px}.cloud-save-picker select,.cloud-save-picker button{font:inherit;min-height:36px;max-width:100%}#cloud-notice{position:fixed;z-index:100000;bottom:16px;left:50%;transform:translateX(-50%);width:max-content;max-width:min(90vw,680px);margin:0;padding:14px 18px;background:#222831;color:#fff;border:1px solid #ff5722;border-radius:8px;box-shadow:0 5px 20px #0007;font:16px/1.4 Arial,sans-serif}#cloud-notice[hidden]{display:none}
.cloud-browser-controls .cloud-provider-picker{width:12em;max-width:100%;margin-right:.4em;vertical-align:middle}
.cloud-browser-controls .cloud-connect-button{display:inline-block;width:auto!important;vertical-align:middle;min-height:28px;margin-right:.4em;padding:4px 10px;border:1px solid #465568;border-radius:4px;background:#222831;color:#fff;font:inherit;cursor:pointer}
.cloud-browser-controls .cloud-connect-button:hover{border-color:#ff5722}.cloud-browser-controls .cloud-connect-button:disabled{opacity:.55;cursor:default}
.cloud-browser-controls [hidden]{display:none!important}
.cloud-browser-hint{margin:4px 0 0;padding:4px 0;font:12px/1.4 Arial,sans-serif;opacity:.8;white-space:normal}
.cloud-browser-loading{padding:12px;font:14px/1.5 Arial,sans-serif}
html.light .cloud-browser-controls .cloud-connect-button{background:#fcf7eb;color:#500000;border-color:#b59c8b}
.cloud-save-picker small{width:100%;font-size:.8em;opacity:.75}
.cloud-save-picker[hidden]{display:none!important}
/* The character browser keeps its native two-column structure and toolbar order. */
.pb-character-browser{--pb-panel:#171a1e;--pb-surface:#222831;--pb-edge:#394553;--pb-text:#e8edf3;--pb-muted:#abb5c2;--pb-accent:#ff5722;color:var(--pb-text);font-family:Arial,sans-serif}
.pb-character-browser>.modal-content{width:min(1160px,94vw)!important;height:min(790px,88dvh);max-height:88dvh;border:1px solid var(--pb-edge);border-radius:14px;overflow:hidden;background:var(--pb-panel);box-shadow:0 24px 80px #0008}
.pb-character-browser .dialog-top-bar{padding:20px 22px 12px;color:var(--pb-text)}
.pb-character-browser .dialog-title{font-size:21px;font-weight:700;margin:0 0 16px}
.pb-character-browser .cloud-browser-controls,.pb-character-browser .cloud-browser-filters{display:flex!important;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 10px}
.pb-character-browser select{box-sizing:border-box;height:36px;min-width:0;width:12em!important;margin:0!important;padding:0 30px 0 10px;border:1px solid var(--pb-edge);border-radius:6px;background-color:var(--pb-surface);color:var(--pb-text);font:13px Arial,sans-serif;cursor:pointer}
.pb-character-browser select:hover{border-color:var(--pb-muted)}
.pb-character-browser .cloud-character-search{box-sizing:border-box;width:180px;height:36px;padding:0 10px;border:1px solid var(--pb-edge);border-radius:6px;background:var(--pb-surface);color:var(--pb-text);font:13px Arial,sans-serif}
.pb-character-browser .cloud-character-search::placeholder{color:var(--pb-muted)}
.pb-character-browser .cloud-character-search:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}
.pb-character-browser [hidden]{display:none!important}
.pb-character-browser select:focus-visible,.pb-character-browser button:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}
.pb-character-browser .cloud-connect-button{height:36px;background:var(--pb-surface);color:var(--pb-text);border-color:var(--pb-edge);margin:0}
.pb-character-browser .cloud-browser-controls>.invisible{display:none!important}
.pb-character-browser .cloud-browser-controls>.button-text{box-sizing:border-box;width:auto!important;min-height:36px;margin:0;padding:6px 10px;border:1px solid var(--pb-edge);border-radius:6px;background:var(--pb-surface);font-size:13px}
.pb-character-browser .cloud-browser-controls .button-column div{color:var(--pb-text)!important}
html.light .pb-character-browser .cloud-browser-controls .button-icon{filter:invert(1)}
.pb-character-browser .cloud-browser-hint{color:var(--pb-muted);opacity:1;margin:2px 0;font-size:12px}
.pb-character-browser .content-listview{background:var(--pb-panel);border-top:1px solid var(--pb-edge);border-bottom:1px solid var(--pb-edge)}
.pb-character-browser .div-listview-scroller{box-sizing:border-box;flex:0 0 32%;width:32%;max-width:380px;padding:12px;overflow-y:auto;border-right:1px solid var(--pb-edge);scrollbar-width:thin}
.pb-character-browser .div-listview-info{box-sizing:border-box;min-width:0;padding:24px;background:var(--pb-surface);overflow-y:auto;scrollbar-width:thin}
.pb-character-browser .div-listview-scroller .listview-topdiv{box-sizing:border-box;padding:10px;border:1px solid transparent;border-radius:8px;background:var(--pb-surface);line-height:1.5;overflow-wrap:anywhere}
.pb-character-browser .div-listview-scroller .listview-topdiv:hover{border-color:var(--pb-edge)}
.pb-character-browser .div-listview-scroller .listview-topdiv:has(.listview-title-selected){border-color:var(--pb-accent)}
.pb-character-browser .listview-title-selected{color:var(--pb-accent)}
.pb-character-browser .listview-detail{margin:6px 0 0;color:var(--pb-muted);font-size:12px;line-height:1.6}
.pb-character-browser .modal-buttons{display:flex;gap:8px;flex-wrap:wrap;padding:14px 22px;background:var(--pb-panel)}
.pb-character-browser .modal-button{box-sizing:border-box;min-height:36px;width:auto;min-width:100px;margin:0;padding:8px 15px;border:1px solid var(--pb-edge);border-radius:6px;color:var(--pb-text);font-size:13px;line-height:18px}
.pb-character-browser .modal-button:first-child{background:var(--pb-accent);color:#fff;border-color:var(--pb-accent)}
.pb-character-browser .modal-button:hover{filter:brightness(1.1)}
.pb-character-browser .modal-button-disabled{opacity:.35;cursor:default;pointer-events:none}
html.light .pb-character-browser{--pb-panel:#f7f0df;--pb-surface:#fffaf0;--pb-edge:#d4c3a6;--pb-text:#3c2922;--pb-muted:#806c5d;--pb-accent:#780f12}
html.light .pb-character-browser .div-topbar_holder,html.light .pb-character-browser .dialog-top-bar,html.light .pb-character-browser .modal-buttons,html.light .pb-character-browser .div-listview-scroller{background:var(--pb-panel);color:var(--pb-text)}
html.light .pb-character-browser .dialog-title{color:var(--pb-text)}
html.light .pb-character-browser select,html.light .pb-character-browser .modal-button{background:var(--pb-surface);border-color:var(--pb-edge);color:var(--pb-text)}
html.light .pb-character-browser .modal-button:first-child{background:var(--pb-accent);border-color:var(--pb-accent);color:#fff}
html.light .pb-character-browser .listview-title-selected{color:var(--pb-accent)}
@media(max-width:650px){.pb-character-browser .dialog-top-bar{padding:14px 12px 8px}.pb-character-browser .dialog-title{font-size:19px;margin-bottom:12px}.pb-character-browser select{width:calc(50% - 4px)!important}.pb-character-browser .div-listview-scroller{flex-basis:42%;width:42%;padding:8px}.pb-character-browser .div-listview-info{padding:12px}.pb-character-browser .modal-buttons{padding:10px 12px;gap:6px}.pb-character-browser .modal-button{min-width:0;flex:1;padding:8px}.pb-character-browser .cloud-browser-hint{font-size:11px}}
/* New character: same palette as the character browser, native controls and handlers. */
.pb-new-character{--pb-panel:#171a1e;--pb-surface:#222831;--pb-edge:#394553;--pb-text:#e8edf3;--pb-muted:#abb5c2;--pb-accent:#ff5722;color:var(--pb-text);font:14px/1.55 Arial,sans-serif}
.pb-new-character>.modal-content{box-sizing:border-box;width:min(500px,calc(100vw - 32px))!important;max-height:calc(100dvh - 32px);overflow-y:auto;border:1px solid var(--pb-edge);border-radius:14px;background:var(--pb-panel);box-shadow:0 24px 80px #0008}
.pb-new-character .dialog-top-bar{position:relative;padding:22px 60px 16px 24px;background:var(--pb-panel);color:var(--pb-text);border-bottom:1px solid var(--pb-edge)}
.pb-new-character .dialog-title{margin:0;color:var(--pb-text);font:700 20px/1.35 Arial,sans-serif}
.pb-new-character .pb-new-close{position:absolute;right:16px;top:16px;width:32px;height:32px;padding:0;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--pb-muted);font:26px/28px Arial,sans-serif;cursor:pointer}
.pb-new-character .pb-new-close:hover{background:var(--pb-surface);border-color:var(--pb-edge);color:var(--pb-text)}
.pb-new-character .pb-new-body{padding:20px 24px 20px!important}
.pb-new-character .pb-new-guest-note{padding:12px 14px;margin:0 0 16px;border:1px solid var(--pb-edge);border-left:3px solid var(--pb-accent);border-radius:8px;background:var(--pb-surface)}
.pb-new-character .pb-new-guest-note strong{font-size:13px;font-weight:700}
.pb-new-character .pb-new-guest-note p{margin:4px 0 0;font-size:13px;color:var(--pb-muted);line-height:1.55}
.pb-new-character .pb-new-intro{padding:0;margin:0 0 18px!important;background:transparent;border-radius:0;color:var(--pb-muted)}
.pb-new-character .pb-new-intro p{margin:0;font:14px/1.6 Arial,sans-serif}
.pb-new-character .pb-new-intro b{color:var(--pb-text);font-weight:600}
.pb-new-character .pb-new-options{padding:14px 16px;margin:0!important;border:1px solid var(--pb-edge);border-radius:8px;background:var(--pb-surface);color:var(--pb-text)}
.pb-new-character .pb-new-edition{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 12px;padding:0 0 9px;margin:0 0 9px;border-bottom:1px solid var(--pb-edge);font-size:13px;color:var(--pb-muted)}
.pb-new-character .pb-new-edition select{
 min-width:9em;min-height:34px;padding:5px 8px;border:1px solid var(--pb-edge);border-radius:6px;
 background:var(--pb-panel);color:var(--pb-text);font:inherit
}
.pb-new-character .pb-new-options>div:empty{display:none}
.pb-new-character .checkbox-container{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:32px;margin:0}
.pb-new-character .checkbox-container>span{width:auto!important;flex:1;text-align:left;white-space:normal;font:14px/1.5 Arial,sans-serif}
.pb-new-character .switch{flex:0 0 54px;width:54px;height:28px;margin:0}
.pb-new-character .slider{background:#536071;border:1px solid transparent;box-sizing:border-box}
.pb-new-character .slider:before{width:20px;height:20px;left:3px;bottom:3px}
.pb-new-character input:checked+.slider{background:var(--pb-accent)}
.pb-new-character input:checked+.slider:before{transform:translateX(25px)}
.pb-new-character .slider .on,.pb-new-character .slider .off{display:none}
.pb-new-character .small-text{font:12px/1.5 Arial,sans-serif;color:var(--pb-muted)}
.pb-new-character .small-text{display:block;margin-top:12px}
.pb-new-character .small-text br{display:none}
.pb-new-character .slider .on,.pb-new-character .slider .off{display:none!important}
.pb-new-character #togBtn:checked+.slider{background:var(--pb-accent)}
.pb-new-character .modal-buttons{display:flex;gap:10px;padding:20px 24px 24px;margin:0;background:var(--pb-panel)}
.pb-new-character .modal-button{box-sizing:border-box;display:flex;align-items:center;justify-content:center;flex:1;width:auto!important;min-height:42px;margin:0;padding:10px 14px;border:1px solid var(--pb-edge);border-radius:7px;background:var(--pb-surface);color:var(--pb-text);font:600 13px/1.4 Arial,sans-serif;text-align:center;cursor:pointer}
.pb-new-character .modal-button:first-child{background:var(--pb-accent);border-color:var(--pb-accent);color:#fff}
.pb-new-character .modal-button:hover{filter:brightness(1.1)}
.pb-new-character .modal-button:focus-visible,.pb-new-character button:focus-visible,.pb-new-character input:focus-visible+.slider{outline:2px solid var(--pb-accent);outline-offset:3px}
html.light .pb-new-character{--pb-panel:#f7f0df;--pb-surface:#fffaf0;--pb-edge:#d4c3a6;--pb-text:#3c2922;--pb-muted:#806c5d;--pb-accent:#780f12}
html.light .pb-new-character .dialog-top-bar,html.light .pb-new-character .modal-buttons{background:var(--pb-panel);color:var(--pb-text)}
html.light .pb-new-character .dialog-title{color:var(--pb-text)}
html.light .pb-new-character>.modal-content{background:var(--pb-panel)!important}
html.light .pb-new-character .pb-new-intro{background:transparent!important;color:var(--pb-muted)}
html.light .pb-new-character .pb-new-options{background:var(--pb-surface);border-color:var(--pb-edge);color:var(--pb-text)}
html.light .pb-new-character .pb-new-close{color:var(--pb-muted);box-shadow:none}
html.light .pb-new-character .modal-button{background:var(--pb-surface);color:var(--pb-text);border-color:var(--pb-edge)}
html.light .pb-new-character .modal-button:first-child{background:var(--pb-accent);color:#fff;border-color:var(--pb-accent)}
@media(max-width:520px){.pb-new-character .dialog-top-bar{padding:18px 52px 14px 18px}.pb-new-character .dialog-title{font-size:18px}.pb-new-character .pb-new-body{padding:16px 18px 0!important}.pb-new-character .modal-buttons{padding:18px;gap:8px}.pb-new-character .pb-new-options{padding:12px}.pb-new-character .checkbox-container{gap:10px}.pb-new-character .modal-button{padding:10px 8px}}
@media(prefers-reduced-motion:reduce){.pb-new-character .slider,.pb-new-character .slider:before{transition:none}}
.pb-new-character>.modal-content>.modal-buttons{display:grid;grid-template-columns:1fr 1fr}
.pb-storage-home{border:0;border-radius:6px;background:transparent;color:var(--pb-muted);padding:8px 0;font:13px/1.5 Arial,sans-serif;cursor:pointer}
.pb-storage-home:hover{color:var(--pb-text);text-decoration:underline}
.pb-storage-choice>.modal-content{display:flex;flex-direction:column;width:min(660px,calc(100vw - 32px))!important;height:auto;max-height:calc(100dvh - 32px);overflow-y:auto;margin:auto;background:var(--pb-panel)!important}
.pb-storage-choice select{width:auto!important;max-width:100%;flex:0 1 auto;min-width:180px}
.pb-storage-choice select:first-of-type{min-width:16.5em} /* 2026-11-07: fits «На аккаунте или в облаке» */
.pb-storage-choice .modal-buttons{justify-content:space-between;align-items:center;flex-shrink:0}
.pb-storage-choice .modal-button{flex:0 0 auto;min-width:140px;cursor:pointer;font-family:Arial,sans-serif}
.pb-storage-choice .modal-button:disabled{opacity:.4;cursor:default;filter:none}
.pb-storage-choice .pb-storage-home:disabled{opacity:.4;cursor:default}
.pb-storage-error{font:13px/1.6 Arial,sans-serif;color:var(--pb-accent)}
.pb-storage-error:empty{display:none}
@media(max-width:650px){.pb-storage-choice select{flex:1 1 180px}.pb-storage-choice select:first-of-type{min-width:0}.pb-storage-choice .modal-button{min-width:100px}.pb-storage-choice .pb-storage-home{font-size:12px}}

.pb-storage-choice .pb-storage-home{width:auto!important;max-width:none;color:var(--pb-muted);background:transparent;border:0;padding:8px 0;font:13px/1.5 Arial,sans-serif;box-shadow:none}
.pb-storage-choice .pb-storage-home{margin-left:auto}
.pb-storage-choice .dialog-top-bar{padding-bottom:18px}
.pb-storage-choice .modal-buttons{border-top:1px solid var(--pb-edge)}
.pb-storage-permission{--pb-panel:#171a1e;--pb-surface:#222831;--pb-edge:#394553;--pb-text:#e8edf3;--pb-muted:#abb5c2;--pb-accent:#ff5722;font:14px/1.6 Arial,sans-serif;color:var(--pb-text)}
.pb-storage-permission>.modal-content{box-sizing:border-box;width:min(460px,calc(100vw - 32px))!important;max-height:calc(100dvh - 32px);overflow-y:auto;padding:0;border:1px solid var(--pb-edge);border-radius:14px;background:var(--pb-panel);box-shadow:0 24px 80px #0008}
.pb-storage-permission .dialog-top-bar{padding:22px 24px 0;background:transparent;color:var(--pb-text)}
.pb-storage-permission .dialog-title{margin:0;font:700 20px/1.4 Arial,sans-serif}
.pb-storage-permission .pb-permission-body{margin:0;padding:8px 24px 0;background:transparent!important;border-radius:0}
.pb-storage-permission .pb-permission-body p{margin:0 0 12px;font:14px/1.6 Arial,sans-serif;color:var(--pb-text)}
.pb-storage-permission .pb-permission-body .pb-permission-note{margin:0;color:var(--pb-muted);font-size:12px}
.pb-storage-permission .modal-buttons{display:flex;gap:10px;margin:0;padding:22px 24px 24px;background:transparent}
.pb-storage-permission .modal-button{box-sizing:border-box;display:flex;align-items:center;justify-content:center;flex:1;min-height:40px;width:auto;margin:0;padding:9px 14px;border:1px solid var(--pb-edge);border-radius:7px;background:var(--pb-surface);color:var(--pb-text);font:600 13px/1.4 Arial,sans-serif;cursor:pointer}
.pb-storage-permission .modal-button:first-child{background:var(--pb-accent);border-color:var(--pb-accent);color:#fff}
.pb-storage-permission .modal-button:hover{filter:brightness(1.1)}
.pb-storage-permission .modal-button:focus-visible{outline:2px solid var(--pb-accent);outline-offset:3px}
html.light .pb-storage-permission{--pb-panel:#f7f0df;--pb-surface:#fffaf0;--pb-edge:#d4c3a6;--pb-text:#3c2922;--pb-muted:#806c5d;--pb-accent:#780f12}
html.light .pb-storage-permission>.modal-content{background:var(--pb-panel)!important;border-color:var(--pb-edge)}
html.light .pb-storage-permission .dialog-top-bar,html.light .pb-storage-permission .modal-buttons{background:transparent;color:var(--pb-text)}
html.light .pb-storage-permission .modal-button{background:var(--pb-surface);color:var(--pb-text);border-color:var(--pb-edge)}
html.light .pb-storage-permission .modal-button:first-child{background:var(--pb-accent);border-color:var(--pb-accent);color:#fff}
.pb-guest-locked{opacity:.45;cursor:not-allowed}
.button-name.pb-inline-name{cursor:text}
.button-name.pb-inline-name .button-selection{display:none!important}
.button-name .pb-name-input{display:block;box-sizing:border-box;width:100%;min-width:0;min-height:28px;margin:0;padding:2px 0;border:0;border-radius:3px;outline:0;background:transparent;color:inherit;font:inherit;line-height:1.35;text-align:left;cursor:text}
.button-name .pb-name-input::placeholder{color:inherit;opacity:.55}
.button-name:has(.pb-name-input:focus-visible){outline:1px solid #ff7546;outline-offset:2px}
html.light .button-name:has(.pb-name-input:focus-visible){outline-color:#780f12}
.pb-guest-locked:after{content:' · 🔒';font-size:.75em}
.pb-character-settings{--pb-panel:#171a1e;--pb-surface:#222831;--pb-edge:#394553;--pb-text:#e8edf3;--pb-muted:#abb5c2;--pb-accent:#ff5722;color:var(--pb-text);font:14px/1.5 Arial,sans-serif}
html.light .pb-character-settings{--pb-panel:#f7f0df;--pb-surface:#fffaf0;--pb-edge:#d4c3a6;--pb-text:#3c2922;--pb-muted:#806c5d;--pb-accent:#780f12}
.pb-character-settings>.modal-content{display:flex;flex-direction:column;box-sizing:border-box;width:min(820px,calc(100vw - 32px))!important;height:min(720px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);border:1px solid var(--pb-edge);border-radius:14px;background:var(--pb-panel)!important;box-shadow:0 24px 80px #0008;overflow:hidden}
.pb-character-settings .div-topbar_holder{background:var(--pb-panel)!important}
.pb-character-settings .dialog-top-bar{position:relative;padding:20px 58px 18px 24px;background:var(--pb-panel)!important;border-bottom:1px solid var(--pb-edge)}
.pb-character-settings .dialog-title{margin:0;color:var(--pb-text);font:700 20px/1.4 Arial,sans-serif}
.pb-character-settings .pb-settings-close{position:absolute;right:16px;top:16px;width:32px;height:32px;margin:0;padding:0;border:0;border-radius:6px;background:transparent;color:var(--pb-muted);font:26px/28px Arial,sans-serif;cursor:pointer;box-shadow:none}
.pb-character-settings #content{display:flex;flex-direction:column;min-height:0;flex:1;margin:0!important;padding:0!important;overflow:hidden}
.pb-settings-notice{flex-shrink:0;margin:0;padding:16px 24px;color:var(--pb-muted);font:13px/1.55 Arial,sans-serif}
.pb-settings-tabs{display:flex;gap:4px;flex-shrink:0;overflow-x:auto;padding:0 20px;border-bottom:1px solid var(--pb-edge)}
.pb-character-settings .pb-settings-tabs>button{flex:0 0 auto;width:auto;margin:0;padding:12px 10px;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--pb-muted);font:13px Arial,sans-serif;cursor:pointer;box-shadow:none}
.pb-character-settings .pb-settings-tabs>button[aria-selected=true]{border-bottom-color:var(--pb-accent);color:var(--pb-text)}
.pb-character-settings .pb-settings-sections{box-sizing:border-box;flex:1;min-height:0;overflow-y:auto;padding:20px 24px;scrollbar-width:thin}
.pb-character-settings .pb-settings-sections>[role=tabpanel]{box-sizing:border-box;margin:0!important;padding:16px!important;border:1px solid var(--pb-edge);border-radius:10px;background:var(--pb-surface)!important;line-height:1.8!important;max-width:100%}
.pb-character-settings [hidden]{display:none!important}
.pb-character-settings .bold-standard{font:600 15px/1.5 Arial,sans-serif;color:var(--pb-text);margin:0 0 16px}
.pb-character-settings .checkbox-container{margin:0 0 10px;line-height:1.55}
.pb-character-settings .checkbox-container>span{width:auto!important;max-width:calc(100% - 36px);white-space:normal}
.pb-character-settings .checkbox-container img{flex-shrink:0}
.pb-character-settings .grid-container{max-width:100%;gap:16px}
.pb-character-settings .grid-item{min-width:0}
.pb-character-settings .modal-buttons{display:flex;justify-content:flex-end;gap:10px;padding:14px 24px;border-top:1px solid var(--pb-edge);background:var(--pb-panel)!important}
.pb-character-settings .modal-button{box-sizing:border-box;width:auto!important;min-width:100px;min-height:38px;margin:0;padding:8px 14px;border:1px solid var(--pb-edge);border-radius:6px;background:var(--pb-surface);color:var(--pb-text);font:13px/1.5 Arial,sans-serif;cursor:pointer}
.pb-character-settings .modal-button:first-child{background:var(--pb-accent);color:#fff;border-color:var(--pb-accent)}
.pb-character-settings button:focus-visible,.pb-character-settings .modal-button:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}
.pb-settings-readonly .pb-settings-sections{opacity:.8}
@media(max-width:650px){.pb-character-settings .dialog-top-bar{padding-left:18px}.pb-settings-notice{padding:14px 18px}.pb-character-settings .pb-settings-sections{padding:16px}.pb-settings-tabs{padding:0 12px}.pb-character-settings .grid-container{display:block}.pb-character-settings .grid-item{margin-bottom:12px}.pb-character-settings .modal-buttons{padding:12px 18px}}

html.light .pb-character-settings .checkbox-container img{filter:brightness(.15)}
.pb-books,.pb-save-dialog{--pb-panel:#171a1e;--pb-surface:#222831;--pb-edge:#394553;--pb-text:#e8edf3;--pb-muted:#abb5c2;--pb-accent:#ff5722;color:var(--pb-text);font:14px/1.5 Arial,sans-serif}
html.light .pb-books,html.light .pb-save-dialog{--pb-panel:#f7f0df;--pb-surface:#fffaf0;--pb-edge:#d4c3a6;--pb-text:#3c2922;--pb-muted:#806c5d;--pb-accent:#780f12}
.pb-books>.modal-content,.pb-save-dialog>.modal-content{box-sizing:border-box;border:1px solid var(--pb-edge);border-radius:14px;background:var(--pb-panel)!important;box-shadow:0 24px 80px #0008;overflow:hidden}
.pb-books>.modal-content{display:flex;flex-direction:column;width:min(1080px,calc(100vw - 32px))!important;max-height:calc(100dvh - 40px)}
.pb-books .div-topbar_holder{background:var(--pb-panel)!important;padding:20px 24px 0}
.pb-books-heading{margin:0 0 16px;font:700 20px/1.4 Arial,sans-serif;color:var(--pb-text)}
.pb-books #content{min-height:0;overflow:auto;margin:0!important;padding:16px 24px!important}
.pb-books .scrollable{max-height:none!important;height:auto!important;overflow:visible!important}
.pb-books .rounded-rectangle{background:var(--pb-surface)!important;border:1px solid var(--pb-edge);border-radius:10px;padding:8px 16px!important;margin:0 0 12px!important}
.pb-books .pb-book-row{margin:0!important;padding:12px 0;border-bottom:1px solid var(--pb-edge)}
.pb-books .pb-book-row:last-child{border-bottom:0}
.pb-books .pb-book-title{display:flex;align-items:flex-start;gap:10px;color:var(--pb-text);font:600 14px/1.5 Arial,sans-serif}
.pb-books .pb-book-title>span{margin-left:0!important}
.pb-books .pb-book-title .checkbox-container{flex-shrink:0}
.pb-books .pb-book-copyright{margin:6px 0 0 28px!important;color:var(--pb-muted);font:11px/1.55 Arial,sans-serif;white-space:normal;overflow-wrap:anywhere;cursor:pointer!important}
.pb-books .pb-book-copyright.section15{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;max-height:1.6em}
.pb-books .pb-book-copyright:focus-visible{outline:1px solid var(--pb-accent);outline-offset:3px}
.pb-books .rounded-rectangle:not(:has(.pb-book-row)){color:var(--pb-muted);font:11px/1.6 Arial,sans-serif}
.pb-books .grid-container{gap:10px;margin-bottom:8px}
.pb-books .modal-buttons,.pb-save-dialog .modal-buttons{display:flex;justify-content:flex-end;gap:10px;padding:14px 24px;background:var(--pb-panel)!important;border-top:1px solid var(--pb-edge)}
.pb-books .modal-button,.pb-save-dialog .modal-button{box-sizing:border-box;width:auto!important;min-width:100px;min-height:38px;margin:0;padding:8px 16px;border:1px solid var(--pb-edge);border-radius:6px;background:var(--pb-surface);color:var(--pb-text);font:13px/1.5 Arial,sans-serif;cursor:pointer}
.pb-books .modal-button:first-child,.pb-save-dialog .modal-button:first-child{background:var(--pb-accent);color:#fff;border-color:var(--pb-accent)}
.pb-books .modal-button:focus-visible,.pb-save-dialog :focus-visible{outline:2px solid var(--pb-accent);outline-offset:3px}
.pb-save-dialog>.modal-content{width:min(520px,calc(100vw - 32px))!important;max-height:calc(100dvh - 32px);overflow:auto}
.pb-save-dialog .div-topbar_holder{background:var(--pb-panel)!important}
.pb-save-dialog .dialog-top-bar{padding:20px 24px 16px;background:var(--pb-panel)!important;border-bottom:1px solid var(--pb-edge)}
.pb-save-dialog .dialog-title{margin:0;font:700 20px/1.4 Arial,sans-serif;color:var(--pb-text)}
.pb-save-dialog #content{padding:20px 24px!important}
.pb-save-dialog .pb-save-body{margin:0;padding:0;background:transparent!important;color:var(--pb-text)}
.pb-save-dialog .pb-save-fields{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:18px!important;align-items:start}
.pb-save-dialog select{box-sizing:border-box;width:100%;min-width:0;min-height:38px;margin:0!important;padding:8px 10px;border:1px solid var(--pb-edge);border-radius:6px;background:var(--pb-surface);color:var(--pb-text);font:13px Arial,sans-serif}
.pb-save-dialog .cloud-save-picker{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:1fr;gap:8px;margin:0;color:var(--pb-muted);font-size:12px}
.pb-save-dialog .cloud-save-picker[hidden]{display:none!important}
.pb-save-dialog .cloud-save-picker small{font:12px/1.5 Arial,sans-serif}
.pb-save-dialog .pb-save-copy{display:flex;align-items:center;gap:6px;padding:12px 0;border-top:1px solid var(--pb-edge);font-size:13px;cursor:pointer}
.pb-save-dialog .pb-save-body>p{margin:4px 0 0;padding:12px 14px;border-radius:8px;background:var(--pb-surface);color:var(--pb-muted);font:12px/1.6 Arial,sans-serif}
html.light .pb-save-copy img,html.light .pb-books .checkbox-container img{filter:brightness(.15)}
@media(max-width:600px){.pb-books .div-topbar_holder{padding:16px 16px 0}.pb-books #content{padding:12px!important}.pb-books .modal-buttons,.pb-save-dialog .modal-buttons{padding:12px 16px}.pb-save-dialog .dialog-top-bar{padding:18px 16px 14px}.pb-save-dialog #content{padding:16px!important}}
.pb-books .tabbed-area-menu-sb{display:flex;gap:4px;overflow-x:auto;border-bottom:1px solid var(--pb-edge)!important;padding:0!important;background:transparent!important}
.pb-books .section-menu-sb{flex:0 0 auto;box-sizing:border-box;padding:10px 12px!important;margin:0!important;border:0!important;border-bottom:2px solid transparent!important;border-radius:0;background:transparent!important;color:var(--pb-muted);font:13px/1.5 Arial,sans-serif!important;cursor:pointer}
.pb-books .section-menu-selected-sb{color:var(--pb-accent)!important;border-bottom-color:var(--pb-accent)!important}
.pb-books .button-filter{flex-shrink:0;width:24px;height:24px;margin:0 0 0 12px;padding:6px;border:1px solid var(--pb-edge);border-radius:6px;background:var(--pb-surface);cursor:pointer}
.pb-books .div-topbar_holder>div:has(>.tabbed-area-menu-sb){margin:0!important;align-items:center!important}
.pb-books .dialog-top-bar{padding:12px 0!important;margin:0;background:transparent!important;color:var(--pb-text)}

html .section-top .button-name.pb-inline-name>div:has(>.button-selection){display:none!important}
html:not(.light) #divBuild .cogText{color:#ff5722}
.button-show-plan{min-width:6.5em;white-space:normal}
.pb-rest-dialog{--pb-panel:#171a1e;--pb-surface:#222831;--pb-edge:#394553;--pb-text:#e8edf3;--pb-muted:#abb5c2;--pb-accent:#ff5722;color:var(--pb-text);font:14px/1.5 Arial,sans-serif}
html.light .pb-rest-dialog{--pb-panel:#f7f0df;--pb-surface:#fffaf0;--pb-edge:#d4c3a6;--pb-text:#3c2922;--pb-muted:#806c5d;--pb-accent:#780f12}
.pb-rest-dialog>.modal-content{box-sizing:border-box;width:min(620px,calc(100vw - 32px))!important;max-height:calc(100dvh - 32px);overflow:auto;border:1px solid var(--pb-edge);border-radius:14px;background:var(--pb-panel)!important;box-shadow:0 24px 80px #0008}
.pb-rest-dialog .dialog-top-bar{padding:20px 24px 16px;border-bottom:1px solid var(--pb-edge);background:var(--pb-panel)!important}
.pb-rest-dialog .dialog-title{margin:0;font:700 20px/1.4 Arial,sans-serif;color:var(--pb-text)}
.pb-rest-dialog #content{padding:20px 24px!important}
.pb-rest-dialog .rounded-rectangle-white{margin:0;padding:0;background:transparent!important;color:var(--pb-muted);font:13px/1.65 Arial,sans-serif}
.pb-rest-dialog .pb-rest-option{display:flex;align-items:center;gap:14px;margin:0;padding:14px 0;border-bottom:1px solid var(--pb-edge);color:var(--pb-text);font:13px/1.5 Arial,sans-serif;cursor:pointer}
.pb-rest-dialog .pb-rest-option:first-of-type{margin-top:14px}
.pb-rest-dialog .pb-rest-option:last-child{border-bottom:0;padding-bottom:0}
.pb-rest-option .checkbox-container{position:relative;flex:0 0 34px;box-sizing:border-box;width:34px;height:20px;border-radius:12px;background:var(--pb-edge)}
.pb-rest-option .checkbox-container img{opacity:0;width:34px;height:20px}
.pb-rest-option .checkbox-container:after{content:'';position:absolute;width:14px;height:14px;top:3px;left:3px;border-radius:50%;background:var(--pb-text);transition:transform .18s ease}
.pb-rest-option .checkbox-container:has(img[src*="_checked"]){background:var(--pb-accent)}
.pb-rest-option .checkbox-container:has(img[src*="_checked"]):after{transform:translateX(14px);background:#fff}
.pb-rest-dialog .modal-buttons{display:flex;justify-content:flex-end;gap:10px;padding:14px 24px;border-top:1px solid var(--pb-edge);background:var(--pb-panel)!important}
.pb-rest-dialog .modal-button{box-sizing:border-box;width:auto!important;min-width:100px;min-height:38px;margin:0;padding:8px 16px;border:1px solid var(--pb-edge);border-radius:6px;background:var(--pb-surface);color:var(--pb-text);font:13px/1.5 Arial,sans-serif;cursor:pointer}
.pb-rest-dialog .modal-button:first-child{background:var(--pb-accent);color:#fff;border-color:var(--pb-accent)}
.pb-rest-dialog :focus-visible{outline:2px solid var(--pb-accent);outline-offset:3px}
@media(prefers-reduced-motion:reduce){#divBuild .pb-level-locked,.pb-rest-option .checkbox-container:after{transition:none}}

.section-top .button-show-plan{width:112px!important;min-width:112px;padding:7px 6px!important;box-sizing:border-box;font-size:12px!important;line-height:1.3;overflow-wrap:normal;text-align:left!important}
.pb-rest-dialog .rounded-rectangle{margin:0;padding:0!important;background:transparent!important;color:var(--pb-muted);font:13px/1.65 Arial,sans-serif}

/* Books: quiet copyright disclosure, without the legacy filter header. */
.pb-books .button-filter,.pb-books .dialog-top-bar{display:none!important}
.pb-books #content.content-listview-filtered{height:auto!important}
.pb-books .pb-book-row{position:relative;padding-right:30px}
.pb-books .pb-book-expand{position:absolute;right:0;top:36px;display:grid;place-items:center;width:26px;height:26px;padding:0;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--pb-muted);cursor:pointer}
.pb-book-expand::after{content:"";width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg);transition:transform .25s ease}
.pb-book-expand[aria-expanded=true]::after{transform:translateY(2px) rotate(225deg)}
@media(prefers-reduced-motion:reduce){.pb-book-expand::after{transition:none}}
html.light #divBuild img[src*="/lm/icon_cog_tick.png"]{filter:brightness(.28) sepia(1) saturate(3)}

/* Compact builder controls: levels, hit points and shield hit points. */
html body .pb-builder-dialog{--pb-panel:#171a1e;--pb-surface:#222831;--pb-edge:#394553;--pb-text:#e8edf3;--pb-muted:#abb5c2;--pb-accent:#ff5722;color:var(--pb-text);font:14px/1.5 Arial,sans-serif}
html.light .pb-builder-dialog{--pb-panel:#f7f0df;--pb-surface:#fffaf0;--pb-edge:#d4c3a6;--pb-text:#3c2922;--pb-muted:#806c5d;--pb-accent:#780f12}
html body .pb-builder-dialog>.modal-content{box-sizing:border-box;width:min(480px,calc(100vw - 32px))!important;max-height:calc(100dvh - 32px);overflow:auto;border:1px solid var(--pb-edge);border-radius:14px;background:var(--pb-panel)!important;box-shadow:0 24px 80px #0008}
html body .pb-level-dialog>.modal-content{width:min(540px,calc(100vw - 32px))!important}
html body .pb-builder-dialog .dialog-top-bar{padding:20px 24px 16px;border-bottom:1px solid var(--pb-edge);background:transparent!important}
html body .pb-builder-dialog .dialog-title{margin:0;font:700 20px/1.4 Arial,sans-serif;color:var(--pb-text)}
html body .pb-builder-dialog .pb-dialog-note{margin:8px 0 0;color:var(--pb-muted);font:13px/1.55 Arial,sans-serif}
html body .pb-builder-dialog #content{padding:20px 24px!important}
html body .pb-builder-dialog .rounded-rectangle,html body .pb-builder-dialog .rounded-rectangle-white{box-sizing:border-box;margin:0 0 16px!important;padding:16px!important;border:1px solid var(--pb-edge);border-radius:10px;background:var(--pb-surface)!important;color:var(--pb-text)}
html body .pb-builder-dialog #content>.rounded-rectangle-white.small-text{margin:0!important;padding:0!important;border:0;background:transparent!important;color:var(--pb-muted);font:12px/1.6 Arial,sans-serif}
html body .pb-builder-dialog .grid-container{gap:16px}
html body .pb-builder-dialog h3{margin:0 0 10px;font:600 13px/1.5 Arial,sans-serif;color:var(--pb-muted)}
html body .pb-builder-dialog input.edittext-dark{box-sizing:border-box;width:100%!important;min-width:0;min-height:42px;padding:9px 12px;border:1px solid var(--pb-edge);border-radius:7px;background:var(--pb-panel);color:var(--pb-text);font:16px/1.4 Arial,sans-serif}
html body .pb-builder-dialog .modal-buttons{display:flex;justify-content:flex-end;gap:8px;padding:16px 24px;border-top:1px solid var(--pb-edge);background:transparent!important}
html body .pb-builder-dialog .modal-button{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:auto!important;min-width:92px;min-height:40px;margin:0;padding:9px 14px;border:1px solid var(--pb-edge);border-radius:7px;background:var(--pb-surface);color:var(--pb-text);font:13px/1.4 Arial,sans-serif;cursor:pointer}
html body .pb-hp-dialog .modal-buttons>.modal-button:first-child,html body .pb-shield-hp-dialog .modal-buttons>.modal-button:first-child{background:var(--pb-accent);border-color:var(--pb-accent);color:#fff}
html body .pb-level-dialog .button-bar.rounded-rectangle{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:0!important;padding:0!important;border:0;background:transparent!important}
html body .pb-level-dialog .button-bar>.grid-container,html body .pb-level-dialog .button-bar>.grid-container>.grid-item{display:contents}
html body .pb-level-dialog .pb-level-choice{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;box-sizing:border-box;min-width:0;min-height:62px;margin:0!important;padding:8px!important;border:1px solid var(--pb-edge);border-radius:8px;background:var(--pb-surface);color:var(--pb-text);cursor:pointer}
.pb-level-choice span{font:11px/1.4 Arial,sans-serif;color:var(--pb-muted)}
.pb-level-choice strong{font:600 21px/1.3 Arial,sans-serif}
html body .pb-level-dialog .pb-current-level{border-color:var(--pb-accent);background:color-mix(in srgb,var(--pb-accent) 12%,var(--pb-surface));color:var(--pb-accent)}
html body .pb-level-dialog .pb-current-level span{color:inherit}
/* Let the shield action stay inside its defense card. */
.section-defenses{height:auto!important;min-height:6.5em}
.section-defenses .grid-container:has(>.shield-info){display:flex;align-items:center;gap:8px;margin-top:5px}
.section-defenses .grid-container:has(>.shield-info)>.grid-item{flex:1 1 auto;min-width:0;margin:0;white-space:nowrap;font-size:12px}
.section-defenses .grid-container:has(>.shield-info)>:is(.div-button,.div-button-simple){box-sizing:border-box;padding:6px 8px;line-height:1.4}
@media(forced-colors:active){.pb-level-dialog .pb-current-level{outline:2px solid Highlight;outline-offset:-3px}}

/* A translated casting action needs its own space beside the spell name. */
.spell-button-row{align-items:center}
.spell-button-row>.button-cast{flex:0 0 7.5em;box-sizing:border-box;width:7.5em;min-width:7.5em;padding:6px 8px;white-space:nowrap;line-height:1.4;border-radius:5px;cursor:pointer}
.spell-button-row>.button-spell{flex:0 1 15em;min-width:0}
.spell-button-row>.spell-action-holder{flex:0 0 3em}
.spell-button-row>.spell-detail{min-width:0}
.spell-button-row>.button-cast:not(.invisible):hover{background:rgba(var(--ui-glow),.08)}


/* Use the theme's colors for native dialogs. */
html body .pb-builder-dialog .div-topbar_holder{background:var(--pb-panel)!important;color:var(--pb-text)!important}
html body .pb-builder-dialog .modal-button{color:var(--pb-text)!important}
html body .pb-hp-dialog .modal-buttons>.modal-button:first-child,html body .pb-shield-hp-dialog .modal-buttons>.modal-button:first-child{color:#fff!important}
html body .pb-builder-dialog input.edittext-dark{background:var(--pb-panel)!important;color:var(--pb-text)!important}

/* Keep the summary header in one row in both interface languages. */
html body .section-top{height:auto;min-height:7em}
html body .section-top>div{display:block!important;min-width:0}
html body .section-top>div>div:first-child{display:flex;align-items:stretch;gap:.3em}
html body .section-top>div>div:first-child>div{display:flex!important;align-items:stretch;min-width:0;flex:0 0 auto}
html body .section-top>div>div:first-child>div:last-child{flex:1 1 0}
html body .section-top>div>div:first-child .div-button{box-sizing:border-box;margin:0;height:3.3em;min-height:3.3em;max-height:3.3em}
html body .section-top>div>div:first-child .div-button-simple{margin:0}
html body .section-top .button-name{width:100%;min-width:0}
html body .section-top .speedsizerow{display:flex;flex-wrap:wrap;align-items:flex-start;row-gap:.35em;column-gap:.15em}
html body .section-top .speed-size-section{display:inline-flex;align-items:center;margin-right:.35em;flex:0 0 auto}
html body .section-top .speed-size-img{display:block;height:2.2em;width:auto;align-self:center}
html body .section-top .speed-size-right{display:flex;flex-direction:column;height:auto;line-height:1.2}
html body .section-top .speed-size-label{line-height:1.2}
html body .section-top .ability-span{width:3.4em;max-width:3.6em;margin-right:0;flex:1 0 3em}

/* Headers and spell values share the same column widths, in either locale. */
html body .div-spell-level-new{--pb-spell-cast-width:7.5em;--pb-spell-grid:var(--pb-spell-cast-width) minmax(9em,15em) 3em repeat(4,minmax(0,1fr))}
html body .div-spell-level-new:not(:has(>.spell-button-row>.button-cast:not([hidden]):not(.invisible))){--pb-spell-cast-width:0px}
/* The original hides Save and Area/Targets (.div-spell-extra) at <=1400px and at pixel ratio >=1.2 (Windows 125%);
   then Duration and Range share the space of four columns (owner 08.11: «Сжатие не верное»). Narrow rows (~430px at
   a 1024px window) also let the name share the space, give an empty cast column (cantrips) no width, and cut a
   column title with «…» instead of laying it over the next one. */
@media only screen and (max-width:1400px),(-webkit-min-device-pixel-ratio:1.2){html body .div-spell-level-new{--pb-spell-grid:var(--pb-spell-cast-width) minmax(8em,1fr) 3em repeat(2,minmax(0,1fr))}html body .spell-headers>.spell-header-label{overflow-wrap:anywhere;hyphens:auto;line-height:1.2}}
html body .div-spell-level-new>.spell-button-row,html body .div-spell-level-new>.spell-headers{display:grid;grid-template-columns:var(--pb-spell-grid);column-gap:0;box-sizing:border-box;padding:3px;font-size:1em;align-items:center}
html body .spell-headers>div:first-child{grid-column:span 3;width:auto!important}
html body .spell-headers>.spell-header-label{min-width:0;margin:0;padding:4px 0 4px 8px;font-size:.8em;line-height:1.4;text-align:left}
html body .spell-button-row>.button-cast{grid-column:1;width:auto;min-width:0}
html body .spell-button-row>.button-spell{grid-column:2;box-sizing:border-box;width:auto;min-width:0;margin:0;padding:6px 8px;white-space:normal;overflow-wrap:anywhere}
html body .spell-button-row>.spell-action-holder{grid-column:3;box-sizing:border-box;width:auto;min-width:0;text-align:center}
html body .spell-button-row>.spell-detail{box-sizing:border-box;margin:0;padding:6px 8px;line-height:1.4;text-align:left}
html body .pb-spell-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px;padding:12px}
html body .pb-spell-toolbar>.prof-layout{display:flex;align-items:center;flex-wrap:wrap;justify-content:center;gap:12px;min-width:0;min-height:44px}
html body .pb-spell-toolbar>.prof-layout>.prof-name{box-sizing:border-box;flex:0 1 auto;width:auto!important;height:auto;min-width:0;padding:4px 8px;line-height:1.5;white-space:normal}
html body .pb-spell-toolbar>.prof-layout>.prof-section{flex:0 0 auto;min-width:38px;margin:0;text-align:center}
html body .pb-spell-toolbar .prof-section>.centered-tiny{width:auto!important;line-height:1.5}
html body .pb-spell-toolbar>.div-button-simple{display:inline-flex!important;box-sizing:border-box;align-items:center;justify-content:center;flex:0 0 auto;width:auto!important;max-width:100%;min-height:40px;margin:0!important;padding:8px 14px;line-height:1.4;white-space:normal;text-align:center}

html body .spell-button-row>.spell-detail{white-space:normal;overflow-wrap:anywhere}

/* Match the Russian two-line planner control in English. */
html[lang=en] .section-top .button-show-plan{white-space:pre-line;height:auto;min-height:0;align-self:stretch}
html body .pb-native-folder-control{display:none!important}
html body .pb-folder-actions{display:flex;align-items:center;flex-wrap:nowrap;gap:8px;width:auto;flex:0 1 auto}
html body .pb-folder-actions[hidden],html body .pb-folder-editor[hidden],html body .pb-folder-children[hidden],html body .pb-folder-group[hidden]{display:none!important}
html body .pb-folder-action,html body .pb-folder-editor button{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:7px;width:auto!important;flex:0 0 auto;min-height:38px;margin:0;padding:8px 12px;border:1px solid #485362;border-radius:7px;background:transparent;color:inherit;font:13px/1.3 Arial,sans-serif;cursor:pointer}
html body .pb-folder-action:disabled{opacity:.4;cursor:default}
html body .pb-folder-editor{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin:12px 0}
html body .pb-folder-editor label{display:flex;flex-direction:column;gap:6px;font-size:12px}
html body .pb-folder-editor input{box-sizing:border-box;max-width:100%;width:260px;padding:9px;border:1px solid #647080;border-radius:7px;background:transparent;color:inherit;font:inherit}
html body .pb-folder-editor p{max-width:420px;margin:0;align-self:center;font-size:12px}
html body .pb-folder-row,html body .pb-folder-inline{box-sizing:border-box;display:block;width:100%;padding:13px 12px;margin:5px 0;border:1px solid #68758466;border-radius:9px;background:#77889912;color:inherit;font:inherit;text-align:left;cursor:pointer;transition:background .18s,border-color .18s,box-shadow .18s}
html body .pb-folder-row:hover,html body .pb-folder-selected{background:#df83351a;border-color:#df833580;box-shadow:0 0 10px #df833512}
html body .pb-folder-children{padding-left:14px;border-left:2px solid #df83354d;margin:0 0 12px 10px}
html body .pb-folder-root{padding:10px;margin-bottom:8px;border:1px dashed #76869766;border-radius:8px;font-size:11px;line-height:1.5;opacity:.8}
html body .pb-folder-drop{background:#df83352b!important;border-color:#df8335!important}
html body .pb-character-browser .listview-topdiv[draggable=true]{cursor:grab}

html body .pb-folder-action svg{display:block;width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

html body .pb-character-browser .cloud-browser-controls>.button-text,html body .pb-character-browser .cloud-browser-controls>span:has(select){display:none!important}
html body .pb-character-browser .cloud-browser-controls>select:first-child{width:180px!important}
/* Both toolbar rows share five equal columns. */
html body .pb-character-browser:has(.pb-folder-actions) :is(.cloud-browser-controls,.cloud-browser-filters){display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));align-items:center;gap:8px}
html body .pb-character-browser .pb-folder-actions{display:contents!important}
html body .pb-character-browser .pb-folder-actions[hidden]{display:none!important}
html body .pb-character-browser:has(.pb-folder-actions) :is(.cloud-browser-controls,.cloud-browser-filters)>select,html body .pb-character-browser:has(.pb-folder-actions) .cloud-character-search,html body .pb-character-browser .pb-folder-action{box-sizing:border-box;width:100%!important;min-width:0;height:36px;min-height:36px}
html body .pb-character-browser:has(.pb-folder-actions) .cloud-connect-button{grid-column:1/-1;grid-row:2;justify-self:start}
/* Edit names in the folder row itself; keep the input inside the list pane. */
html body .pb-character-browser .pb-folder-inline{box-sizing:border-box;display:grid;grid-template-columns:17px minmax(0,1fr);align-items:center;gap:6px;width:100%;min-width:0;max-width:100%;padding:9px 12px;margin:5px 0;border-color:var(--pb-accent);background:var(--pb-surface)}
html body .pb-character-browser .pb-folder-inline input{box-sizing:border-box;display:block;width:100%;min-width:0;max-width:100%;height:25px;padding:2px 0;border:0;border-radius:0;background:transparent;color:var(--pb-text);font:inherit;outline:none!important;box-shadow:none!important}
html body .pb-character-browser .pb-folder-inline p{grid-column:1/-1;max-width:100%;overflow-wrap:anywhere;font:12px/1.4 Arial,sans-serif;color:var(--pb-muted)}
html body .pb-character-browser .pb-folder-inline p:empty{display:none}
html body .pb-character-browser .pb-folder-delete{display:flex;flex-wrap:wrap;gap:8px}
html body .pb-character-browser .pb-folder-delete p{flex-basis:100%}
html body .pb-character-browser .pb-folder-inline [hidden],html body .pb-character-browser .pb-folder-row[hidden]{display:none!important}
/* 2026-11-10 (owner): a row of the Load Character window — the name, the place it is kept at the right edge, a small line
   under the name (class and level, ancestry);
   the preview shows the save's portrait at the right, the text flows around it. */
html body .pb-character-browser .div-listview-scroller{flex-basis:40%;width:40%;max-width:470px}
html body .pb-character-browser .div-listview-scroller .listview-topdiv{display:block!important}
html body .pb-character-browser .div-listview-scroller .listview-topdiv[hidden],html body .pb-character-browser .pb-folder-group[hidden]{display:none!important}
html body .pb-character-browser .listview-topdiv .top-div{display:flex;align-items:baseline;gap:12px}
html body .pb-character-browser .listview-topdiv .listview-title{flex:1 1 auto;min-width:0;overflow-wrap:normal;word-break:normal}
html body .pb-character-browser .pb-file-provider{display:block;flex:none;margin:0 0 0 auto;white-space:nowrap;color:var(--pb-muted);font:400 11px/1.4 Arial,sans-serif}
html body .pb-character-browser .pb-file-info{display:block;margin-top:2px;padding-left:5px;color:var(--pb-muted);font:400 11px/1.4 Arial,sans-serif}
html body .pb-character-browser .div-listview-info .pb-load-portrait{float:right;box-sizing:border-box;width:136px;aspect-ratio:2/3;object-fit:cover;margin:10px 0 10px 18px;border:1px solid var(--pb-edge);border-radius:8px;background:var(--pb-panel)}

/* Legal notices and source groups share one accessible disclosure layout. */
.pb-books .pb-license-group,.pb-books .pb-license-orc,.pb-books .pb-license-ogl{padding:0!important;overflow:hidden}
.pb-license-disclosure>summary{display:flex;align-items:center;gap:12px;list-style:none;padding:14px 16px;color:var(--pb-text);font:600 14px/1.5 Arial,sans-serif;cursor:pointer}
.pb-license-disclosure>summary::-webkit-details-marker{display:none}
.pb-license-disclosure>summary:after{content:'';width:7px;height:7px;flex:0 0 7px;margin-left:auto;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg)}
.pb-license-disclosure[open]>summary:after{transform:translateY(2px) rotate(225deg)}
.pb-license-disclosure>summary:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-3px}
.pb-license-disclosure[open]>summary{border-bottom:1px solid var(--pb-edge)}
.pb-license-body{padding:4px 16px 12px;overflow-wrap:anywhere}.pb-license-body>.pb-license-copy{margin:0}
.pb-books .pb-book-expand{top:10px}.pb-books .pb-book-copyright{margin-left:0!important}

/* Keep cloud reauthorization aligned with the character browser footer controls. */
html body .pb-character-browser .modal-buttons>.cloud-connect-button{margin-left:auto;flex:none;align-self:stretch;height:auto;min-height:36px}

/* Recolor only planner gears and hero points in the light theme; preserve image alpha. */
html.light img:is([src*="/icon_cog.png"],[src*="/icon_cog_tick.png"],[src*="/icon_hero_point_on.png"],[src*="/icon_hero_point_off.png"]){filter:url("/assets/images/ui/light-controls-color.svg#burgundy")!important}

/* 2026-11-07 (site audit): section tabs filter the groups; the core books say they are always on. */
.pb-books .pb-book-filtered{display:none!important}
.pb-books .pb-books-note{margin:4px 0 8px;color:var(--pb-muted);font:12px/1.5 Arial,sans-serif}
.pb-books .pb-book-fixed .pb-book-title{cursor:default!important}

/* 2026-11-07 (owner): the native load, save and new character windows never show as they are: hidden until the
   site has dressed them; a window whose dressing failed shows only the error panel. */
.modal.pb-native-load:not(.pb-character-browser):not(.pb-dress-failed),.modal.pb-native-save:not(.pb-save-dialog):not(.pb-dress-failed),.modal.pb-new-character:not([data-pb-decorated]):not(.pb-dress-failed){visibility:hidden!important}
.modal.pb-dress-failed>.modal-content>:not(.pb-dress-error){display:none!important}
.pb-dress-error{display:flex;flex-direction:column;gap:12px;align-items:flex-start;padding:20px 24px;font:14px/1.5 Arial,sans-serif}
.pb-dress-error p{margin:0}
/* 2026-11-08 (owner): «Сохранить персонажа?» before another character is opened - the storage choice's look. */
.pb-save-prompt>.modal-content{display:flex;flex-direction:column;width:min(620px,calc(100vw - 32px))!important;height:auto;max-height:calc(100dvh - 32px);overflow-y:auto;margin:auto;background:var(--pb-panel)!important}
.pb-save-prompt .dialog-top-bar{display:flex;flex-direction:column;gap:12px;padding-bottom:18px}
.pb-save-prompt-intro,.pb-save-prompt-signin p{margin:0;font:14px/1.5 Arial,sans-serif;color:var(--pb-muted)}
.pb-save-prompt-choices{display:flex;flex-direction:column;gap:8px}
.pb-save-prompt-choice{display:flex;align-items:center;gap:10px;cursor:pointer;font:15px/1.4 Arial,sans-serif}
.pb-save-prompt-choice input{width:18px;height:18px;margin:0;accent-color:#ff5722}
.pb-save-prompt-cloud{display:flex;flex-direction:column;gap:10px;padding-left:28px}
.pb-save-prompt-cloud select{width:auto!important;min-width:200px;max-width:100%}
.pb-save-prompt-providers{display:flex;flex-wrap:wrap;gap:10px}
.pb-save-prompt-providers .modal-button{width:auto!important;min-width:0;padding:8px 14px;cursor:pointer}
.pb-save-prompt-providers .modal-button:disabled{opacity:.4;cursor:default}
.pb-save-prompt .modal-buttons{justify-content:flex-start;align-items:center;gap:10px;flex-wrap:wrap;border-top:1px solid var(--pb-edge)}
.pb-save-prompt .modal-buttons .modal-button{flex:0 0 auto;min-width:140px;width:auto!important;cursor:pointer}
.pb-save-prompt .modal-button:disabled{opacity:.4;cursor:default}
.pb-save-prompt .pb-storage-home{margin-left:auto;width:auto!important;color:var(--pb-muted);background:transparent;border:0;padding:8px 0;font:13px/1.5 Arial,sans-serif;box-shadow:none;cursor:pointer}
/* 2026-11-11 (owner, b46 «кнопки»): one order everywhere — the main button first on the left, then «Отмена» / «Назад»,
   then the rest, in one line; «Назад» is a real secondary button, not grey text on the right. */
.pb-character-settings .modal-buttons,.pb-books .modal-buttons,.pb-save-dialog .modal-buttons,.pb-rest-dialog .modal-buttons,html body .pb-builder-dialog .modal-buttons{justify-content:flex-start}
.pb-storage-choice .pb-storage-home,.pb-save-prompt .pb-storage-home{margin-left:0;min-width:7.5em;min-height:2.5em;padding:.45em 1.1em;border:1px solid #3b4b5e;border-radius:7px;background:transparent;color:inherit;font:inherit;text-decoration:none;box-shadow:none}
.pb-storage-choice .pb-storage-home:hover,.pb-save-prompt .pb-storage-home:hover{background:rgba(255,255,255,.06);border-color:#6b7d93;text-decoration:none}
:root.light .pb-storage-choice .pb-storage-home,:root.light .pb-save-prompt .pb-storage-home{border-color:#c4b49b;color:#292523}
/* 2026-11-11 (owner, b46 «окна-формы»): the save window's lists have captions */
.pb-save-field{display:flex;flex-direction:column;gap:.35em;flex:1 1 0;min-width:0}
.pb-save-field>select{width:100%}
.pb-save-caption{color:var(--pb-muted,#9aa6b5);font-size:.78em;letter-spacing:.06em;text-transform:uppercase;font-weight:600}
.pb-save-source { display: block; font-size: .78em; opacity: .68; }
/* Native dialogs use the same palette and button hierarchy as the site's other windows. */
html body dialog.pb-save-choice{--pb-panel:#222831;--pb-footer:#171a1e;--pb-text:#edf1f7;--pb-edge:#3b4b5e;--pb-button-edge:#4a5b70;--pb-accent:#ff5722;box-sizing:border-box;width:min(540px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 32px);margin:auto;padding:0;border:1px solid var(--pb-edge);border-radius:12px;overflow:auto;background:var(--pb-panel);color:var(--pb-text);font:14px/1.5 Arial,sans-serif;box-shadow:0 18px 50px #0008}
html body dialog.pb-save-choice::backdrop{background:rgba(8,10,13,.62)}
html body dialog.pb-save-choice h2{margin:0;padding:24px;color:var(--pb-text);font:600 21px/1.3 Arial,sans-serif;text-shadow:none}
html body dialog.pb-save-choice>div{display:flex;flex-wrap:wrap;gap:10px;padding:16px 24px;background:var(--pb-footer);border-top:1px solid var(--pb-edge)}
html body dialog.pb-save-choice>div>button.modal-button{box-sizing:border-box;flex:1 1 7.5em;float:none;width:auto;max-width:100%;min-width:0;min-height:42px;height:auto;max-height:none;margin:0;padding:10px 12px;border:1px solid var(--pb-button-edge);border-radius:8px;background:transparent;color:var(--pb-text)!important;font:500 14px/1.4 Arial,sans-serif;white-space:normal;text-align:center;text-shadow:none;box-shadow:none;cursor:pointer}
html body dialog.pb-save-choice:not(.pb-storage-choice)>div>button.modal-button:first-child{background:var(--pb-accent);border-color:var(--pb-accent);color:#fff!important}
html body dialog.pb-save-choice>div>button.modal-button:hover{border-color:var(--pb-accent);filter:brightness(1.08)}
html body dialog.pb-save-choice>div>button.modal-button:focus-visible{outline:2px solid var(--pb-accent);outline-offset:3px}
html.light body dialog.pb-save-choice{--pb-panel:#f9f7ec;--pb-footer:#f1debe;--pb-text:#292523;--pb-edge:#d8c4a0;--pb-button-edge:#c4b49b;--pb-accent:#500000;box-shadow:none}
html.light body dialog.pb-save-choice::backdrop{background:rgba(60,45,30,.4)}
@media(max-width:480px){html body dialog.pb-save-choice>div{flex-direction:column;padding:16px}html body dialog.pb-save-choice h2{padding:20px 16px}html body dialog.pb-save-choice>div>button.modal-button{flex:auto;width:100%}}

.pb-character-browser .pb-linked-save-locations{display:block;color:var(--pb-muted);font-size:11px;line-height:1.4;overflow-wrap:anywhere}

html body dialog.pb-storage-choice { width:min(390px,calc(100vw - 28px)); padding:17px; }
html body dialog.pb-storage-choice h2 { font-size:17px; padding:0; }
html body dialog.pb-storage-choice .pb-storage-character {
 margin:5px 0 0; color:var(--pb-text); opacity:.8; overflow-wrap:anywhere;
}
html body dialog.pb-storage-choice>div {
 display:grid; grid-template-columns:minmax(0,1fr); gap:6px;
 padding:0; margin-top:14px; background:transparent; border:0;
}
html body dialog.pb-storage-choice>div>button.modal-button {
 display:flex; align-items:center; gap:9px; min-height:38px; padding:8px 11px;
 border-color:var(--pb-edge); background:transparent; color:var(--pb-text)!important; text-align:start;
}
html body dialog.pb-storage-choice>div>button.modal-button:hover { border-color:var(--pb-accent); }
html body dialog.pb-storage-choice button:is([data-storage-option=google],[data-storage-option=yandex],[data-storage-option=server])::before {
 content:""; width:16px; height:16px; flex:none; border-radius:3px;
 background:var(--pb-accent);
 mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' d='M3 7h18v13H3zM3 7V4h7l3 3m-5 7h8'/%3E%3C/svg%3E") center/contain no-repeat;
}
html body dialog.pb-storage-choice>div>button.modal-button[data-storage-option=cancel] {
 justify-content:center; margin-top:3px;
 background:var(--shop-action,var(--pb-accent)); border-color:transparent;
 color:var(--shop-on-accent,#fff)!important;
}
html.light body dialog.pb-storage-choice>div>button.modal-button[data-storage-option=cancel] {
 color:var(--shop-on-accent,#fff)!important;
}
html body dialog.pb-storage-choice>div>button[data-storage-option=remove] { border-color:#c36154; }

/* The edition groups and their individual attribution disclosures have separate controls. */
html body .pb-books .div-topbar_holder{padding:0!important}
html body .pb-books .pb-books-heading{margin:0;padding:12px 16px;font:inherit;font-size:1.18rem;font-weight:700;line-height:1.35}
html body .pb-books #content{padding:12px 16px!important;scrollbar-gutter:stable}
html body .pb-books #content>.scrollable{margin:0!important;padding:0!important}
html body .pb-books .pb-license-group,html body .pb-books .pb-license-orc,html body .pb-books .pb-license-ogl{margin:0 0 8px!important;padding:0!important;border-radius:7px}
html body .pb-books .pb-license-disclosure>summary{padding:10px 14px;font:inherit;font-weight:650}
html body .pb-books .pb-license-body{padding:0 14px 4px}
html body .pb-books .pb-book-row{padding:9px 0!important}
html body .pb-books .pb-book-title{min-height:22px;align-items:center;gap:7px;font:inherit;font-weight:600}
html body .pb-books .pb-book-row:has(.pb-book-expand:not([hidden])) .pb-book-title{padding-inline-end:34px}
html body .pb-books .pb-book-title>.checkbox-container:has(img[style*="display: none"]){display:none}
html body .pb-books .pb-book-copyright{box-sizing:border-box;display:block;margin:3px 0 0!important;padding:0!important;font:inherit;font-size:.85em;line-height:1.5;max-height:none;color:var(--pb-muted);user-select:text;cursor:text!important}
html body .pb-books .pb-book-copyright.section15{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden}
html body .pb-books .pb-book-copyright:hover{outline:none!important;box-shadow:none!important;text-shadow:none!important;background:transparent!important}
html body .pb-books .pb-book-expand{top:5px;right:0;width:32px;height:30px;border:0;box-shadow:none;background:transparent}
html body .pb-books .pb-book-expand[hidden]{display:none!important}
html body .pb-books .pb-book-expand:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-2px}
@media(max-width:600px){
 html body .pb-books #content{padding:8px!important}
 html body .pb-books .pb-license-body{padding-inline:10px}
 html body .pb-books .pb-book-expand{width:38px;height:36px;top:2px}
 html body .pb-books .pb-book-row:has(.pb-book-expand:not([hidden])) .pb-book-title{padding-inline-end:40px}
}

html body .pb-books .pb-license-body .grid-container:has(>.grid-item){
 display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;
 width:min(100%,18rem);box-sizing:border-box;margin:0!important;padding:10px 0 6px!important;gap:8px;
}
html body .pb-books .pb-license-body .grid-container>.grid-item{
 display:flex;align-items:center;justify-content:center;text-align:center;box-sizing:border-box;
 margin:0!important;padding:5px 10px!important;min-height:32px;min-width:0;width:100%!important;line-height:1.25;
}

/* Live storage checks share the load dialog footer with the character actions. */
html body .pb-character-browser .modal-buttons:has(>.pb-storage-status){flex-wrap:wrap}
html body .pb-character-browser .modal-buttons>.pb-storage-status{
 order:100;flex:1 1 15rem;min-width:0;align-self:center;margin:0 0 0 auto;
 display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px 8px;text-align:right;
}
html body .pb-character-browser .pb-storage-status>[role=status]{overflow-wrap:anywhere}
html body .pb-character-browser .pb-storage-status>button{flex:none;margin:0}
html body .pb-character-browser .pb-storage-status[hidden],
html body .pb-character-browser .pb-storage-status>button[hidden]{display:none!important}

body > #ring-holder.pb-busy-in-preview {display:none!important}
html body .modal .div-listview-info:has(> .pb-preview-busy:only-child) {
 display:grid;place-items:center;
}
.pb-preview-busy {display:none}
.div-listview-info > .pb-preview-busy:only-child {
 display:grid;justify-items:center;gap:12px;text-align:center;
 color:var(--pb-muted,inherit);font-size:.95em;line-height:1.4;
}
.pb-preview-busy::before {
 content:"";width:32px;height:32px;box-sizing:border-box;border:2px solid transparent;
 border-top-color:var(--shop-accent,var(--pb-accent,#ff5722));border-right-color:var(--shop-accent,var(--pb-accent,#ff5722));
 border-radius:50%;animation:pb-preview-spin .9s linear infinite;
}
@keyframes pb-preview-spin {to {transform:rotate(1turn)}}
@media(prefers-reduced-motion:reduce){.pb-preview-busy::before{animation:none}}
