/* Four simultaneous panels. No tab hides another part of the character. */
.lore-r9.lore-workbench {grid-template-rows:auto minmax(0,1fr) auto}
.lore-r9 .lore-tabs {display:none}
.lore-r9 .lore-body {display:grid;grid-template-columns:.78fr 1fr 1fr;grid-template-rows:minmax(160px,.7fr) minmax(0,1.3fr);gap:12px;padding:12px;min-height:0;overflow:hidden}
.lore-r9 .lore-showcase {grid-column:1;grid-row:1/3;height:auto!important;border:1px solid var(--line);border-radius:24px;padding:10px 14px;min-height:0}
.lore-r9 .lore-reading {display:contents!important}
.lore-r9 .lore-showcase-foot {min-height:0;display:block;text-align:center}
.lore-r9 .lore-showcase-foot p {max-width:none;font-size:11px;margin:5px 0}
.lore-r9 .lore-showcase-foot .btn {display:none}
.lore-r9 .lore-panel {display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-height:0;min-width:0;padding:14px 16px;border:1px solid var(--edge);border-radius:23px;background:linear-gradient(135deg,var(--surface),var(--panel-bottom));overflow:hidden;margin:0!important}
.lore-r9 .lore-panel-history {grid-column:2/4;grid-row:1}
.lore-r9 .lore-panel-facts {grid-column:2;grid-row:2}
.lore-r9 .lore-panel-relations {grid-column:3;grid-row:2}
.lore-r9 .lore-panel-head {margin-bottom:8px;min-height:22px;display:flex;align-items:center}
.lore-r9 .lore-panel-head h3 {font-size:16px;margin:0;line-height:1.2}
.lore-r9 .lore-panel-content {min-height:0;overflow:hidden}
.lore-r9 .lore-panel-content p {font-size:clamp(12px,1vw,15px);line-height:1.65;margin:0 0 8px}
.lore-r9 .lore-panel-pages {display:flex;align-items:center;justify-content:space-between;gap:6px;min-height:44px;font-size:10px;margin-top:3px}
.lore-r9 .lore-panel-pages[hidden] {display:none}
.lore-r9 .lore-panel-pages .iconbtn {height:44px;width:44px;min-width:44px}
.lore-r9 .lore-facts {display:grid;grid-template-columns:1fr 1fr;gap:6px}
.lore-r9 .lore-fact {padding:7px 9px;gap:9px;align-items:center;flex-direction:row}
.lore-r9 .lore-fact img {width:38px;height:44px;object-fit:contain}
.lore-r9 .lore-fact dt {font-size:11px;margin-bottom:3px}
.lore-r9 .lore-fact dd {font-size:11px;line-height:1.4}
.lore-r9 .lore-relation {padding:7px 9px;min-height:84px;gap:10px}
.lore-r9 .lore-relation-avatar {width:56px;height:74px;flex-basis:56px;border-radius:17px}
.lore-r9 .lore-relation strong {font-size:12px}
.lore-r9 .lore-relation span {font-size:11px;line-height:1.45}
.lore-r9 .lore-console {display:block!important;padding:7px 14px 9px}
.lore-r9 .choose-hero {display:none}
.lore-cast-dialog {width:min(570px,calc(100vw - 24px));max-width:none;max-height:calc(100svh - 24px);border:2px solid var(--edge);border-radius:25px;padding:0;background:var(--bg);color:var(--ink);box-shadow:var(--lift);overflow:hidden}
.lore-cast-dialog::backdrop {background:#171023a8;backdrop-filter:blur(8px)}
.lore-cast-heading {display:flex;align-items:center;justify-content:space-between;padding:10px 14px;gap:12px;background:var(--lavender)}
.lore-cast-heading h3 {font-size:18px;margin:0}
.lore-cast-dialog .lore-console {padding:10px;border-top:1px solid var(--edge)}
.lore-cast-dialog .lore-console-head {display:flex;align-items:center;gap:8px;margin-bottom:10px}
.lore-cast-dialog .lore-console-head>strong,.lore-cast-dialog .lore-count,.lore-cast-dialog .lore-search-label span {display:none}
.lore-cast-dialog .lore-search-label {flex:1;min-width:0;max-width:none;display:block}
.lore-cast-dialog .lore-search-label input {width:100%;min-height:44px}
.lore-cast-dialog .lore-roster {display:grid;grid-template-columns:repeat(var(--roster-columns,3),minmax(0,1fr));gap:8px}
.lore-cast-dialog .lore-pick {padding:5px;min-width:0;min-height:0}
.lore-cast-dialog .lore-pick img {width:100%;height:var(--roster-avatar,96px);object-fit:contain}
.lore-cast-dialog .lore-pick[hidden] {display:none!important}
.lore-cast-dialog .lore-roster-pages {display:flex;gap:5px;align-items:center;flex:none;margin:0}
.lore-cast-dialog .lore-roster-pages[hidden] {display:none}
.lore-cast-dialog .lore-roster-pages .iconbtn {height:44px;width:44px;min-width:44px}
@media(min-width:1700px){.lore-r9 .lore-fact{padding:11px}.lore-r9 .lore-fact dd,.lore-r9 .lore-relation span{font-size:13px}}
@media(max-width:700px){
 .lore-r9 .choose-hero{display:inline-flex}.lore-r9 .lore-heading{padding:7px 10px;gap:8px}.lore-r9 .lore-heading>div:first-child{min-width:0;display:block}.lore-r9 .lore-heading h2{font-size:clamp(17px,4.6vw,24px);line-height:1.12}.lore-r9 .lore-age{font-size:9px;padding:2px 7px;display:inline-block;margin-top:3px}.lore-r9 .lore-arrows{gap:4px}.lore-r9 .lore-arrows .iconbtn{min-width:40px;width:40px;height:44px}
 .lore-r9 .lore-body{grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:7px;padding:7px}
 .lore-r9 .lore-showcase{grid-column:1;grid-row:1;padding:4px 5px 7px;border-radius:18px}.lore-r9 .lore-showcase-foot p{font-size:9px;margin:2px 0;line-height:1.3}
 .lore-r9 .lore-panel-history{grid-column:2;grid-row:1}.lore-r9 .lore-panel-facts{grid-column:1;grid-row:2}.lore-r9 .lore-panel-relations{grid-column:2;grid-row:2}.lore-r9 .lore-panel{padding:9px 8px;border-radius:18px}.lore-r9 .lore-panel-head{margin-bottom:6px;min-height:18px}.lore-r9 .lore-panel-head h3{font-size:13px}.lore-r9 .lore-panel-content p{font-size:12px;line-height:1.5}
 .lore-r9 .lore-fact{display:block;padding:6px 7px;border-radius:12px}.lore-r9 .lore-fact img{display:none}.lore-r9 .lore-fact dt{font-size:10px}.lore-r9 .lore-fact dd{font-size:11px;line-height:1.4}.lore-r9 .lore-relation{display:flex;flex-direction:column;gap:5px;align-items:flex-start;padding:6px;border-radius:12px}.lore-r9 .lore-relation-avatar{width:48px;height:64px;flex-basis:auto;align-self:center}.lore-r9 .lore-relation strong{font-size:11px}.lore-r9 .lore-relation span{font-size:11px;line-height:1.4}
 .lore-r9 .lore-panel-pages{gap:2px;margin-top:2px}.lore-r9 .lore-panel-pages .iconbtn{width:38px;min-width:38px;height:44px}.lore-r9 .lore-panel-pages span{font-size:9px}
}
@media(max-height:550px){.lore-r9 .choose-hero{display:inline-flex}.lore-r9 .lore-body{grid-template-columns:1fr 1fr 1fr 1fr;grid-template-rows:1fr;gap:6px;padding:6px}.lore-r9 .lore-showcase,.lore-r9 .lore-panel{grid-row:1;grid-column:auto;padding:8px;border-radius:16px}.lore-r9 .lore-heading{padding:4px 12px}.lore-r9 .lore-panel-content p{font-size:12px}.lore-r9 .lore-fact img{display:none}.lore-r9 .lore-relation{display:block}.lore-r9 .lore-relation-avatar{float:left;margin:0 7px 4px 0;width:40px;height:52px}.lore-r9 .lore-panel-head h3{font-size:13px}}
/* Reader side gutters are real, accessible page controls; the art stays full width on phones. */
.reader-canvas {position:relative;width:100%;min-height:250px}
.reader-edge {position:absolute;top:0;bottom:0;z-index:2;min-width:44px;width:var(--reader-gutter,44px);border:0;background:transparent;color:var(--ink);font-size:34px;cursor:pointer;border-radius:20px;transition:background .15s}
.reader-edge:first-child {left:0}.reader-edge:last-child {right:0}
.reader-edge:hover,.reader-edge:focus-visible {background:var(--lavender);outline:2px solid var(--edge);outline-offset:-2px}
.reader-edge:disabled {opacity:.2;cursor:default;background:transparent}
.reader-canvas>img {cursor:pointer}
.reader-sheet[data-zoom=true] .reader-edge {display:none}
.reader-sheet[data-zoom=true] .reader-canvas>img {cursor:default}
@media(max-width:700px){.reader-edge{display:none}}

@media(max-width:700px){.lore-r9 .lore-facts{grid-template-columns:1fr}.lore-r9 .lore-relation{flex-direction:row;gap:6px}.lore-r9 .lore-relation-avatar{width:32px;height:48px;flex:0 0 32px;align-self:flex-start}.lore-r9 .lore-relation-copy{min-width:0;gap:4px}}
@media(max-height:550px){.lore-r9 .lore-facts{grid-template-columns:1fr}}

.lore-r9 .lore-console{padding:3px 12px 4px}.lore-r9 .lore-console-head{margin-bottom:4px}
@media(max-height:750px){.lore-r9 .choose-hero{display:inline-flex}}
