.sheet-toolbar{flex-wrap:wrap}.sheet-toolbar>.actions{flex-wrap:wrap;justify-content:flex-end}.sheet-view-note{font-size:12px;color:var(--muted);line-height:1.6;margin:0 0 16px}.mosaic-data-actions{flex-wrap:wrap;margin-bottom:15px}
.sheet-mosaic{--sheet-deep:#482860;--sheet-glow:#a85cf439;--sheet-accent:#bd94ff;--sheet-bright:#bd94ff;padding:14px;border:1px solid #655073;border-radius:15px;background:linear-gradient(155deg,#24182ec9,#0c0d18ed),url('/cover.webp') center/cover;color:#f2ebfb}
.sheet-mosaic[data-background=plain]{background:#181420}.sheet-mosaic[data-background=midnight]{background:linear-gradient(135deg,#0c1425,#11101c)}.sheet-mosaic[data-background=parchment]{background:radial-gradient(ellipse at 15% 0,#bd956047,transparent 60%),#493b2e;border-color:#a58353}
.sheet-mosaic-canvas{height:var(--mosaic-height);min-width:0;position:relative}.sheet-node-split{display:grid;min-width:0;min-height:0;width:100%;height:100%}.sheet-node-split.axis-x{grid-template-columns:minmax(0,var(--split-a)) var(--mosaic-gap) minmax(0,var(--split-b));grid-template-rows:minmax(0,1fr)}.sheet-node-split.axis-y{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,var(--split-a)) var(--mosaic-gap) minmax(0,var(--split-b))}
.sheet-node-leaf{display:grid;grid-template-rows:auto minmax(0,1fr);min-width:0;min-height:0;position:relative;border:1px solid #9b7db23d;border-radius:var(--mosaic-radius);background:linear-gradient(145deg,#2b2334f7,#1c1927f7);overflow:hidden;box-shadow:0 4px 14px #100b1755}
.sheet-tile-header{display:flex;align-items:center;gap:6px;padding:6px 8px;min-width:0;background:#49335740;border-bottom:1px solid #90709d26;min-height:36px}.sheet-tile-header h2{font:600 12px/1.4 'DM Sans',system-ui,sans-serif;margin:0;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1;color:var(--sheet-accent)}
.sheet-tile-button,.sheet-drag-handle{border:1px solid #9879ac44;border-radius:5px;background:#19132066;color:#d8c7e8;min-width:26px;min-height:26px;font:15px/1 system-ui,sans-serif;padding:3px;flex:none}.sheet-drag-handle{cursor:grab;touch-action:none;user-select:none}.sheet-drag-handle:active{cursor:grabbing}.sheet-node-leaf.is-dragging{opacity:.45}
.sheet-tile-content{display:grid;gap:12px;align-content:start;padding:12px;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}.sheet-tile-content[hidden]{display:none}.sheet-tile-content label{display:grid;gap:5px;font-size:12px}.sheet-tile-content label.check{display:flex}.sheet-tile-content input,.sheet-tile-content select{min-width:0;max-width:100%}.sheet-tile-content .sheet-section+.sheet-section{padding-top:8px}.sheet-tile-content .sheet-section-heading{flex-wrap:wrap}.sheet-tile-content .actions{flex-wrap:wrap}.sheet-tile-content .stat-tile{min-height:55px}.sheet-tile-content .ability-card{font-size:12px}.sheet-tile-content .die-grid{max-width:280px;width:100%;justify-self:center}
.sheet-mosaic[data-density=compact] .sheet-tile-content{padding:7px;gap:7px}.sheet-mosaic[data-density=compact] .sheet-tile-header{min-height:30px;padding:3px 6px}.sheet-mosaic[data-font=serif] .sheet-tile-content{font-family:Georgia,serif}.sheet-mosaic[data-font=mono] .sheet-tile-content{font-family:ui-monospace,SFMono-Regular,monospace}.sheet-mosaic[data-font=serif] .sheet-tile-content :is(button,input,select,textarea),.sheet-mosaic[data-font=mono] .sheet-tile-content :is(button,input,select,textarea){font-family:inherit}
.mosaic-identity{display:grid;gap:8px;text-align:center;justify-items:center}.mosaic-identity h1{font-size:30px;overflow-wrap:anywhere;max-width:100%}.mosaic-portrait{display:grid;justify-items:center;align-content:center;gap:10px}.mosaic-portrait .sheet-portrait{width:min(180px,100%);max-width:100%;flex:none}.sheet-mosaic[data-portrait-shape=circle] .sheet-portrait{border-radius:50%}.sheet-mosaic[data-portrait-shape=square] .sheet-portrait{border-radius:3px}.sheet-mosaic[data-portrait-shape=rounded] .sheet-portrait{border-radius:22px}
.sheet-split-bar{position:relative;min-height:0;min-width:0}.sheet-split-bar>button{display:none}.is-arranging .axis-x>.sheet-split-bar{cursor:col-resize;touch-action:none}.is-arranging .axis-y>.sheet-split-bar{cursor:row-resize;touch-action:none}.is-arranging .sheet-split-bar:before{content:'';position:absolute;inset:2px 35%;border-radius:8px;background:#a98aba60}.is-arranging .axis-y>.sheet-split-bar:before{inset:35% 2px}.is-arranging .sheet-split-bar:hover:before,.is-arranging .sheet-split-bar:focus-visible:before{background:var(--sheet-accent)}.is-arranging .sheet-split-bar>button{display:block;position:absolute;z-index:3;top:50%;left:50%;transform:translate(-50%,-50%);border:1px solid #b993d7;border-radius:6px;background:#382747;color:#f4e6ff;min-width:25px;min-height:25px;font-size:14px;opacity:0}.is-arranging .sheet-split-bar:hover>button,.is-arranging .sheet-split-bar:focus-within>button{opacity:1}
.sheet-node-leaf[data-drop-edge]:after{content:'';pointer-events:none;position:absolute;z-index:5;background:#b18aee44;border:2px solid #d5b5ff;border-radius:inherit;inset:0;box-shadow:inset 0 0 20px #d2afff22}.sheet-node-leaf[data-drop-edge=left]:after{right:50%}.sheet-node-leaf[data-drop-edge=right]:after{left:50%}.sheet-node-leaf[data-drop-edge=top]:after{bottom:50%}.sheet-node-leaf[data-drop-edge=bottom]:after{top:50%}
.sheet-layout-editor{margin-bottom:16px;padding:16px;border:1px solid #a27dbb;border-radius:13px;background:#292033}.mosaic-edit-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}.mosaic-edit-heading>div:first-child{max-width:650px}.mosaic-edit-heading strong{font-size:15px;color:#e6cff9}.mosaic-edit-heading p,.mosaic-status{font-size:12px;color:#beadca;line-height:1.6;margin-top:7px}.mosaic-edit-heading>.actions{flex-wrap:wrap}.mosaic-status{padding:9px 11px;border-radius:7px;background:#19121f;color:#e4c9fa}.mosaic-editor-sections{display:grid;gap:9px;margin-top:13px}.mosaic-editor-sections>details{padding:10px;border:1px solid #80619655;border-radius:8px;background:#21182b}.mosaic-editor-sections summary{cursor:pointer;font-size:13px;color:#e8daf3;min-height:24px}.mosaic-editor-sections .muted{font-size:11px;line-height:1.6;margin-top:10px}.mosaic-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:13px}.mosaic-options label,.mosaic-editor-sections form>label{display:grid;gap:6px;font-size:12px}.mosaic-options input,.mosaic-options select{max-width:100%;width:100%;min-height:38px}.mosaic-module-library{display:grid;gap:7px;max-height:380px;overflow:auto;margin-top:12px}.mosaic-module-library>div{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:center;padding:5px;border-bottom:1px solid #ffffff0a}.mosaic-module-library label{font-size:12px;overflow-wrap:anywhere}.mosaic-module-library input[type=text]{min-width:0;width:100%;font-size:12px}.mosaic-editor-sections form{display:grid;grid-template-columns:1fr 160px 1fr auto;gap:10px;align-items:end;margin:12px 0}.mosaic-empty{font-size:13px;color:#b6a7c7;line-height:1.7;padding:24px}
@media(max-width:1050px){.mosaic-edit-heading{flex-direction:column}.mosaic-options{grid-template-columns:repeat(2,minmax(0,1fr))}.mosaic-editor-sections form{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:730px){.sheet-mosaic{padding:8px}.sheet-mosaic-canvas{height:auto}.sheet-mosaic .sheet-node-split{display:flex;flex-direction:column;height:auto;gap:var(--mosaic-gap)}.sheet-mosaic .sheet-split-bar{display:none}.sheet-node-leaf{min-height:90px;max-height:none}.sheet-tile-content{max-height:none;overflow:visible;padding:12px}.sheet-tile-header{min-height:42px}.sheet-tile-header h2{font-size:13px}.sheet-tile-button,.sheet-drag-handle{min-width:36px;min-height:36px}.mosaic-module-library>div{grid-template-columns:minmax(0,1fr)}.mosaic-module-library label{min-height:40px}.mosaic-options,.mosaic-editor-sections form{grid-template-columns:minmax(0,1fr)}.mosaic-options input,.mosaic-options select,.mosaic-editor-sections form select{min-height:44px;font-size:16px}.sheet-toolbar>.actions{justify-content:flex-start}.sheet-layout-editor{padding:12px}.mosaic-edit-heading .actions .btn{min-height:42px}.sheet-tile-content .skill-row{min-height:46px}.sheet-mosaic .sheet-portrait{width:min(200px,70vw)}}

.sheet-mosaic-canvas>.sheet-node-leaf{height:100%}@media(max-width:730px){.sheet-mosaic-canvas>.sheet-node-leaf{height:auto}}
/* Default editor: ordered blocks, automatic heights and responsive widths. */
.sheet-mosaic.layout-grid{container-type:inline-size}
.sheet-mosaic-grid{display:grid;grid-template-columns:repeat(var(--mosaic-columns),minmax(0,1fr));gap:var(--mosaic-gap);align-items:start}
.layout-grid .sheet-node-leaf{display:flex;flex-direction:column;min-height:0;height:auto;align-self:start}
.layout-grid .sheet-tile-content{overflow:visible;height:auto;max-height:none;flex:1}
.sheet-tile-header{grid-row:1}.sheet-block-options{grid-row:2}.sheet-tile-content{grid-row:3}.layout-tiling .sheet-node-leaf{grid-template-rows:auto auto minmax(0,1fr)}
.sheet-block-options{padding:12px;background:#17111f;border-bottom:1px solid #8d699c44;display:grid;gap:10px}.sheet-block-options[hidden]{display:none}.sheet-block-options label{display:grid;gap:5px;font-size:12px}.sheet-block-options input,.sheet-block-options select{width:100%;min-width:0;min-height:40px}.sheet-block-options .actions{flex-wrap:wrap}
.sheet-tile-header .sheet-tile-button,.sheet-drag-handle{min-width:30px;min-height:30px}.sheet-tile-button:disabled{opacity:.3;cursor:default}
.sheet-node-leaf[data-drop-edge=before]:after,.sheet-node-leaf[data-drop-edge=after]:after{height:5px;left:0;right:0;border:0;background:var(--sheet-accent);box-shadow:0 0 12px #d2afff55;border-radius:5px;bottom:auto}
.sheet-node-leaf[data-drop-edge=after]:after{top:auto;bottom:0}
.mosaic-edit-heading{position:sticky;top:8px;z-index:8;background:#292033f5;padding:10px;border:1px solid #82609677;border-radius:10px;box-shadow:0 5px 15px #0003}.mosaic-edit-heading p{max-width:620px}
.mosaic-quick-setup{display:flex;gap:14px;flex-wrap:wrap;margin-top:15px}.mosaic-quick-setup label{display:grid;gap:5px;font-size:12px;min-width:190px}.mosaic-quick-setup select{min-height:42px}
.mosaic-fine-tuning{margin-top:15px;border-top:1px solid #80619644;padding-top:10px}.mosaic-fine-tuning summary{font-size:12px;color:#bfa9d0}
.mosaic-library-search{display:grid;gap:6px;font-size:12px;margin-top:12px;max-width:400px}.mosaic-library-search input{min-height:40px}
.mosaic-module-library{grid-template-columns:repeat(3,minmax(0,1fr));max-height:320px}.mosaic-module-library>.check{font-size:12px;min-height:40px;padding:7px;border:1px solid #70518344;border-radius:7px}.mosaic-module-library>[hidden]{display:none}
@container (max-width:850px){.sheet-mosaic-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sheet-mosaic-grid>.sheet-node-leaf{grid-column:span 1!important}.sheet-mosaic-grid>.sheet-node-leaf[data-span="2"],.sheet-mosaic-grid>.sheet-node-leaf[data-span="3"]{grid-column:1/-1!important}}
@container (max-width:560px){.sheet-mosaic-grid{grid-template-columns:minmax(0,1fr)}.sheet-mosaic-grid>.sheet-node-leaf{grid-column:1/-1!important}.sheet-tile-content .die-grid{max-width:260px}}
.layout-grid[data-columns="1"] .sheet-mosaic-grid{grid-template-columns:minmax(0,1fr)}.layout-grid[data-columns="1"] .sheet-mosaic-grid>.sheet-node-leaf{grid-column:1/-1!important}
@media(max-width:850px){.mosaic-module-library{grid-template-columns:repeat(2,minmax(0,1fr))}.mosaic-edit-heading{top:5px}}
@media(max-width:730px){.mosaic-edit-heading{position:static}.mosaic-edit-heading>.actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:5px}.mosaic-edit-heading .btn{font-size:12px;padding-inline:6px}.mosaic-quick-setup{display:grid;grid-template-columns:minmax(0,1fr)}.mosaic-quick-setup label{min-width:0}.sheet-tile-header .sheet-tile-button,.sheet-drag-handle{min-width:38px;min-height:40px}.sheet-block-options input,.sheet-block-options select{font-size:16px;min-height:44px}.mosaic-module-library{grid-template-columns:minmax(0,1fr);max-height:none}.sheet-mosaic-grid{grid-template-columns:minmax(0,1fr)}.sheet-mosaic-grid>.sheet-node-leaf{grid-column:1/-1!important}}
.mosaic-mobile-actions{display:none}
@media(max-width:730px){.mosaic-mobile-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:14px;padding-bottom:10px}.mosaic-mobile-actions .btn{min-height:44px;font-size:12px;padding-inline:6px}}
/* Packed blocks fill vertical gaps instead of sharing a tall CSS grid row. */
.sheet-mosaic-grid.is-packed{display:block;position:relative;min-height:40px}
.sheet-mosaic-grid.is-packed>.sheet-node-leaf{position:absolute;align-self:auto;margin:0;will-change:transform}
.sheet-mosaic-grid.is-packed>.sheet-node-leaf.is-dragging{opacity:.3;border-style:dashed;box-shadow:inset 0 0 24px #b18aea22}
.sheet-drag-ghost{position:fixed;z-index:80;max-width:200px;pointer-events:none;padding:14px 18px;background:#30213ff5;border:1px solid #d3b1fa;border-radius:12px;color:#f7efff;font:600 13px system-ui,sans-serif;box-shadow:0 12px 32px #0008;overflow-wrap:anywhere}
@media(prefers-reduced-motion:reduce){.sheet-mosaic-grid.is-packed>.sheet-node-leaf{will-change:auto}}
/* The same section palette is used in both reading modes. */
.sheet-stage,.sheet-mosaic{--tone-attributes:#7dd3fc;--tone-resources:#6ee7b7;--tone-skills:#a5b4fc;--tone-abilities:#fbbf24;--tone-dice:#c4b5fd;--tone-story:#f9a8d4;--tone-identity:var(--sheet-accent)}
:is(.sheet-stage,.sheet-mosaic) [data-sheet-tone=identity]{--section-accent:var(--tone-identity)}
:is(.sheet-stage,.sheet-mosaic) [data-sheet-tone=attributes]{--section-accent:var(--tone-attributes)}
:is(.sheet-stage,.sheet-mosaic) [data-sheet-tone=resources]{--section-accent:var(--tone-resources)}
:is(.sheet-stage,.sheet-mosaic) [data-sheet-tone=skills]{--section-accent:var(--tone-skills)}
:is(.sheet-stage,.sheet-mosaic) [data-sheet-tone=abilities]{--section-accent:var(--tone-abilities)}
:is(.sheet-stage,.sheet-mosaic) [data-sheet-tone=dice]{--section-accent:var(--tone-dice)}
:is(.sheet-stage,.sheet-mosaic) [data-sheet-tone=story]{--section-accent:var(--tone-story)}
.sheet-node-leaf{border-color:color-mix(in srgb,var(--section-accent,var(--sheet-accent)) 40%,#302738);border-top:3px solid var(--section-accent,var(--sheet-accent))}
.sheet-node-leaf .sheet-tile-header{background:color-mix(in srgb,var(--section-accent,var(--sheet-accent)) 12%,#201929);border-bottom-color:color-mix(in srgb,var(--section-accent,var(--sheet-accent)) 25%,transparent)}
.sheet-node-leaf .sheet-tile-header h2{color:var(--section-accent,var(--sheet-accent))}
.sheet-node-leaf>.sheet-tile-content [data-sheet-tone]{--section-accent:inherit}
:is(.sheet-stage,.sheet-mosaic) .stat-tile{border-color:color-mix(in srgb,var(--section-accent,var(--sheet-accent)) 38%,#35283e);background:color-mix(in srgb,var(--section-accent,var(--sheet-accent)) 6%,#1a1722)}
:is(.sheet-stage,.sheet-mosaic) .stat-tile strong{color:var(--section-accent,var(--sheet-accent))}
:is(.sheet-stage,.sheet-mosaic) .sheet-resource-heading>strong,:is(.sheet-stage,.sheet-mosaic) .sheet-value>strong{color:var(--section-accent,var(--sheet-accent))}
.sheet-stage .sheet-panel{border-top:3px solid var(--section-accent,var(--sheet-accent))}
.sheet-stage .sheet-panel-header h2,.sheet-stage .sheet-tab[aria-pressed=true]{background:color-mix(in srgb,var(--section-accent,var(--sheet-accent)) 22%,#24172d);border-color:var(--section-accent,var(--sheet-accent));color:#fff}
:is(.sheet-stage,.sheet-mosaic) .skill-total{color:var(--tone-skills);border-color:color-mix(in srgb,var(--tone-skills) 50%,transparent)}
:is(.sheet-stage,.sheet-mosaic) .skill-row.favorite{border-color:var(--tone-skills)}
:is(.sheet-stage,.sheet-mosaic) .ability-card{border-left:3px solid var(--tone-abilities)}
:is(.sheet-stage,.sheet-mosaic) .saved-roll-card{border-left:3px solid var(--tone-dice)}
.sheet-accent-swatches{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}.sheet-accent-swatches button{width:30px;height:30px;border:2px solid #fff7;border-radius:50%;box-shadow:0 2px 7px #0004}.sheet-accent-swatches button:hover,.sheet-accent-swatches button:focus-visible{outline:2px solid #f4e5ff;outline-offset:3px}
@media(max-width:730px){.sheet-accent-swatches button{width:36px;height:36px}}

:is(.sheet-stage,.sheet-mosaic) .resource-meter{border-color:color-mix(in srgb,var(--resource-color,var(--section-accent,var(--tone-resources))) 50%,#20362e);background:color-mix(in srgb,var(--resource-color,var(--section-accent,var(--tone-resources))) 12%,#17231e)}
:is(.sheet-stage,.sheet-mosaic) .resource-meter .resource-fill{background:linear-gradient(90deg,color-mix(in srgb,var(--resource-color,var(--section-accent,var(--tone-resources))) 38%,#10251e),color-mix(in srgb,var(--resource-color,var(--section-accent,var(--tone-resources))) 38%,#18271f))}

.sheet-resource-heading{display:flex;align-items:center;gap:8px;min-width:0}
.sheet-resource-heading>strong{font-size:12px;overflow-wrap:anywhere}
.resource-color-button{display:grid;place-items:center;margin-left:auto;min-width:32px;min-height:32px;padding:6px;background:#171521;border:1px solid #ffffff30;border-radius:7px;cursor:pointer}
.resource-color-button span,.sheet-accent-button span{display:block;width:14px;height:14px;border-radius:50%;background:var(--resource-color,var(--sheet-accent));border:1px solid #ffffff70;box-shadow:0 0 0 2px #0003}
.sheet-accent-button{display:inline-flex;align-items:center;gap:8px;margin-top:8px}
.resource-critical-label{font-size:10px;line-height:1.4;font-weight:700;letter-spacing:.03em;color:#ffb4b4;border:1px solid #e9868666;background:#642d3d55;border-radius:4px;padding:2px 5px}
.resource-meter.is-critical{border-color:#dc7777!important}
.resource-meter.is-critical:after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:#e44e6014;box-shadow:inset 0 0 0 1px #f58a8a80;animation:resource-critical-pulse 2.4s ease-in-out infinite;z-index:-1}
@keyframes resource-critical-pulse{0%,100%{opacity:.25}50%{opacity:1}}
.sheet-color-picker{display:flex;align-items:center;justify-content:space-between;gap:12px}
.sheet-color-picker input[type=color]{width:52px;height:38px;min-width:52px;padding:3px;cursor:pointer;border:1px solid #ffffff40;border-radius:8px;background:#171521}
.resource-style-list{display:grid;gap:14px}
.resource-style-row{margin:0;min-width:0;padding:12px;border:1px solid #ffffff26;border-radius:10px;background:#17152166}
.resource-style-row legend{padding:0 6px;color:#eee5f8;font-size:13px;font-weight:600}
.resource-style-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:center}
.resource-style-controls .check-line{grid-column:1/-1;display:flex;align-items:center;gap:8px}
.resource-style-controls input[type=checkbox]{width:18px;height:18px}
@media(max-width:420px){.resource-style-controls{grid-template-columns:minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){.resource-meter.is-critical:after{animation:none;opacity:.65}.resource-fill{transition:none!important;animation:none!important}}
