/* 2.2.4: corrections grounded in the supplied screenshots and reference boards. */
body{background:radial-gradient(ellipse at 20% 10%,#fff9f233,transparent 55%),var(--paper)}
.button.primary,.button.selected{color:#fff9f4}
.breadcrumbs{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.breadcrumbs [aria-current]{color:var(--ink)}
.article-card-copy{position:relative}
.profile-page .site-main{min-height:0}
.profile-page .site-header{background:linear-gradient(115deg,#31111e,#391622 70%,#28131c)}
.profile-page .site-footer{margin-top:12px}
.member-profile .role-badge,.member-profile .vip-badge{font-family:'Times New Roman',Times,serif;font-size:18px;padding:5px 11px}
.member-profile .profile-empty{min-height:220px;display:flex;flex-direction:column;justify-content:center}
.member-profile .collection-hint{font:15px/1.5 Georgia,serif;margin:0 0 12px;color:var(--muted)}
.saved-story-grid:empty{display:none}
.saved-story-image>.reference-art{position:absolute;inset:0}
.member-profile .favorite-world>.favorite-world-art{position:relative;width:90px;height:76px;flex:none;overflow:hidden;border-radius:4px}
.favorite-world-art>.reference-art,.favorite-world-art>img{width:100%;height:100%;object-fit:cover}
.member-profile .favorite-world{padding:0;gap:15px;margin:0 0 14px}
.member-profile .favorite-world:last-child{margin-bottom:0}
.member-profile .profile-sidebar>.favorite-worlds{padding:14px 22px 9px}
.member-profile .favorite-worlds h2{font-size:27px;line-height:1.2;margin-bottom:8px}
.member-profile .favorite-world>span:not(.favorite-world-art){flex:1;min-width:0}
.profile-role-guide{margin:16px 0 0;padding-top:4px;border-top:1px solid var(--wine);font-family:'Times New Roman',Times,serif}
.profile-role-guide h2{font-size:30px;line-height:1.1;margin:0 0 5px}
.profile-role-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.profile-role-card{display:flex;align-items:center;gap:18px;padding:8px 12px;border:1px solid var(--line);border-radius:6px;background:#faf7f255;min-width:0}
.profile-role-card .role-avatar{display:block;flex:none;width:80px;height:80px;border:2px solid #fff;border-radius:50%;overflow:hidden}
.role-avatar>img{display:block;width:100%;height:100%;object-fit:cover}
.role-card-copy{flex:1;min-width:0}
.role-card-name{display:flex;align-items:center;gap:14px;margin:0 0 4px;font-weight:bold;font-size:20px;line-height:1.1}
.role-card-name>a,.role-card-name>span:not(.vip-badge){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile-role-card .role-badge{font:18px/1.15 'Times New Roman',Times,serif;padding:5px 9px;max-width:100%}
.profile-role-card .role-badge .icon{width:20px;height:20px}
.profile-role-card .vip-badge{font:14px/1.1 'Times New Roman',Times,serif;gap:5px;padding:3px 8px}
.profile-role-card p{font-size:14px;line-height:1.2;margin:4px 0 0;color:var(--muted)}
.role-guide-note{display:flex;align-items:center;justify-content:center;gap:24px;text-align:center;font-size:14px;margin:10px auto 0;color:var(--muted)}
.role-guide-note::before,.role-guide-note::after{content:'';height:1px;background:#a59b94;width:17%;max-width:260px}
/* The original artwork includes bookmark outlines. A real HTML control sits over
   each outline. Only a hover/focus/selected state draws a new, opaque control. */
.reference-bookmark .card-bookmark .button{background:transparent;border:0;box-shadow:none;color:white}
.reference-bookmark .card-bookmark .button:not(.selected):not(:hover):not(:focus-visible)>.icon{opacity:0}
.reference-bookmark .card-bookmark .button.selected,.reference-bookmark .card-bookmark .button:hover,.reference-bookmark .card-bookmark .button:focus-visible{background:#542038}
.member-profile .reference-bookmark .card-bookmark{top:5px;right:7px}
.member-profile .reference-bookmark .card-bookmark .button{width:36px;height:38px;padding:6px 8px}
.member-profile .reference-bookmark .card-bookmark .button.selected .icon{fill:currentColor}
.saved-story h3{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap!important;border:0!important}
.collection-help{position:relative;display:inline-flex;vertical-align:middle;margin-left:7px;color:#8d7f76;cursor:help;outline-offset:3px}
.collection-help>.icon{width:15px;height:15px}
.collection-help-tip{display:none;position:absolute;left:0;top:calc(100% + 8px);z-index:10;width:220px;padding:10px 12px;background:#f8f5ef;border:1px solid #d7ccc1;border-radius:5px;box-shadow:0 4px 14px #0002;white-space:normal;font:15px/1.3 'Times New Roman',Times,serif;color:#4d3b32;letter-spacing:normal}
.collection-help:hover>.collection-help-tip,.collection-help:focus>.collection-help-tip{display:block}
.favorite-worlds .collection-help-tip{left:auto;right:0}
.biography-spoilers{margin-top:20px}
.spoiler-toggle{display:flex;justify-content:space-between;align-items:center;gap:16px;list-style:none;padding:10px 14px;font-size:16px;cursor:pointer}
.spoiler-toggle::-webkit-details-marker{display:none}
.spoiler-toggle>span{display:flex;gap:12px;align-items:center}
.spoiler-state{font-size:14px}.spoiler-state .icon{width:17px;height:17px;transform:rotate(90deg)}
.biography-spoilers:not([open]) .when-open,.biography-spoilers[open] .when-closed{display:none}
.biography-spoilers[open] .spoiler-state .icon{transform:rotate(-90deg)}
.biography-heading{font-size:40px;margin:20px 0 10px;padding-top:10px;border-top:1px solid var(--line)}
.dossier-body .prose section{margin:0 0 18px}
.dossier-body .prose h3{font-size:26px;margin:0 0 8px}
.dossier-body .prose p{line-height:1.55}
.biography-illustration,.article-hero-art{position:relative;margin:18px 0 24px;overflow:hidden;border-radius:4px;aspect-ratio:3.34}
.biography-illustration>.reference-art,.biography-illustration>img,.article-hero-art>.reference-art,.article-hero-art>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.article-hero-art{aspect-ratio:3.28;margin-top:22px}
.dossier-name-line{display:flex;gap:20px;align-items:center;flex-wrap:wrap}
.dossier-name-line .eyebrow,.article-category{background:#e1d0d5;padding:5px 10px;margin:0;font:13px Georgia,serif;letter-spacing:.08em}
.dossier-name-line h1{margin:0}
.dossier-body .original-name{font-size:23px;margin:8px 0 0}
.contents-nav a.active{background:#e3d9db;border-left:4px solid var(--wine);padding-left:12px}
.related-characters>a{display:flex;align-items:center;gap:16px}
.related-characters>a>.portrait{width:96px;height:64px;flex:none}
.related-characters>a>strong{font-size:20px;flex:1}
.related-characters>a>.icon{width:22px;height:22px;flex:none}
.dossier-articles .article-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.dossier-articles .article-card.compact{grid-template-columns:34% minmax(0,1fr)}
.article-person .button.primary{color:#fff9f4}
.article-person dl{grid-template-columns:34% minmax(0,1fr)}
.article-sidebar>.toc,.article-sidebar>.read-also,.article-sidebar>.other-article-characters{padding-top:18px;margin-top:24px;border-top:1px solid var(--line)}
.article-character-link{display:flex;align-items:center;gap:14px;padding:12px 0;border-bottom:1px solid var(--line)}
.article-character-link .portrait{width:72px;height:64px;flex:none}.article-character-link>span:not(.portrait){flex:1}
@media(min-width:1101px){
 .dossier-layout{grid-template-columns:228px minmax(0,1fr) 408px;gap:26px}
 .dossier-info{padding-left:14px}.dossier-info>.portrait-large{aspect-ratio:408/346}
 .detail-title{gap:16px;flex-wrap:nowrap}.detail-title>div{min-width:0}.detail-title h1{font-size:48px}
 .detail-title>.inline-form{flex:none}.dossier-body .lead{font-size:19px;line-height:1.45;margin:18px 0}
 .contents-nav h3{font-size:25px}.contents-nav a{font-size:18px;padding:10px 14px}
 .facts h2,.related-characters h2{font-size:26px}.facts dl{font-size:16px}
 .article-layout{grid-template-columns:minmax(0,1.88fr) minmax(0,1fr);gap:26px}
 .article-sidebar{padding-left:24px}.article-title{font-size:52px;line-height:1.04;margin-top:14px}
 .article-layout>article>.lead{font-size:24px;line-height:1.35;margin:18px 0 24px}
 .article-sidebar>section>h2{font-size:34px}
 .article-person{gap:20px;margin:14px 0 0;grid-template-columns:39% minmax(0,1fr)}
 .article-person>.portrait{min-height:248px}.article-person>div{padding:18px 18px 18px 0}
 .article-person h3{font-size:29px}.article-person p{font-size:17px}.article-person dl{font-size:16px}
 .article-person .button{font-size:16px;width:100%;padding:12px 10px}
}
@media(min-width:951px){
 .editorial-column .article-card.compact{min-height:136px;align-items:start}
 .editorial-column .article-card h3{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:22px;line-height:1.12;margin:5px 0 7px}
 .editorial-column .article-card p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;line-height:1.3;font-size:15px;padding-right:12px}
 .editorial-column .article-card .text-link{position:absolute;right:0;bottom:0;background:var(--paper);padding-left:4px}
 .editorial-column .article-card .eyebrow{padding:3px 6px}
 .home-columns .editorial-column{align-self:start}
}
@media(min-width:1101px) and (max-width:1400px){
 .member-profile .profile-content{grid-template-columns:minmax(0,1fr) 300px;padding-left:28px;padding-right:28px;gap:22px}
 .member-profile .profile-identity{grid-template-columns:190px minmax(0,1fr) auto;padding-left:28px;padding-right:28px;gap:22px}
 .member-profile .member-avatar{width:190px;height:190px;margin-top:-70px}
 .member-profile .member-name h1{font-size:39px}.member-profile .profile-identity-actions .button{font-size:14px;padding:10px 12px}
 .member-profile .section-heading h2{font-size:27px}.member-profile .section-heading .text-link{font-size:14px}
 .member-profile .character-tile h3{font-size:17px}.member-profile .character-tile .tile-world{font-size:14px}
 .member-profile .profile-sidebar h2{font-size:23px}.member-profile .profile-sidebar>.profile-vip-panel{grid-template-columns:44px minmax(0,1fr);gap:17px 12px;padding:16px;min-height:148px}.member-profile .vip-panel-crown{width:44px;height:44px}.member-profile .profile-vip-panel h2{font-size:23px}.member-profile .profile-vip-panel p{font-size:15px}.member-profile .favorite-world>.favorite-world-art{width:70px;height:62px}
 .member-profile .favorite-world strong{font-size:16px}.member-profile .favorite-world small{font-size:12px}
 .dossier-layout{grid-template-columns:180px minmax(0,1fr) 320px;gap:22px}.detail-title h1{font-size:38px}
 .dossier-name-line{gap:10px}.article-title{font-size:44px}.article-sidebar>section>h2{font-size:29px}
}
@media(max-width:1100px){
 .profile-page .brand{font-size:29px}.profile-page .main-nav a{font-size:15px}
 .profile-page .header-inner{min-height:54px;padding-left:24px;padding-right:24px}
 .member-profile .profile-counts>span{font-size:15px}.member-profile .role-badge,.member-profile .vip-badge{font-size:15px}
 .member-profile .member-name h1{font-size:36px}.member-profile .member-bio{font-size:16px}
 .member-profile .profile-identity-actions .button{font-size:14px;min-height:38px;padding:9px 12px}
 .member-profile .profile-tabs a{font-size:16px;padding:12px 20px}
 .member-profile .character-tile .tile-world{font-size:13px}
 .member-profile .favorite-world>.favorite-world-art{width:58px;height:52px}.member-profile .favorite-world strong{font-size:15px}
 .member-profile .profile-sidebar>.profile-vip-panel{grid-template-columns:40px minmax(0,1fr);padding:15px 12px;gap:18px 10px;min-height:142px}.member-profile .vip-panel-crown{width:40px;height:40px}.member-profile .profile-vip-panel h2{font-size:20px}.member-profile .profile-vip-panel p{font-size:14px}
 .member-profile .profile-vip-panel .text-link{font-size:15px}.member-profile .profile-vip-panel>.icon{width:40px;height:40px}
 .profile-role-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .profile-role-card .role-avatar{width:70px;height:70px}
 .saved-story h3{font-size:17px}.saved-story p{font-size:13px}
}
@media(max-width:760px){
 .profile-page .header-inner{min-height:48px;padding-left:17px;padding-right:17px}
 .profile-page .brand{font-size:25px}.profile-page .brand>.icon{width:28px;height:28px}
 .member-profile .member-name h1{font-size:27px}.member-profile .member-bio{font-size:14px}
 .member-profile .member-handle{font-size:12px}.member-profile .role-badge,.member-profile .vip-badge{font-size:12px;padding:4px 7px}
 .member-profile .profile-counts>span{font-size:12px}.member-profile .profile-identity-actions .button{font-size:13px;padding:8px 10px;min-height:34px}
 .member-profile .profile-tabs{padding:0 16px;gap:8px}.member-profile .profile-tabs a{font-size:14px;padding:10px 8px}
 .member-profile .character-tile .tile-world{font-size:12px}.member-profile .collection-hint{font-size:13px}
 .member-profile .favorite-world>.favorite-world-art{width:62px;height:55px}.member-profile .profile-vip-panel{min-height:126px}
 .saved-story h3{font-size:15px;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
 .member-profile .saved-story.reference-bookmark .card-bookmark{right:calc(64% + 3px);top:3px}.member-profile .saved-story.reference-bookmark .card-bookmark .button{width:26px;height:28px;padding:4px}.saved-story.reference-bookmark .card-bookmark .button:not(.selected):not(:hover):not(:focus-visible)>.icon{opacity:1}
 .member-profile .profile-sidebar>.profile-vip-panel{grid-template-columns:44px minmax(0,1fr);padding:18px 20px;gap:20px 14px}.member-profile .profile-vip-panel h2{font-size:clamp(20px,5.8vw,24px)}.member-profile .vip-panel-crown{width:44px;height:44px}
 .profile-role-guide{margin:20px 16px 0}.profile-role-guide h2{font-size:25px}
 .profile-role-grid{grid-template-columns:1fr;gap:10px}.profile-role-card{padding:10px 12px;gap:16px}.profile-role-card .role-avatar{width:64px;height:64px}.role-card-name{font-size:19px}
 .profile-role-card .role-badge{font-size:15px;padding:4px 7px}.profile-role-card p{font-size:13px}
 .article-title{font-size:35px}.article-hero-art{aspect-ratio:2.2}.biography-illustration{aspect-ratio:2.5}
 .dossier-name-line{gap:10px}.dossier-body .original-name{font-size:19px}.biography-heading{font-size:32px}
 .dossier-articles .article-grid{grid-template-columns:1fr}
}
@media(min-width:1101px) and (max-width:1280px){.profile-role-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Separate destructive actions from the editor save bar. */
.admin-page .admin-delete-zone{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-top:40px;padding:24px;border:1px solid var(--line);border-radius:8px;background:var(--white)}
.admin-page .admin-delete-zone p{margin:6px 0 0;color:var(--muted);font:13px/1.5 Arial,sans-serif}
.admin-page .admin-delete-zone .button{flex-shrink:0;margin:0}
@media(max-width:600px){.admin-page .admin-delete-zone{align-items:flex-start;flex-direction:column;gap:16px;margin-top:32px}}

/* Generated empty states retain the entire caption in every aspect ratio. */
html img.image-placeholder,html img[src*="placeholder-"]{object-fit:contain!important;object-position:center!important;background:#242127}
.prose.rich-prose{overflow-wrap:anywhere;line-height:1.8}
.prose.rich-prose p{white-space:normal;margin:0 0 1em}
.prose.rich-prose :is(h2,h3,h4){margin:1.5em 0 .65em;scroll-margin-top:24px}
.prose.rich-prose :is(ul,ol){padding-left:1.6em;margin:1em 0;list-style-position:outside}
.prose.rich-prose ul{list-style-type:disc}.prose.rich-prose ol{list-style-type:decimal}
.prose.rich-prose li{margin:.4em 0}.prose.rich-prose blockquote{border-left:3px solid var(--wine);margin:1.5em 0;padding:.5em 1.2em;background:var(--white)}
.prose.rich-prose img{width:auto;max-width:100%!important;height:auto!important;aspect-ratio:auto!important;object-fit:contain;display:inline-block;border-radius:5px}
.prose.rich-prose table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;margin:1.5em 0;font-size:15px}
.prose.rich-prose :is(td,th){border:1px solid var(--line);padding:10px 12px;min-width:80px}
.prose.rich-prose th{background:var(--white);font-weight:bold}
.prose.rich-prose pre{white-space:pre-wrap;overflow-x:auto;background:var(--white);border:1px solid var(--line);border-radius:5px;padding:16px;font-size:14px}
.prose.rich-prose hr{border:0;border-top:1px solid var(--line);margin:2em 0}
.dossier-body #relations{container:character-relations/inline-size;min-width:0}
.dossier-body .relation-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:stretch}
.dossier-body .relation-card{display:grid;grid-template-columns:80px minmax(0,1fr);align-items:start;gap:14px;width:100%;height:180px;max-width:none;min-width:0;padding:12px;border:1px solid var(--line);border-radius:7px;background:var(--white)}
.dossier-body .relation-card>.portrait{width:80px;height:100px;aspect-ratio:4/5;flex:0 0 80px;border-radius:4px;overflow:hidden}
.dossier-body .relation-card .portrait img,.related-characters .portrait img{display:block;width:100%;height:100%;object-fit:cover;object-position:center 25%}
.dossier-body .relation-copy{display:flex;flex-direction:column;gap:6px;min-width:0;height:100%;overflow:hidden}
.dossier-body .relation-copy strong{flex-shrink:0;min-height:2.6em;font-size:18px;line-height:1.3;overflow-wrap:anywhere}
.dossier-body .relation-copy small{flex-shrink:0;min-height:2.8em;font-size:12px;line-height:1.4;color:var(--muted)}
.dossier-body .relation-copy>span{font:12px/1.4 Arial,sans-serif;color:var(--wine)}
.dossier-body .relation-copy>.content-metrics{flex-shrink:0;flex-wrap:nowrap;gap:7px;min-height:24px;max-width:100%;margin:0;overflow:hidden;color:var(--muted);font:11px/1.4 Arial,sans-serif}
.dossier-body .relation-copy .metric-rating{font-size:10px;padding:2px 4px}
.dossier-body .relation-copy .metric-score{font-size:11px}.dossier-body .relation-copy .metric-scale,.dossier-body .relation-copy .metric-count{font-size:10px}
.dossier-body .relation-copy>.relation-open{flex-shrink:0;margin-top:auto;color:var(--theme-link,var(--wine))}
.dossier-body .relation-card:hover{border-color:var(--theme-link,var(--wine))}
.dossier-body .relation-card:focus-visible{outline:3px solid var(--theme-link,var(--wine));outline-offset:3px}
@container character-relations (max-width:580px){.dossier-body .relation-cards{grid-template-columns:1fr}}
.dossier-info .related-characters>a{gap:12px;padding:12px 0;align-items:center;min-width:0}
.dossier-info .related-characters>a>.portrait{width:60px;height:75px;aspect-ratio:4/5;flex:0 0 60px;border-radius:4px;overflow:hidden}
.dossier-info .related-characters>a>strong{font-size:17px;line-height:1.3;min-width:0;overflow-wrap:anywhere}
.dossier-info .related-characters>a>.icon{width:16px;height:16px}
/* One proportional sprite viewport for tables, cards, profiles and sidebars. */
.portrait>.portrait-sprite{display:block;position:absolute;inset:0;width:100%;height:100%;overflow:hidden}
/* Editing previews show the complete upload, including tall portraits/banners. */
.engine-form img.image-preview{object-fit:contain;object-position:center}

/* Explicit opt-in to show uncropped thumbnails; placeholders remain fully visible. */
html[data-image-fit="contain"] :is(.portrait,.article-cover,.article-hero-art,.biography-illustration,.universe-banner,.universe-hero,.universe-directory-image,.saved-story-image,.favorite-world-art,.profile-cover)>img{object-fit:contain!important}

/* Uploaded biography illustrations retain their full image, including portraits. */
.biography-illustration.biography-full-image{height:auto;aspect-ratio:auto;background:var(--paper)}
.biography-illustration.biography-full-image>img{position:static;display:block;inset:auto;width:auto;max-width:100%;height:auto;max-height:520px;object-fit:contain;object-position:center;margin:0 auto}

/* Article covers keep a useful height and show the complete original. */
.article-grid .article-cover,.featured-story .article-card .article-cover,.profile-content .article-card .article-cover{position:relative;width:100%;height:auto;min-height:0;aspect-ratio:16/10;background:var(--paper)}
.article-card .article-cover>img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;object-position:center}
.article-card:hover .article-cover>img{transform:none}
.article-hero-art{aspect-ratio:auto;height:auto;min-height:0;background:var(--paper)}
.article-hero-art>img{position:static;inset:auto;display:block;width:100%;height:auto;max-height:none;object-fit:contain;object-position:center}
.saved-story-image{width:100%;height:auto;min-height:0;aspect-ratio:16/10;background:var(--paper)}
.saved-story-image>img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;object-position:center}
.saved-story-copy{padding:12px 14px}
.saved-story h3{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.3}
@media(max-width:760px){
 .member-profile .saved-story{grid-template-columns:minmax(0,38fr) minmax(0,62fr);align-items:start}
 .member-profile .saved-story-image{height:auto;min-height:0;aspect-ratio:4/3}
 .member-profile .saved-story-copy{padding:10px}
 .member-profile .saved-story .card-bookmark{right:calc(62% + 5px);top:5px}
 .member-profile .saved-story.reference-bookmark .card-bookmark{right:calc(62% + 5px);top:5px}
}

/* Uniform relation cards with an explicit relationship and a bounded note. */
.dossier-body .typed-relations .relation-card{height:220px}
.dossier-body .relation-copy>.relation-kind{flex-shrink:0;align-self:flex-start;max-width:100%;min-height:22px;margin:0;padding:3px 6px;border:1px solid var(--line);border-radius:4px;background:var(--paper);color:var(--theme-link,var(--wine));font:600 11px/1.3 Arial,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Integration status cards */
.admin-service-statuses{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:18px}.admin-service-statuses>div{padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--white)}.admin-service-statuses strong{display:block;margin-bottom:10px}.admin-service-statuses p{font-size:13px;line-height:1.55;margin:10px 0 0;overflow-wrap:anywhere}@media(max-width:800px){.admin-service-statuses{grid-template-columns:1fr}}
