/* Two appearance templates share the same content and bounded page layout. */
:root{color-scheme:light}
.theme-switch{display:inline-flex;align-items:center;gap:2px;flex:none;padding:3px;border:1px solid #806570;border-radius:6px;background:#ffffff05}
.theme-switch[hidden]{display:none}
.theme-switch button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:32px;padding:6px 9px;border-radius:3px;color:#e5d4d9;font:13px/1.2 Georgia,serif;white-space:nowrap;cursor:pointer}
.theme-switch .icon{width:15px;height:15px}
.theme-switch button:hover{background:#ffffff12;color:#fff}
.theme-switch button[aria-pressed="true"]{background:#efe6dd;color:#30151f}
.theme-switch button:focus-visible{outline:2px solid #f5d5e4;outline-offset:3px}
:is(.public-page,.admin-page) .site-header .header-inner{column-gap:18px}
.site-header .header-inner .header-search{min-width:0}
@media(min-width:761px) and (max-width:1250px){
 :is(.public-page,.admin-page) .site-header .header-inner{flex-wrap:wrap;row-gap:10px;padding-top:10px;padding-bottom:10px}
 .site-header .header-inner .header-search{order:4;flex:1 0 100%;max-width:none;margin:0}
 .site-header .theme-switch{margin-left:auto}
 .site-header .header-inner .main-nav{gap:16px}
}
@media(max-width:760px){
 :is(.public-page,.admin-page) .site-header .header-inner{flex-wrap:wrap;height:auto;min-height:48px;row-gap:10px;padding-top:10px;padding-bottom:10px}
 .site-header .theme-switch{order:5;flex:1 0 100%;margin:0}
 .site-header .theme-switch button{flex:1;min-height:36px}
 .profile-page .main-nav{top:100%}
}

html[data-theme="dark"]{
 color-scheme:dark;
 --paper:#141519;--white:#1c1d23;--ink:#eee8e4;--muted:#b7abb2;
 --line:#393740;--light:#2a2832;--header:#151218;--wine:#88435f;
 --theme-link:#e8aec5;--theme-field:#191a20;--theme-raised:#25242d;
 --theme-hover:#352b38;--theme-prose:#d1c7cd;
}
html[data-theme="dark"][data-palette="forest"]{--wine:#356b59;--theme-link:#a4d9bc}
html[data-theme="dark"][data-palette="slate"]{--wine:#52629b;--theme-link:#b6c5f5}
html[data-theme="dark"] body{background:radial-gradient(ellipse at 20% 0%,#63334618,transparent 55%),var(--paper);color:var(--ink)}
html[data-theme="dark"] ::selection{background:#88435f;color:#fff}
html[data-theme="dark"] p{color:var(--muted)}
html[data-theme="dark"] .prose p{color:var(--theme-prose)}
html[data-theme="dark"] :is(.lead,.breadcrumbs,.result-count,.form-field,.setting-field>span){color:var(--muted)}
html[data-theme="dark"] :is(.text-link,.row-arrow,.eyebrow,.reset-button,.edit-button,.delete-button,.settings-jump a,.dashboard-card strong,.profile-feedback,.owner-badge,.tabs a.active,.tabs button.active,.contents-nav a:hover,.character-name:hover){color:var(--theme-link)}
html[data-theme="dark"] :is(.tabs a.active,.profile-tabs a.active){border-bottom-color:var(--theme-link)}
html[data-theme="dark"] :is(a,button,input,select,textarea):focus-visible{outline-color:var(--theme-link)}
html[data-theme="dark"] .search-input:focus-within{border-color:var(--theme-link);outline:2px solid var(--theme-link);outline-offset:2px}
html[data-theme="dark"] .skip-link{background:var(--theme-raised);color:var(--ink)}

/* Header, navigation and forms. */
html[data-theme="dark"] .site-header{background:#151218;border-bottom:1px solid var(--line)}
html[data-theme="dark"] .profile-page .site-header{background:linear-gradient(115deg,#22151e,#19151e)}
html[data-theme="dark"] .theme-switch{background:#ffffff03;border-color:#63525e}
html[data-theme="dark"] .theme-switch button[aria-pressed="true"]{background:var(--wine);color:#fff}
html[data-theme="dark"] :is(input,select,textarea){background:var(--theme-field);color:var(--ink);border-color:var(--line);accent-color:var(--theme-link)}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#a499a2;opacity:1}
html[data-theme="dark"] select option{background:var(--theme-field);color:var(--ink)}
html[data-theme="dark"] input::file-selector-button{background:var(--theme-raised);color:var(--ink);border:1px solid var(--line);border-radius:3px;padding:6px 10px;margin-right:10px;cursor:pointer}
html[data-theme="dark"] .header-search{background:#ffffff04;border-color:#63525e;color:#e5d9e0}
html[data-theme="dark"] .header-search input{background:transparent;color:inherit}
html[data-theme="dark"] .search-input{background:var(--theme-field)}
html[data-theme="dark"] :is(.catalog-search-field,.filter-search) input{background:transparent}
html[data-theme="dark"] :is(.engine-form,.account-card,.auth-page,.form-field,.setting-field) :is(input,textarea,select){background:var(--theme-field);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(.button:hover,.contents-nav a:hover,.contents-nav a.active,.moderation-menu>div>*:hover){background:var(--theme-hover);color:var(--ink)}
html[data-theme="dark"] :is(.button.primary,.button.selected,.view-toggle .selected,.alphabet a.active,.pagination a.active,.filter-choice.active,.filter-option.active>span,.duration-choices input:checked+span,.ban-type-choices input:checked+span){background:var(--wine);color:#fff}
html[data-theme="dark"] .filter-option>span{border-color:#69616e}
html[data-theme="dark"] :is(.filters,.filters.always-visible){background:transparent}
html[data-theme="dark"] .site-announcement{background:#30232e}
html[data-theme="dark"] .site-announcement p{color:var(--ink)}
html[data-theme="dark"] .site-announcement a{color:var(--theme-link)}

/* Registry, cards, articles and dossier details. */
html[data-theme="dark"] :is(.character-table thead,.engine-table th,.admin-table th){background:#2b2832;color:#e6d5de}
html[data-theme="dark"] :is(.character-table,.engine-table,.admin-table) tbody tr{background:var(--white)}
html[data-theme="dark"] :is(.character-table,.engine-table,.admin-table) tbody tr:nth-child(even){background:#232229}
html[data-theme="dark"] :is(.character-table,.engine-table,.admin-table) tbody tr:hover{background:var(--theme-hover)}
html[data-theme="dark"] :is(.article-card,.character-tile,.universe-directory>article,.facts,.article-person){background:var(--white);border-color:var(--line)}
html[data-theme="dark"] .article-card.compact{background:transparent}
html[data-theme="dark"] :is(.article-card .eyebrow,.dossier-name-line .eyebrow,.article-category,.spoiler-toggle,.owner-badge){background:#382a35;color:var(--theme-link)}
html[data-theme="dark"] .appearances li{background:var(--theme-raised)}
html[data-theme="dark"] .appearances li:nth-child(even){background:transparent}
html[data-theme="dark"] :is(.universe-banner,.universe-hero,.game-card) p{color:#efe5e7}

/* Profiles keep their cover art and VIP accents in either appearance. */
html[data-theme="dark"] .member-profile{background:var(--white)}
html[data-theme="dark"] .member-profile.accent-gold{--wine:#755924;--theme-link:#e6c58b}
html[data-theme="dark"] .member-profile.accent-forest{--wine:#356b59;--theme-link:#a4d9bc}
html[data-theme="dark"] .member-profile.accent-night{--wine:#52629b;--theme-link:#b6c5f5}
html[data-theme="dark"] .member-profile .member-avatar{border-color:var(--white)}
html[data-theme="dark"] :is(.member-profile .member-name h1,.member-profile .character-tile h3,.saved-story h3,.member-profile .favorite-world strong,.member-profile .profile-counts>span,.member-profile .profile-counts .icon){color:var(--ink)}
html[data-theme="dark"] :is(.member-profile .member-handle,.member-profile .character-tile .tile-world,.saved-story p,.member-profile .favorite-world small,.member-profile .profile-private-note,.drawer-user-handle){color:var(--muted)}
html[data-theme="dark"] :is(.member-profile .section-heading h2,.member-profile .profile-sidebar h2){color:var(--ink)}
html[data-theme="dark"] .member-profile .profile-tabs a{color:var(--muted)}
html[data-theme="dark"] .member-profile .profile-tabs a.active{color:var(--theme-link);border-bottom-color:var(--theme-link)}
html[data-theme="dark"] :is(.member-profile .character-tile,.saved-story,.member-profile .profile-sidebar>section,.profile-role-card){background:var(--white);border-color:var(--line)}
html[data-theme="dark"] .member-profile .profile-empty{background:#ffffff03;color:var(--muted)}
html[data-theme="dark"] .member-profile .profile-empty a{color:var(--theme-link)}
html[data-theme="dark"] .member-profile .profile-sidebar>.profile-vip-panel{background:linear-gradient(120deg,#3b2c1e,#28231e);border:1px solid #624c2c}
html[data-theme="dark"] .member-profile .profile-vip-panel h2{color:#edd09c}
html[data-theme="dark"] .member-profile .profile-vip-panel p{color:#cebaa1}
html[data-theme="dark"] .member-profile .profile-vip-panel .text-link{color:#edd09c}
html[data-theme="dark"] .vip-panel-crown{color:#e1b262}
html[data-theme="dark"] .vip-panel-watermark{color:#dab67425}
html[data-theme="dark"] .collection-help{color:var(--muted)}
html[data-theme="dark"] .collection-help-tip{background:var(--theme-raised);color:var(--ink);border-color:var(--line);box-shadow:0 8px 24px #0005}
html[data-theme="dark"] .role-admin{background:#532b3c;color:#f2bfd2}
html[data-theme="dark"] .role-moderator{background:#1c4850;color:#b5e4e9}
html[data-theme="dark"] .role-editor{background:#2b4062;color:#c4dbfa}
html[data-theme="dark"] .role-user{background:#3c3b44;color:#e2dce3}
html[data-theme="dark"] .vip-badge{background:#594323;color:#f3d79b}
html[data-theme="dark"] .role-text-admin{color:#efb2c7}
html[data-theme="dark"] .role-text-moderator{color:#91d9df}
html[data-theme="dark"] .role-text-editor{color:#aacbfa}

/* Administration, account forms and moderation. */
html[data-theme="dark"] :is(.admin-shell,.admin-workspace){background:transparent}
html[data-theme="dark"] :is(.stat-card,.panel,.settings-group,.admin-user-card,.user-group-card,.admin-settings-jump a,.account-card,.auth-page>section,.settings-section,.settings-savebar,.admin-table-wrap,.ad-placement-cards>div,.editor-panel,.editor-actions,.moderation-drawer,.moderation-menu>div){background:var(--white);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .admin-workspace .engine-form>.action-row{background:var(--white)}
html[data-theme="dark"] :is(.settings-note,.internal-note){background:var(--theme-raised)}
html[data-theme="dark"] :is(.engine-form small,.setting-field small,.setting-switch small,.dashboard-card span,.recent-records time,.form-field small,.admin-table td small,.profile-image-fields small,.moderation-history small,.moderation-menu .moderation-menu-note,.moderation-drawer .engine-form .field-counter,.moderation-drawer .ban-expiry,.moderation-drawer .drawer-footnote){color:var(--muted)}
html[data-theme="dark"] .moderation-menu summary.button{background:#382431;color:#f1b8cc;border-color:#825367}
html[data-theme="dark"] .moderation-menu>div>button[data-ban-mode]{color:#ffacb9}
html[data-theme="dark"] .moderation-drawer .engine-form textarea{background:var(--theme-field)}
html[data-theme="dark"] .moderation-drawer .ban-type-choices{border-color:var(--line)}
html[data-theme="dark"] .moderation-drawer::backdrop{background:#07060ac9}
html[data-theme="dark"] :is(.blocked-profile,.member-profile .blocked-profile,.notice.error,.blocked-badge){background:#3a222b;color:#f4b9c3;border-color:#744550}
html[data-theme="dark"] :is(.blocked-profile,.profile-warning,.notice.error) p{color:inherit}
html[data-theme="dark"] :is(.profile-warning,.moderation-caution,.moderation-drawer .ban-notice){background:#382e1e;color:#e8c99b;border-color:#695739}
html[data-theme="dark"] :is(.notice:not(.error),.notice.success,.status-pill.live){background:#22372d;color:#b4dec1;border-color:#456653}
html[data-theme="dark"] .status-pill{background:#383025;color:#e2c89b}
html[data-theme="dark"] :is(.ban-label,.bad,.sanction-kind .icon){color:#f0a4b7}
html[data-theme="dark"] .badge-draft{color:#e3c38c}
html[data-theme="dark"] .ok{color:#a1d4af}
/* The settings swatches intentionally preview the configured light palette. */
html[data-theme="dark"] .settings-preview{background:#f1eee9;color:#321b25}
html[data-theme="dark"] .settings-preview p{color:#685b62}
