/* Public detail foundation: one shell, one scroll owner and three shared tabs. */
html body.tryva-detail-overlay-active{overflow:hidden!important}
html body.detail-active main.app-shell>section.workspace,html body.story-asset-detail-active main.app-shell>section.workspace{position:relative!important;z-index:100!important;width:100%!important;max-width:none!important;height:100dvh!important;min-height:0!important;margin:0!important;padding:0!important;overflow:hidden!important}
html body.detail-active #characterDetailView,html body.story-asset-detail-active #storyAssetDetailView{position:fixed!important;z-index:900!important;inset:0!important;isolation:isolate!important;display:grid!important;place-items:center!important;width:100%!important;height:100%!important;margin:0!important;padding:22px 36px!important;overflow:hidden!important;background:rgba(2,3,8,.76)!important;backdrop-filter:blur(4px)!important;animation:tryvaDetailBackdropIn 160ms ease-out both}
html body.detail-active #characterDetailView.hidden,html body.story-asset-detail-active #storyAssetDetailView.hidden{display:none!important}
.tryva-unified-detail-dialog{--tryva-detail-border:rgba(255,255,255,.105);--tryva-detail-muted:#9692a2;position:relative!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:min(1120px,calc(100vw - 72px))!important;height:min(900px,calc(100dvh - 44px))!important;min-width:0!important;min-height:0!important;margin:0!important;border:1px solid var(--tryva-detail-border)!important;border-radius:14px!important;background:#0d0e13!important;box-shadow:0 30px 90px rgba(0,0,0,.62),0 8px 24px rgba(0,0,0,.34)!important;overflow:hidden!important;outline:none!important;animation:tryvaDetailDialogIn 180ms cubic-bezier(.2,.8,.2,1) both}
#characterDetailView>.tryva-unified-detail-dialog{grid-template-rows:56px minmax(0,1fr) 72px!important}
#storyAssetDetailView>.tryva-unified-detail-dialog{grid-template-rows:56px minmax(0,1fr)!important}
#storyAssetDetailView>.tryva-unified-detail-dialog.has-detail-actions{grid-template-rows:56px minmax(0,1fr) 72px!important}
.tryva-detail-dialog-head{position:relative!important;z-index:60!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;align-items:center!important;height:56px!important;padding:0 14px 0 16px!important;border-bottom:1px solid var(--tryva-detail-border)!important;background:rgba(13,14,19,.98)!important}
.tryva-detail-dialog-head>h2{margin:0!important;color:#c7c3cf!important;font-size:13px!important;font-weight:700!important;letter-spacing:.02em!important}
.detail-top-left-controls,.tryva-detail-dialog-head-actions,.detail-owner-tools,.detail-edit-session-tools{display:flex!important;align-items:center!important;gap:8px!important;min-width:0!important}.tryva-detail-dialog-head-actions{justify-content:flex-end!important}
.detail-owner-tools.hidden,.detail-edit-session-tools.hidden,.detail-edit-menu-root.hidden{display:none!important}.detail-admin-manage,.detail-edit-menu-toggle,.tryva-detail-dialog-close,.detail-edit-session-tools>button{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:34px!important;border:1px solid rgba(255,255,255,.09)!important;border-radius:9px!important;background:rgba(255,255,255,.045)!important;color:#d7d3de!important;box-shadow:none!important}.detail-admin-manage{padding:0 11px!important;color:#bf98ff!important;font-size:12px!important}.detail-edit-menu-toggle,.tryva-detail-dialog-close{width:34px!important;padding:0!important}.tryva-detail-dialog-close{border-radius:50%!important;font-size:23px!important;font-weight:300!important}
.detail-edit-menu-root{position:relative!important;z-index:90!important}.detail-edit-menu{position:absolute!important;z-index:120!important;top:calc(100% + 9px)!important;right:0!important;display:none!important;width:236px!important;padding:6px!important;border:1px solid rgba(255,255,255,.13)!important;border-radius:12px!important;background:#17171f!important;box-shadow:0 18px 44px rgba(0,0,0,.52)!important;pointer-events:auto!important}.detail-edit-menu-root.is-open .detail-edit-menu{display:grid!important;gap:3px!important}
.detail-edit-menu-item{position:relative!important;z-index:1!important;display:grid!important;grid-template-columns:28px minmax(0,1fr)!important;gap:10px!important;width:100%!important;padding:11px!important;border:0!important;border-radius:9px!important;background:transparent!important;color:#ece9f1!important;text-align:left!important;pointer-events:auto!important}.detail-edit-menu-item:hover{background:rgba(151,91,255,.12)!important}.detail-edit-menu-item>span:first-child{color:#a978ff!important;font-size:17px!important;text-align:center!important}.detail-edit-menu-item span:last-child{display:grid!important;gap:3px!important}.detail-edit-menu-item strong{font-size:13px!important}.detail-edit-menu-item small{color:#878290!important;font-size:11px!important}
.tryva-unified-detail-body{position:relative!important;display:block!important;min-width:0!important;min-height:0!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain!important;scrollbar-gutter:stable!important;background:#0d0e13!important}
.tryva-detail-hero{position:relative!important;width:100%!important;min-width:0!important;overflow:hidden!important;border-bottom:1px solid var(--tryva-detail-border)!important;background:#101118!important}

/* Character hero: portrait media and thumbnails are independent of information height. */
.tryva-detail-hero--character{display:grid!important;grid-template-columns:minmax(390px,49%) minmax(0,1fr)!important;min-height:424px!important}
.tryva-detail-hero--character .tryva-unified-detail-media-column{position:relative!important;display:grid!important;grid-template-rows:minmax(0,1fr) 72px!important;min-width:0!important;min-height:424px!important;padding:0!important;border-right:1px solid var(--tryva-detail-border)!important;background:#090a0f!important;overflow:hidden!important}
.tryva-unified-detail-media--character,.tryva-unified-detail-media--story{position:relative!important;min-width:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;overflow:hidden!important;background:#090a0f!important}
.tryva-unified-detail-media--character:after{content:"";position:absolute;z-index:3;inset:auto 0 0;height:28%;background:linear-gradient(transparent,rgba(7,8,12,.82));pointer-events:none}
.tryva-unified-detail-media :is(img,video),.story-detail-art>.story-detail-cover{position:absolute!important;inset:0!important;display:block!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:cover!important;border:0!important;border-radius:0!important;background:#090a0f!important}
.tryva-detail-character-thumbs{position:relative!important;z-index:7!important;display:flex!important;align-items:center!important;gap:8px!important;min-width:0!important;padding:9px 12px!important;overflow-x:auto!important;background:#0c0d12!important}.tryva-detail-character-thumbs.hidden{display:none!important}
.tryva-detail-character-thumbs button{position:relative!important;flex:0 0 52px!important;width:52px!important;height:52px!important;padding:0!important;border:1px solid rgba(255,255,255,.13)!important;border-radius:9px!important;overflow:hidden!important;background:#171820!important}.tryva-detail-character-thumbs button.active{border-color:#a96fff!important;box-shadow:0 0 0 2px rgba(169,111,255,.18)!important}.tryva-detail-character-thumbs img{width:100%!important;height:100%!important;object-fit:cover!important}.tryva-detail-character-thumbs span{position:absolute;inset:auto 2px 2px;padding:2px;border-radius:4px;background:rgba(0,0,0,.62);color:#ddd8e6;font-size:9px}
.tryva-detail-hero--character .tryva-unified-detail-copy{position:relative!important;display:flex!important;flex-direction:column!important;min-width:0!important;min-height:0!important;padding:34px 34px 26px!important;background:radial-gradient(circle at 18% 8%,rgba(133,75,230,.1),transparent 44%),#111219!important}
.detail-identity{min-width:0!important}.detail-identity-badges{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:8px!important}.detail-badge,.detail-moderation-notice{display:inline-flex!important;align-items:center!important;min-height:24px!important;padding:0 9px!important;border:1px solid rgba(181,126,255,.2)!important;border-radius:999px!important;background:rgba(139,78,231,.12)!important;color:#c99cff!important;font-size:11px!important;font-weight:700!important}.detail-moderation-notice{border-color:rgba(255,151,106,.25)!important;background:rgba(255,125,75,.1)!important;color:#ffb38d!important}
.detail-identity h1,.story-detail-title-row h1{margin:14px 0 0!important;color:#faf8fc!important;font-size:clamp(30px,3vw,42px)!important;font-weight:760!important;line-height:1.08!important;letter-spacing:-.04em!important}.detail-identity>p,.story-detail-version{margin:9px 0 0!important;color:#b1adba!important;font-size:14px!important}
.tryva-detail-hero-summary{display:-webkit-box!important;margin:20px 0 0!important;overflow:hidden!important;color:#c8c4cf!important;font-size:14px!important;line-height:1.72!important;white-space:pre-line!important;-webkit-line-clamp:3!important;-webkit-box-orient:vertical!important}.tryva-detail-tags{display:flex!important;flex-wrap:wrap!important;gap:7px!important;margin-top:18px!important}.tryva-detail-tags span{padding:6px 10px!important;border:1px solid rgba(255,255,255,.07)!important;border-radius:999px!important;background:rgba(255,255,255,.055)!important;color:#bbb6c4!important;font-size:11px!important}
.tryva-unified-detail-content{display:grid!important;gap:15px!important;margin-top:auto!important;padding-top:24px!important}.tryva-unified-detail-stats{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;min-width:0!important;border:1px solid rgba(255,255,255,.08)!important;border-radius:11px!important;overflow:hidden!important;background:rgba(0,0,0,.14)!important}.tryva-unified-detail-stats>.detail-stat{display:flex!important;align-items:center!important;justify-content:center!important;gap:9px!important;min-width:0!important;min-height:66px!important;padding:9px!important;border-right:1px solid rgba(255,255,255,.07)!important}.tryva-unified-detail-stats>.detail-stat:last-child{border-right:0!important}.detail-stat-icon{display:grid!important;place-items:center!important;width:25px!important;height:25px!important;color:#ae75ff!important}.detail-stat-icon svg{width:21px!important;height:21px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.7!important}.detail-stat-copy{display:grid!important;gap:2px!important}.detail-stat-copy strong{color:#f2eff6!important;font-size:15px!important}.detail-stat-copy small{color:#85818e!important;font-size:10px!important}
.creator-detail-panel{display:grid!important;grid-template-columns:36px minmax(0,1fr) auto!important;align-items:center!important;gap:10px!important;width:100%!important;min-height:52px!important;padding:8px 10px!important;border:1px solid rgba(255,255,255,.075)!important;border-radius:10px!important;background:rgba(255,255,255,.025)!important;color:#e7e3eb!important;text-align:left!important}.creator-detail-panel:disabled{opacity:1!important;cursor:default!important}.creator-detail-avatar{display:grid!important;place-items:center!important;width:36px!important;height:36px!important;border-radius:50%!important;overflow:hidden!important;background:#292532!important;color:#fff!important}.creator-detail-avatar img{width:100%!important;height:100%!important;object-fit:cover!important}.creator-detail-panel>span:nth-child(2){display:grid!important;gap:2px!important}.creator-detail-panel small{color:#777381!important;font-size:9px!important}.creator-detail-panel strong{color:#ddd9e4!important;font-size:12px!important}.creator-detail-panel em{color:#7f7a88!important;font-style:normal!important}

/* Scenario/world hero: home-card crop drives one landscape backdrop. */
.tryva-detail-hero--story{min-height:344px!important;background:#08090d!important}.tryva-detail-hero--story .tryva-unified-detail-media-column,.tryva-detail-hero--story .story-detail-art{position:absolute!important;inset:0!important;width:100%!important;height:100%!important}.tryva-detail-hero--story .story-detail-art:after{content:"";position:absolute;z-index:2;inset:0;background:linear-gradient(90deg,rgba(8,9,13,.95) 0%,rgba(8,9,13,.69) 44%,rgba(8,9,13,.14) 78%),linear-gradient(0deg,rgba(8,9,13,.78) 0%,transparent 55%);pointer-events:none}.story-detail-art-placeholder{position:absolute!important;inset:0!important;display:grid!important;place-items:center!important;align-content:center!important;gap:8px!important;color:#8c8399!important}.story-detail-art-placeholder span{font-size:38px!important}.story-detail-art-placeholder small{font-size:12px!important}
.tryva-detail-hero--story .tryva-unified-detail-copy{position:relative!important;z-index:5!important;display:grid!important;grid-template-columns:minmax(0,1fr) 410px!important;grid-template-rows:minmax(0,1fr) auto!important;gap:18px 30px!important;width:100%!important;min-height:344px!important;padding:34px 34px 25px!important;pointer-events:none!important}.tryva-detail-hero--story .story-detail-identity{align-self:start!important;max-width:610px!important;pointer-events:auto!important}.story-detail-title-row{display:flex!important;align-items:center!important;gap:10px!important}.story-detail-title-row h1{font-size:clamp(32px,3.2vw,46px)!important}.tryva-detail-hero--story .tryva-detail-hero-summary{max-width:590px!important}.tryva-detail-hero--story .story-detail-loading{position:absolute!important;inset:0!important;display:grid!important;place-items:center!important;align-content:center!important;background:rgba(8,9,13,.72)!important;pointer-events:auto!important}.tryva-detail-hero--story .story-detail-loading.hidden{display:none!important}.tryva-detail-hero--story .story-detail-content{grid-column:1/-1!important;grid-row:2!important;display:grid!important;grid-template-columns:minmax(0,1fr) 330px!important;align-items:end!important;gap:18px!important;padding:0!important;pointer-events:auto!important}.tryva-detail-hero--story .story-detail-content.hidden{display:none!important}.tryva-detail-hero--story .tryva-unified-detail-stats{width:380px!important;margin-left:auto!important;background:rgba(8,8,12,.62)!important;backdrop-filter:blur(10px)!important}.tryva-detail-hero--story .creator-detail-panel{background:rgba(8,8,12,.58)!important;backdrop-filter:blur(10px)!important}

/* Shared tabs and panels. */
.tryva-detail-tabs{position:sticky!important;z-index:40!important;top:0!important;display:flex!important;align-items:stretch!important;width:100%!important;min-height:54px!important;padding:0 28px!important;border-bottom:1px solid var(--tryva-detail-border)!important;background:rgba(14,15,21,.97)!important;backdrop-filter:blur(12px)!important}.tryva-detail-tabs button{position:relative!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;min-width:116px!important;padding:0 17px!important;border:0!important;border-radius:0!important;background:transparent!important;color:#8d8996!important;font-size:13px!important;font-weight:650!important}.tryva-detail-tabs button:after{content:"";position:absolute;inset:auto 10px 0;height:2px;background:transparent}.tryva-detail-tabs button.active{color:#eeeaf3!important}.tryva-detail-tabs button.active:after{background:linear-gradient(90deg,#b574ff,#7447ff)!important}.tryva-detail-tabs button span{display:inline-flex!important;min-width:20px!important;height:20px!important;align-items:center!important;justify-content:center!important;padding:0 6px!important;border-radius:999px!important;background:rgba(255,255,255,.065)!important;color:#aaa5b2!important;font-size:10px!important}
.tryva-detail-panels{min-width:0!important;min-height:260px!important;padding:26px 30px 42px!important;background:#0d0e13!important}.tryva-detail-panel{min-width:0!important}.tryva-detail-panel.hidden{display:none!important}.tryva-unified-detail-document{display:block!important;width:min(100%,900px)!important;min-width:0!important;margin:0 auto!important;padding:0!important;border:0!important;background:transparent!important;overflow:visible!important}.tryva-unified-detail-document.hidden{display:none!important}
.tryva-detail-update-composer,.tryva-detail-comment-composer{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:10px!important;width:min(100%,850px)!important;margin:0 auto 22px!important;padding:14px!important;border:1px solid rgba(255,255,255,.085)!important;border-radius:12px!important;background:#14151c!important}.tryva-detail-update-composer{grid-template-columns:minmax(0,1fr) 140px!important}.tryva-detail-update-composer>input{grid-column:1/-1!important}.tryva-detail-update-composer.hidden,.tryva-detail-comment-composer.hidden{display:none!important}.tryva-detail-update-composer :is(input,textarea),.tryva-detail-comment-composer textarea{width:100%!important;min-height:42px!important;margin:0!important;padding:11px 12px!important;border:1px solid rgba(255,255,255,.09)!important;border-radius:8px!important;background:#0e0f14!important;color:#e8e4ec!important;resize:vertical!important}.tryva-detail-update-composer textarea{min-height:90px!important}.tryva-detail-comment-composer textarea{min-height:50px!important;max-height:160px!important}.tryva-detail-update-composer button,.tryva-detail-comment-composer button{min-width:116px!important;min-height:42px!important;align-self:end!important}.tryva-detail-login-prompt{display:block!important;width:min(100%,850px)!important;min-height:48px!important;margin:0 auto 20px!important;border:1px solid rgba(156,98,255,.22)!important;border-radius:10px!important;background:rgba(139,80,238,.09)!important;color:#c69bff!important}.tryva-detail-login-prompt.hidden{display:none!important}
.tryva-detail-feed{display:grid!important;gap:12px!important;width:min(100%,850px)!important;margin:0 auto!important}.tryva-detail-feed-entry{padding:17px 18px!important;border:1px solid rgba(255,255,255,.075)!important;border-radius:11px!important;background:#13141a!important}.tryva-detail-feed-entry>header{display:grid!important;grid-template-columns:34px minmax(0,1fr) auto auto!important;align-items:center!important;gap:9px!important}.tryva-detail-feed-avatar{display:grid!important;place-items:center!important;width:34px!important;height:34px!important;border-radius:50%!important;overflow:hidden!important;background:#2a2633!important;color:#fff!important;font-size:12px!important}.tryva-detail-feed-avatar img{width:100%!important;height:100%!important;object-fit:cover!important}.tryva-detail-feed-author-copy{display:grid!important;gap:1px!important}.tryva-detail-feed-author-copy strong{color:#ddd9e3!important;font-size:12px!important}.tryva-detail-feed-author-copy small,.tryva-detail-feed-entry time{color:#716d79!important;font-size:10px!important}.tryva-detail-feed-entry header>button{padding:4px 7px!important;border:0!important;background:transparent!important;color:#8f8997!important;font-size:10px!important}.tryva-detail-feed-entry h3{margin:15px 0 7px!important;color:#f0edf3!important;font-size:16px!important}.tryva-detail-feed-entry>p{margin:13px 0 0!important;color:#c3beca!important;font-size:13px!important;line-height:1.72!important;white-space:pre-wrap!important;overflow-wrap:anywhere!important}.tryva-detail-feed-state{display:grid!important;place-items:center!important;align-content:center!important;gap:7px!important;min-height:160px!important;padding:24px!important;border:1px dashed rgba(255,255,255,.075)!important;border-radius:11px!important;color:#817c89!important;text-align:center!important}.tryva-detail-feed-state strong{color:#bdb8c5!important;font-size:13px!important}.tryva-detail-feed-state p{margin:0!important;font-size:12px!important}.tryva-detail-feed-state.is-error{color:#d99191!important}

/* Fixed action rail shared by every public detail. */
.tryva-unified-detail-actions{position:relative!important;z-index:55!important;display:grid!important;grid-template-columns:minmax(180px,.42fr) minmax(260px,1fr)!important;align-items:center!important;gap:12px!important;min-width:0!important;height:72px!important;padding:10px 18px!important;border-top:1px solid var(--tryva-detail-border)!important;background:rgba(15,16,22,.985)!important}#storyAssetDetailView .tryva-unified-detail-actions{grid-template-columns:minmax(0,1fr)!important}.tryva-unified-detail-actions.hidden{display:none!important}.tryva-unified-detail-actions>button{width:100%!important;min-height:50px!important;margin:0!important;border-radius:9px!important;font-size:14px!important;font-weight:720!important}.detail-preview-button{border:1px solid rgba(255,255,255,.1)!important;background:#171820!important;color:#ece8f0!important}.detail-preview-button-icon{display:inline-flex!important;margin-right:8px!important}.detail-preview-button-icon svg{width:19px!important;height:19px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important}.tryva-detail-primary-action{border:1px solid rgba(179,117,255,.42)!important;background:linear-gradient(100deg,#7041d7,#9859ef)!important;color:#fff!important;box-shadow:0 8px 22px rgba(115,57,211,.22)!important}.tryva-detail-primary-action.selected{background:#24212c!important;border-color:rgba(255,255,255,.12)!important;box-shadow:none!important}
.detail-media-edit-control{position:absolute!important;z-index:30!important;top:12px!important;right:12px!important}.detail-media-edit-control.hidden{display:none!important}.detail-image-edit-button{display:grid!important;place-items:center!important;width:36px!important;height:36px!important;padding:0!important;border:1px solid rgba(255,255,255,.16)!important;border-radius:50%!important;background:rgba(10,10,14,.76)!important;color:#fff!important;backdrop-filter:blur(8px)!important}.detail-image-edit-button svg{width:17px!important;height:17px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important}.story-detail-media-edit-control{position:static!important}.inline-edit-btn{border:0!important;background:transparent!important;color:#ac77ff!important}
.detail-media-loading-cover{position:absolute!important;z-index:12!important;inset:0!important;display:grid!important;place-items:center!important;background:#0b0c11!important;transition:opacity 180ms ease!important}.detail-media-loading-cover.is-hidden,.detail-media-loading-cover.hidden{opacity:0!important;pointer-events:none!important}.detail-media-loading-glow{position:absolute!important;width:150px!important;height:150px!important;border-radius:50%!important;background:rgba(143,80,244,.14)!important;filter:blur(32px)!important}.detail-media-loading-mark{position:relative!important;width:42px!important;height:42px!important}.detail-media-loading-mark img{position:static!important;width:100%!important;height:100%!important;object-fit:contain!important}
.story-detail-page-quick-editor{display:grid!important;gap:14px!important;width:100%!important}.story-detail-page-quick-editor.hidden{display:none!important}.story-detail-page-quick-toolbar{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important}.story-detail-page-quick-toolbar>div:first-child{display:grid!important;gap:3px!important}.story-detail-page-quick-toolbar strong{color:#e9e5ed!important}.story-detail-page-quick-toolbar small,.story-detail-page-asset-status{color:#817c89!important;font-size:11px!important}.story-detail-page-quick-code{display:grid!important;grid-template-columns:1fr 1fr!important;gap:12px!important}.story-detail-page-quick-code label{display:grid!important;gap:7px!important;color:#aaa5b2!important;font-size:11px!important}.story-detail-page-quick-code textarea{min-height:230px!important;padding:12px!important;border:1px solid rgba(255,255,255,.09)!important;border-radius:9px!important;background:#090a0f!important;color:#d8d4dd!important;font:12px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace!important;resize:vertical!important}.story-detail-page-quick-preview{min-height:180px!important;padding:16px!important;border:1px solid rgba(255,255,255,.08)!important;border-radius:10px!important;background:#101117!important;overflow:hidden!important}
.tryva-unified-detail-dialog :is(button,a,input,textarea,select,[tabindex]):focus-visible{outline:2px solid #a46cff!important;outline-offset:2px!important}

/* Canonical public-detail isolation contract.
   These selectors deliberately include the active view ID so retired detail
   prototypes cannot re-enter the live cascade through broad legacy classes. */
html body:is(.detail-active,.story-asset-detail-active) :is(#characterDetailView,#storyAssetDetailView) .tryva-detail-dialog-head{
  position:relative!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;
  align-items:center!important;width:100%!important;height:56px!important;margin:0!important;padding:0 14px 0 16px!important;
  overflow:visible!important;border:0!important;border-bottom:1px solid var(--tryva-detail-border)!important;border-radius:0!important;
  background:rgba(13,14,19,.985)!important;transform:none!important
}
html body:is(.detail-active,.story-asset-detail-active) :is(#characterDetailView,#storyAssetDetailView) .tryva-detail-dialog-head>h2{
  position:static!important;display:block!important;grid-column:2!important;grid-row:1!important;inset:auto!important;
  width:auto!important;height:auto!important;margin:0!important;padding:0!important;color:#c7c3cf!important;
  font-size:13px!important;line-height:1.2!important;text-align:center!important;transform:none!important
}
html body:is(.detail-active,.story-asset-detail-active) :is(#characterDetailView,#storyAssetDetailView) :is(.detail-top-left-controls,.tryva-detail-dialog-head-actions,.detail-owner-tools,.detail-edit-session-tools){
  position:static!important;inset:auto!important;display:flex!important;align-items:center!important;gap:8px!important;
  width:auto!important;max-width:none!important;height:auto!important;margin:0!important;padding:0!important;overflow:visible!important;
  border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;transform:none!important;pointer-events:auto!important
}
html body:is(.detail-active,.story-asset-detail-active) :is(#characterDetailView,#storyAssetDetailView) .detail-top-left-controls{
  grid-column:1!important;grid-row:1!important;justify-self:start!important
}
html body:is(.detail-active,.story-asset-detail-active) :is(#characterDetailView,#storyAssetDetailView) .tryva-detail-dialog-head-actions{
  grid-column:3!important;grid-row:1!important;justify-self:stretch!important;justify-content:flex-end!important
}
html body:is(.detail-active,.story-asset-detail-active) :is(#characterDetailView,#storyAssetDetailView) :is(.detail-admin-manage,.detail-edit-menu-toggle,.tryva-detail-dialog-close,.detail-edit-session-tools>button){
  position:static!important;inset:auto!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
  width:auto!important;min-width:0!important;height:34px!important;min-height:34px!important;margin:0!important;padding:0 12px!important;
  border:1px solid rgba(255,255,255,.09)!important;border-radius:9px!important;background:rgba(255,255,255,.045)!important;
  color:#d7d3de!important;box-shadow:none!important;transform:none!important;backdrop-filter:none!important;white-space:nowrap!important
}
html body:is(.detail-active,.story-asset-detail-active) :is(#characterDetailView,#storyAssetDetailView) :is(.detail-edit-menu-toggle,.tryva-detail-dialog-close){
  flex:0 0 34px!important;width:34px!important;padding:0!important
}
html body:is(.detail-active,.story-asset-detail-active) :is(#characterDetailView,#storyAssetDetailView) .tryva-detail-dialog-close{
  border-radius:50%!important;font-size:23px!important;font-weight:300!important
}
html body:is(.detail-active,.story-asset-detail-active) :is(#characterDetailView,#storyAssetDetailView) :is(.detail-owner-tools.hidden,.detail-edit-session-tools.hidden,.detail-edit-menu-root.hidden){display:none!important}

html body.detail-active #characterDetailView .tryva-detail-hero--character{
  position:relative!important;display:grid!important;grid-template-columns:minmax(390px,49%) minmax(0,1fr)!important;
  width:100%!important;height:auto!important;min-height:424px!important;margin:0!important;padding:0!important;overflow:hidden!important;
  border:0!important;border-bottom:1px solid var(--tryva-detail-border)!important;border-radius:0!important;background:#101118!important;box-shadow:none!important
}
html body.detail-active #characterDetailView .tryva-unified-detail-media-column{
  position:relative!important;inset:auto!important;display:grid!important;grid-template-rows:minmax(0,1fr) 72px!important;
  grid-column:auto!important;grid-row:auto!important;width:auto!important;height:auto!important;min-width:0!important;min-height:424px!important;
  margin:0!important;padding:0!important;overflow:hidden!important;border:0!important;border-right:1px solid var(--tryva-detail-border)!important;
  border-radius:0!important;background:#090a0f!important;transform:none!important
}
html body.detail-active #characterDetailView .detail-art.tryva-unified-detail-media--character{
  position:relative!important;inset:auto!important;display:block!important;grid-column:auto!important;grid-row:auto!important;
  width:100%!important;height:auto!important;min-width:0!important;min-height:0!important;margin:0!important;padding:0!important;
  overflow:hidden!important;border:0!important;border-radius:0!important;background:#090a0f!important;transform:none!important
}
html body.detail-active #characterDetailView .detail-art.tryva-unified-detail-media--character::before{display:none!important;content:none!important}
html body.detail-active #characterDetailView .detail-art.tryva-unified-detail-media--character::after{
  display:none!important;content:none!important
}
html body.detail-active #characterDetailView .tryva-unified-detail-copy{
  position:relative!important;inset:auto!important;display:flex!important;grid-column:auto!important;grid-row:auto!important;flex-direction:column!important;
  width:auto!important;max-width:none!important;height:auto!important;min-width:0!important;min-height:424px!important;margin:0!important;
  padding:34px 34px 26px!important;overflow:visible!important;border:0!important;border-radius:0!important;
  background:radial-gradient(circle at 18% 8%,rgba(133,75,230,.1),transparent 44%),#111219!important;box-shadow:none!important;transform:none!important
}
html body.detail-active #characterDetailView .detail-identity{
  position:static!important;inset:auto!important;display:block!important;width:auto!important;max-width:none!important;height:auto!important;
  margin:0!important;padding:0!important;color:inherit!important;transform:none!important;pointer-events:auto!important
}
html body.detail-active #characterDetailView .detail-identity-badges{margin:0!important}
html body.detail-active #characterDetailView .detail-identity #detailName{
  position:static!important;width:auto!important;margin:14px 0 0!important;padding:0!important;color:#faf8fc!important;
  font-size:clamp(30px,3vw,42px)!important;font-weight:760!important;line-height:1.08!important;letter-spacing:-.04em!important;text-shadow:none!important
}
html body.detail-active #characterDetailView .detail-identity #detailMeta{
  position:static!important;margin:9px 0 0!important;padding:0!important;color:#b1adba!important;font-size:14px!important;line-height:1.4!important
}
html body.detail-active #characterDetailView .tryva-unified-detail-content{
  position:static!important;display:grid!important;gap:15px!important;width:100%!important;height:auto!important;margin:auto 0 0!important;padding:24px 0 0!important;
  overflow:visible!important;border:0!important;background:transparent!important;transform:none!important
}
html body.detail-active #characterDetailView .tryva-unified-detail-stats,
html body.story-asset-detail-active #storyAssetDetailView .tryva-unified-detail-stats{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;align-items:stretch!important;gap:0!important;
  min-width:0!important;height:auto!important;margin:0!important;padding:0!important;overflow:hidden!important;
  border:1px solid rgba(255,255,255,.08)!important;border-radius:11px!important;background:rgba(0,0,0,.14)!important;box-shadow:none!important
}
html body.detail-active #characterDetailView .tryva-unified-detail-stats>.detail-stat,
html body.story-asset-detail-active #storyAssetDetailView .tryva-unified-detail-stats>.detail-stat{
  display:flex!important;align-items:center!important;justify-content:center!important;flex-direction:row!important;gap:9px!important;
  min-width:0!important;min-height:66px!important;margin:0!important;padding:9px!important;overflow:visible!important;
  border:0!important;border-right:1px solid rgba(255,255,255,.07)!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;transform:none!important
}
html body.detail-active #characterDetailView .tryva-unified-detail-stats>.detail-stat:last-child,
html body.story-asset-detail-active #storyAssetDetailView .tryva-unified-detail-stats>.detail-stat:last-child{border-right:0!important}
html body.detail-active #characterDetailView .creator-detail-panel,
html body.story-asset-detail-active #storyAssetDetailView .creator-detail-panel{
  position:static!important;inset:auto!important;display:grid!important;grid-template-columns:36px minmax(0,1fr) auto!important;align-items:center!important;gap:10px!important;
  width:100%!important;height:auto!important;min-height:52px!important;margin:0!important;padding:8px 10px!important;overflow:hidden!important;
  border:1px solid rgba(255,255,255,.075)!important;border-radius:10px!important;background:rgba(255,255,255,.025)!important;box-shadow:none!important;transform:none!important
}
html body.detail-active #characterDetailView .creator-detail-avatar,
html body.story-asset-detail-active #storyAssetDetailView .creator-detail-avatar{
  display:grid!important;place-items:center!important;flex:0 0 36px!important;width:36px!important;height:36px!important;min-width:36px!important;margin:0!important;
  padding:0!important;overflow:hidden!important;border:0!important;border-radius:50%!important;background:#292532!important
}
html body.detail-active #characterDetailView .creator-detail-panel>span:nth-child(2),
html body.story-asset-detail-active #storyAssetDetailView .creator-detail-panel>span:nth-child(2){display:grid!important;gap:2px!important;min-width:0!important}
html body.detail-active #characterDetailView .detail-preview-button-copy{display:inline-flex!important;align-items:center!important}
html body.detail-active #characterDetailView .detail-preview-button-icon{display:inline-flex!important;margin:0 8px 0 0!important}

html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story{
  position:relative!important;display:block!important;width:100%!important;height:auto!important;min-height:356px!important;margin:0!important;padding:0!important;
  overflow:hidden!important;border:0!important;border-bottom:1px solid var(--tryva-detail-border)!important;border-radius:0!important;background:#08090d!important;box-shadow:none!important
}
html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story .tryva-unified-detail-copy{
  position:relative!important;z-index:5!important;inset:auto!important;display:grid!important;grid-template-columns:minmax(0,1fr) 410px!important;
  grid-template-rows:minmax(0,1fr) auto!important;gap:18px 30px!important;width:100%!important;height:auto!important;min-height:356px!important;
  margin:0!important;padding:34px 34px 25px!important;overflow:visible!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;transform:none!important
}
html body.story-asset-detail-active #storyAssetDetailView .story-detail-content{
  position:static!important;display:grid!important;grid-template-columns:minmax(0,1fr) 330px!important;align-items:end!important;gap:18px!important;
  width:auto!important;height:auto!important;margin:0!important;padding:0!important;overflow:visible!important;border:0!important;background:transparent!important;transform:none!important
}
html body.story-asset-detail-active #storyAssetDetailView .story-detail-content.hidden{display:none!important}
html body.story-asset-detail-active #storyAssetDetailView .story-detail-stats{width:380px!important;margin:0 0 0 auto!important}
html body.story-asset-detail-active #storyAssetDetailView .story-detail-creator-panel{width:100%!important;margin:0!important}
@media(max-width:900px){
  html body.detail-active #characterDetailView,html body.story-asset-detail-active #storyAssetDetailView{padding:0!important}
  .tryva-unified-detail-dialog{width:100vw!important;height:100dvh!important;border:0!important;border-radius:0!important}
  html body.detail-active #characterDetailView .tryva-detail-hero--character{grid-template-columns:44% minmax(0,1fr)!important}
  html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story .tryva-unified-detail-copy{grid-template-columns:1fr!important}
  html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story .story-detail-content{grid-template-columns:1fr!important}
}
@media(max-width:760px){
  html body:is(.detail-active,.story-asset-detail-active) :is(#characterDetailView,#storyAssetDetailView) .tryva-detail-dialog-head{grid-template-columns:minmax(0,1fr) auto!important}
  html body:is(.detail-active,.story-asset-detail-active) :is(#characterDetailView,#storyAssetDetailView) .tryva-detail-dialog-head>h2{display:none!important}
  html body.detail-active #characterDetailView .tryva-detail-hero--character{display:block!important}
  html body.detail-active #characterDetailView .tryva-detail-hero--character .tryva-unified-detail-media-column{min-height:420px!important;border-right:0!important;border-bottom:1px solid var(--tryva-detail-border)!important}
  html body.detail-active #characterDetailView .tryva-detail-hero--character .tryva-unified-detail-copy{min-height:0!important;padding:24px 20px!important}
  html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story{min-height:430px!important}
  html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story .tryva-unified-detail-copy{min-height:430px!important;padding:25px 20px!important}
  html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story .story-detail-content{align-self:end!important}
  html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story .tryva-unified-detail-stats{width:100%!important}
  .tryva-detail-tabs{padding:0 5px!important}.tryva-detail-tabs button{flex:1!important;min-width:0!important;padding:0 6px!important}.tryva-detail-panels{padding:20px 14px 32px!important}.tryva-unified-detail-actions{grid-template-columns:1fr 1fr!important;padding:9px 10px!important}.story-detail-page-quick-code{grid-template-columns:1fr!important}.tryva-detail-update-composer,.tryva-detail-comment-composer{grid-template-columns:1fr!important}.tryva-detail-update-composer>input{grid-column:auto!important}
}
@keyframes tryvaDetailBackdropIn{from{opacity:0}to{opacity:1}}@keyframes tryvaDetailDialogIn{from{opacity:0;transform:translateY(8px) scale(.992)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){.tryva-unified-detail-view,.tryva-unified-detail-dialog{animation:none!important}}

/* Compatibility seals for legacy detail declarations that still serve editor preview clones. */
html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story .story-detail-art{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;aspect-ratio:auto!important;border-radius:0!important}
html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story .story-detail-identity{position:relative!important;z-index:auto!important;inset:auto!important;width:auto!important;max-width:610px!important;padding:0!important;transform:none!important;text-align:left!important}
html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story .story-detail-title-row h1{margin:14px 0 0!important;font-size:clamp(32px,3.2vw,46px)!important;line-height:1.08!important;letter-spacing:-.04em!important}
html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story #storyAssetDetailStatus{display:block!important;margin:9px 0 0!important;color:#b1adba!important;font-size:14px!important}
html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story .story-detail-content{display:grid!important;grid-template-columns:minmax(0,1fr) 330px!important;flex-direction:initial!important;gap:18px!important;width:auto!important;padding:0!important}
html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story .story-detail-content.hidden{display:none!important}
.detail-identity>.tryva-detail-hero-summary,html body.story-asset-detail-active #storyAssetDetailView .story-detail-identity>.tryva-detail-hero-summary{margin:20px 0 0!important;color:#c8c4cf!important;font-size:14px!important;line-height:1.72!important}

/*
 * Shared detail corrections.
 * Character, scenario and world detail pages deliberately stay on the same
 * overlay/dialog foundation.  These declarations are kept together so a
 * later legacy detail rule cannot make one detail kind behave differently.
 */
html body.tryva-detail-overlay-active .view.tryva-detail-underlay{
  visibility:visible!important;
  opacity:1!important;
  pointer-events:none!important
}
html body:is(.detail-active,.story-asset-detail-active) :is(#characterDetailView,#storyAssetDetailView){
  background:rgba(2,3,8,.68)!important;
  backdrop-filter:blur(4px)!important
}

/* One overlay foundation, with each active state paired to its own view. */
html body.detail-active main.app-shell>section.workspace>#characterDetailView.tryva-unified-detail-view,
html body.story-asset-detail-active main.app-shell>section.workspace>#storyAssetDetailView.tryva-unified-detail-view{
  position:fixed!important;
  z-index:900!important;
  inset:0!important;
  display:grid!important;
  place-items:center!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
  padding:22px 36px!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
  touch-action:auto!important;
  background:rgba(2,3,8,.68)!important;
  backdrop-filter:blur(4px)!important
}

/* Fit the catalog portrait inside the existing hero column. */
html body.detail-active #characterDetailView .tryva-detail-hero--character .tryva-unified-detail-media-column{
  position:relative!important;
  display:block!important;
  min-height:424px!important
}
html body.detail-active #characterDetailView .tryva-detail-hero--character .detail-art.tryva-unified-detail-media--character{
  position:absolute!important;
  inset:auto!important;
  top:50%!important;
  left:50%!important;
  display:block!important;
  width:min(calc(100% - 48px),calc(376px * (var(--tryva-character-card-ratio))))!important;
  height:auto!important;
  aspect-ratio:var(--tryva-character-card-ratio)!important;
  min-height:0!important;
  border-radius:10px!important;
  transform:translate(-50%,-50%)!important
}
html body.detail-active #characterDetailView .tryva-detail-hero--character .tryva-detail-character-thumbs{
  position:absolute!important;
  z-index:20!important;
  right:12px!important;
  bottom:12px!important;
  left:12px!important;
  display:flex!important;
  width:auto!important;
  min-height:64px!important;
  padding:6px!important;
  border:1px solid rgba(255,255,255,.11)!important;
  border-radius:12px!important;
  background:rgba(8,9,13,.58)!important;
  box-shadow:0 8px 24px rgba(0,0,0,.28)!important;
  backdrop-filter:blur(12px)!important
}
html body.detail-active #characterDetailView .tryva-detail-hero--character .tryva-detail-character-thumbs.hidden{
  display:none!important
}
html body.detail-active #characterDetailView .tryva-detail-hero--character .tryva-detail-character-thumbs span{
  display:none!important
}

/* Live video, poster and still image share the card editor's projected crop. */
html body.detail-active #characterDetailView .tryva-detail-hero--character .detail-art > :is(
  img#detailImage.tryva-detail-media.tryva-cover-media,
  video#detailImage.tryva-detail-media.tryva-cover-media,
  img.detail-video-poster-fallback.tryva-detail-media.tryva-cover-media
){
  position:absolute!important;
  inset:auto!important;
  top:50%!important;
  right:auto!important;
  bottom:auto!important;
  left:50%!important;
  display:block!important;
  width:var(--tryva-cover-width,100%)!important;
  height:var(--tryva-cover-height,100%)!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:fill!important;
  transform:var(--tryva-cover-transform,translate(-50%,-50%))!important;
  transform-origin:center center!important
}

/* The same creator-avatar seal serves character, scenario and world details. */
html body:is(.detail-active,.story-asset-detail-active) :is(#characterDetailView,#storyAssetDetailView) .creator-detail-avatar.has-image{
  background-color:transparent!important;
  background-image:var(--creator-avatar-image)!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  background-size:cover!important;
  color:transparent!important
}

/* Keep the story cover visible across the full surface, including its left edge. */
html body.story-asset-detail-active #storyAssetDetailView .tryva-detail-hero--story .story-detail-art:after{
  background:
    linear-gradient(90deg,rgba(8,9,13,.50) 0%,rgba(8,9,13,.25) 44%,rgba(8,9,13,.07) 78%),
    linear-gradient(0deg,rgba(8,9,13,.64) 0%,transparent 55%)!important
}

/* Empty/status-hidden notices must not be revived by the badge display rule. */
.detail-moderation-notice.hidden,
.detail-moderation-notice:empty { display:none!important; }

/* Preview reuses the runtime iframe; this shell alone owns its bounds. */
#detailGamePreviewModal {
  z-index:1000!important;
  padding:24px!important;
  overscroll-behavior:contain;
  backdrop-filter:none!important;
  background:rgba(3,4,8,.82)!important;
}
#detailGamePreviewModal.hidden { display:none!important; }
#detailGamePreviewModal > .detail-game-preview-modal {
  width:min(1120px,calc(100vw - 48px),calc((100dvh - 132px) * 1667 / 900))!important;
  max-width:100%!important;
  max-height:calc(100dvh - 48px)!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px!important;
  background:#0d0e13;
  box-shadow:0 24px 64px rgba(0,0,0,.4);
}
.detail-game-preview-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:72px;
  padding:12px 16px;
  border-bottom:1px solid rgba(255,255,255,.1);
}
.detail-game-preview-head > div { min-width:0; }
.detail-game-preview-head h2 { margin:0; color:#e9e5ed; font-size:14px; line-height:1.5; }
.detail-game-preview-head p { margin:4px 0 0; color:#a59eae; font-size:12px; line-height:1.5; }
#closeDetailGamePreviewBtn { flex:0 0 34px; }
#detailGamePreviewStage {
  position:relative;
  width:100%;
  aspect-ratio:1667 / 900;
  overflow:hidden;
  background:#05070d;
}
@media(max-width:600px) {
  #detailGamePreviewModal { padding:12px!important; align-items:center!important; }
  #detailGamePreviewModal > .detail-game-preview-modal {
    width:min(calc(100vw - 24px),calc((100dvh - 120px) * 1667 / 900))!important;
    max-height:calc(100dvh - 24px)!important;
  }
  .detail-game-preview-head { gap:10px; padding:10px 12px; }
}
