.library-portals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:8px 0 36px}
#main .library-portal{position:relative;isolation:isolate;display:flex;flex-direction:column;justify-content:space-between;min-height:310px;padding:25px 30px 22px;overflow:hidden;border:0;border-radius:14px;text-align:left;text-decoration:none;color:#fff9ef;background:#25382f;box-shadow:0 8px 28px #162f2a12;cursor:pointer;transition:box-shadow .3s,translate .3s;box-sizing:border-box;width:100%}
.library-portal .portal-picture{position:absolute;inset:0;z-index:-3;width:100%;height:100%;object-fit:cover;object-position:38% 35%;filter:saturate(.76);transition:scale .7s}
.library-portal.portal-public .portal-picture{object-position:72% 35%}
.portal-image-wash{position:absolute;inset:0;z-index:-2;background:linear-gradient(180deg,#152b2444 0%,#152b2408 24%,#172e287d 51%,#0d2529f2 100%)}
.portal-mine .portal-image-wash{background:linear-gradient(180deg,#31362663,#26382c14 24%,#23352d9e 55%,#152a23f5)}
.portal-edition{font-size:10px;letter-spacing:.16em;color:#f9efdbdd;line-height:1.6}
.portal-copy{display:grid;gap:8px;margin-top:64px;position:relative;max-width:360px}
.portal-eyebrow{font-size:11px;letter-spacing:.08em;color:#f3ddaf}
.portal-copy strong{font-family:'Jingjie Serif',serif;font-size:clamp(27px,3vw,39px);font-weight:500;letter-spacing:.055em;line-height:1.4}
.portal-description{font-size:13px;line-height:1.8;color:#f6f3e7dc;text-wrap:balance}
.portal-footer{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-top:24px;padding-top:14px;border-top:1px solid #f9e8c233;font-size:11px;color:#f6efddc9}
.portal-footer>span:last-child{display:flex;align-items:center;gap:8px}
.portal-footer .ui-icon{width:17px;height:17px}
.library-portal.is-selected .portal-footer>span:last-child{color:#fff8df}
.library-portal.is-selected::after{content:'';position:absolute;bottom:0;left:30px;right:30px;height:3px;background:linear-gradient(90deg,#d9c48b,#d9c48b00);border-radius:3px}
@media(hover:hover){#main .library-portal:hover{translate:0 -3px;box-shadow:0 14px 36px #142a2d28}.library-portal:hover .portal-picture{scale:1.045}}
.library-portal:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
#main .world-card-art{position:relative;isolation:isolate;height:260px;display:flex;justify-content:center;overflow:hidden;background:#1e3036}
.world-card-art>img{width:100%;height:100%;object-fit:contain;position:relative;z-index:0;filter:none}
.world-card-art>img.world-art-blur{position:absolute;inset:0;object-fit:cover;filter:blur(18px) brightness(.5);transform:scale(1.16);z-index:-1;opacity:.8}
#main .world-card-art>span{position:absolute;bottom:14px;left:16px;padding:5px 10px;background:#132a2c99;backdrop-filter:blur(8px);color:#fff2d9;border:1px solid #ffffff29;border-radius:4px;font-size:10px;letter-spacing:.07em}
.world-library-card:hover .world-card-art>img:not(.world-art-blur){transform:scale(1.025);transition:transform .4s}
dialog.world-picker .world-pick-card{padding:0 0 16px;overflow:hidden;gap:10px}
dialog.world-picker .world-pick-card>strong,dialog.world-picker .world-pick-card>small,dialog.world-picker .world-pick-card>em{margin-left:16px;margin-right:16px}
dialog.world-picker .world-pick-card>.world-picker-cover{width:100%;height:155px;object-fit:cover;object-position:center 25%;margin-bottom:4px;background:#213a3b}
dialog.world-picker .world-pick-card:has(.world-book-mark){padding:20px}
.world-detail-cover{height:250px;background:linear-gradient(120deg,#16353b,#4a6361);border-radius:12px;overflow:hidden;margin:24px 0}
.world-detail-cover>img{width:100%;height:100%;object-fit:contain}
.world-source{margin:24px 0;color:var(--secondary);font-size:12px;line-height:1.8}.world-source p{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:700px){.library-portals{gap:12px;margin-bottom:24px}#main .library-portal{padding:19px 18px;min-height:285px;border-radius:10px}.portal-copy{margin-top:40px}.portal-copy strong{font-size:27px}.portal-description{font-size:12px}.portal-edition{font-size:8px;letter-spacing:.1em}.portal-footer{gap:8px;font-size:10px}.portal-footer .ui-icon{display:none}.library-portal.is-selected::after{left:18px;right:18px}}
@media(max-width:420px){#main .library-portal{padding:16px 14px;min-height:285px}.portal-copy strong{font-size:23px;letter-spacing:0}.portal-footer{flex-direction:column;align-items:flex-start;gap:7px}.portal-description{font-size:11px}.portal-copy{margin-top:32px}}
@media(prefers-reduced-motion:reduce){#main .library-portal,.library-portal .portal-picture,.world-library-card:hover .world-card-art>img{transition:none}.library-portal:hover .portal-picture{scale:1}#main .library-portal:hover{translate:none}}

/* Shared collection rhythm; portraits feel intimate, worlds feel expansive. */
.library-portals + .page-head{align-items:center;margin-bottom:22px;min-height:72px}
.library-portals + .page-head h1{font-size:clamp(23px,2.4vw,30px);line-height:1.35;margin-bottom:6px}
.library-portals + .page-head p{font-size:13px;line-height:1.8;margin:0}
.library-portals + .page-head .actions{justify-content:flex-end}
.library-worlds .portal-picture{object-position:50% 34%;filter:saturate(.67) contrast(.95)}
.library-worlds .portal-public .portal-picture{object-position:30% 42%}
.library-worlds .portal-image-wash{background:linear-gradient(180deg,#16394036,#12353e08 20%,#17333f75 52%,#102d39f2)}
.library-worlds .portal-mine .portal-image-wash{background:linear-gradient(180deg,#273d3036,#233d2708 20%,#263c3590 54%,#19352ef5)}
.portal-world-lines{position:absolute;inset:18px;z-index:-1;pointer-events:none;border-top:1px solid #f0e5c225;border-right:1px solid #f0e5c225;mask-image:linear-gradient(135deg,transparent 35%,#000);border-radius:0 7px 0 0}
.portal-world-lines::after{content:'+';position:absolute;top:10px;right:12px;font:18px Georgia,serif;color:#efe5c866}
.library-worlds .portal-eyebrow{color:#d9e5d8}
.library-worlds .library-portal.is-selected::after{background:linear-gradient(90deg,#b8cfcb,#b8cfcb00)}
#main .world-library-tools{margin:0 0 24px;padding:0;min-height:44px;align-items:center;gap:12px}
@media(max-width:700px){.library-portals + .page-head{align-items:flex-start;flex-wrap:wrap;gap:14px}.library-portals + .page-head .actions{justify-content:flex-start}.portal-world-lines{inset:12px}}

/* Library content shares the header brand's page frame, with or without subtabs. */
#main:is([data-view=people],[data-view=my-people],[data-view=public],[data-view=worlds]){width:100%;max-width:var(--shell-frame);margin-inline:auto;padding-inline:var(--page-inset);box-sizing:border-box}

/* Persona search follows the same tool-row rhythm as the world library. */
#main .person-pool-search{display:flex;align-items:center;gap:10px;margin-right:auto;color:var(--secondary);font-size:12px}
#main .person-pool-search input{width:240px;max-width:100%;font-size:14px;min-height:40px}
.person-search-count{color:var(--secondary);font-size:13px}
@media(max-width:600px){#main .pool-sortbar{display:flex;flex-wrap:wrap;gap:12px}#main .person-pool-search{flex-basis:100%;width:100%}#main .person-pool-search input{flex:1;width:auto;min-width:0;font-size:16px}#main .pool-sortbar>small{flex-basis:100%}}

/* Shared resource level, with ownership still handled inside each collection. */
.explore-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 24px;padding-bottom:16px;border-bottom:1px solid color-mix(in srgb,var(--secondary) 16%,transparent)}
.explore-types{display:flex;align-items:center;gap:8px}
.explore-types a{display:flex;align-items:center;gap:9px;padding:11px 22px;border-radius:999px;text-decoration:none;color:var(--secondary);font-size:16px;font-weight:500;transition:background .18s ease,color .18s ease}
.explore-types a[aria-current=page]{background:color-mix(in srgb,var(--secondary) 12%,transparent);color:var(--ink,currentColor)}
.explore-types a:hover{background:color-mix(in srgb,var(--secondary) 8%,transparent)}
.explore-types a:focus-visible{outline:2px solid currentColor;outline-offset:3px}
.explore-heading p{margin:0;font-size:12px;color:var(--secondary);line-height:1.6}
@media(max-width:600px){.explore-heading{align-items:flex-start;flex-direction:column;gap:10px;margin-bottom:18px}.explore-types a{padding:10px 22px}.explore-heading p{font-size:11px}}
@media(prefers-reduced-motion:reduce){.explore-types a{transition:none}}
