/* Shared Cosmic content palette. Deliberately no layout, typography or behavior. */
html body.faithful-target[data-board-background=cosmic] .connection-panel :is(.notice:not(.error):not(.resource-shortfall),.your-access){color:#f6ebd6!important;background:transparent!important;}
html body.faithful-target[data-board-background=cosmic] .connection-panel .connection-status:not(.active){color:#c7bda9!important;}
html body.faithful-target[data-board-background=cosmic] #end.online-final-standings{background:#111c29!important;color:#f6ebd6!important;border-color:#a2bcc03b!important;}
html body.faithful-target[data-board-background=cosmic] #end.online-final-standings :is(h2,th,td,.standings-player,.standings-points,.company-name){color:#f6ebd6!important;}
html body.faithful-target[data-board-background=cosmic] #end.online-final-standings :is(thead th,.eyebrow){color:#c7bda9!important;}
html body.faithful-target[data-board-background=cosmic] #end.online-final-standings :is(th,td){border-color:#a2bcc03b!important;}
html body.faithful-target[data-board-background=cosmic] #end.online-final-standings .standings-rank{color:#caac72!important;}
/* A single dialog surface: no second dark rectangle behind reveal/choice content. */
html body.faithful-target[data-board-background=cosmic] #modal #modalbody,
html body.faithful-target[data-board-background=cosmic] :is(.scan-choice,.scan-choice-grid,.scan-option,.research-reveal){background:transparent!important;}
html body.faithful-target[data-board-background=cosmic] :is(.scan-choice,.research-reveal){color:#f6ebd6!important;}
html body.faithful-target[data-board-background=cosmic] .sw-research-card,
html body.faithful-target[data-board-background=cosmic] #modal .sw-research-card{background:#111c29!important;color:#f6ebd6!important;border-color:#a2bcc03b!important;box-shadow:none!important;}
html body.faithful-target[data-board-background=cosmic] .sw-research-card .research-card-copy{background:transparent!important;color:#f6ebd6!important;}
html body.faithful-target[data-board-background=cosmic] .sw-research-card :is(h3,.research-description,.research-card-rewards,.research-card-rewards strong,.research-card-rewards span){color:#f6ebd6!important;}
html body.faithful-target[data-board-background=cosmic] .sw-research-card :is(.research-card-count,.research-quantity){color:#c7bda9!important;}
html body.faithful-target[data-board-background=cosmic] .sw-research-card .research-category{color:#caac72!important;}
html body.faithful-target[data-board-background=cosmic] .sw-research-card.damage .research-category{color:#ffb8ad!important;}
html body.faithful-target[data-board-background=cosmic] .sw-research-card .research-card-rewards{border-color:#a2bcc03b!important;}
html body.faithful-target[data-board-background=cosmic] #end.online-final-standings .standings-footer button{background:#0b1520!important;color:#f6ebd6!important;border-color:#a2bcc03b!important;}
html body.faithful-target[data-board-background=cosmic] .connection-panel{background:transparent!important;color:#f6ebd6!important;}
html body.faithful-target[data-board-background=cosmic] .connection-panel :is(h3,.role-heading strong){color:#f6ebd6!important;}
html body.faithful-target[data-board-background=cosmic] .connection-panel .connection-status:not(.active){background:transparent!important;border-color:#a2bcc03b!important;}
/* Cosmic contrast contract: all game windows use explicit surface/ink pairs.
   Palette only; leave Tabletop, geometry, owner colours and gameplay untouched. */
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet){
 --cosmic-control:#162a3b;--cosmic-control-hover:#223d50;--cosmic-control-ink:#f6ebd6;
 --cosmic-control-line:#718597;--cosmic-warning:#35212c;--cosmic-warning-ink:#ffceca;
 color:#f6ebd6;
}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) button{
 background:var(--cosmic-control)!important;color:var(--cosmic-control-ink)!important;border-color:var(--cosmic-control-line)!important;text-shadow:none!important;opacity:1;box-shadow:none!important;
}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) button:is(.primary,[aria-pressed=true],[aria-selected=true]):not(:disabled){background:#c8ad79!important;color:#17202c!important;border-color:#d4bd94!important;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) button:hover:not(:disabled){background:var(--cosmic-control-hover)!important;color:#fff3df!important;border-color:#c8ad79!important;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) button:disabled{background:#1e2c37!important;color:#b9c4c9!important;border-color:#536573!important;opacity:1!important;cursor:not-allowed;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) :is(button,input,select,summary,a):focus-visible{outline:2px solid #8de4eb!important;outline-offset:3px;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) :is(label,legend,summary){color:#f6ebd6!important;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) :is(.notice,.your-access,.cost-breakdown,.access-choice label,.generator-prerequisites,.generator-draft-notice){background:#192b3c!important;color:#f6ebd6!important;border-color:#718597!important;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) :is(.notice.error,.resource-shortfall){background:var(--cosmic-warning)!important;color:var(--cosmic-warning-ink)!important;border-color:#e09a98!important;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) :is(.notice.error,.resource-shortfall) :is(p,strong,small,span){color:var(--cosmic-warning-ink)!important;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) a{color:#8de4eb!important;text-decoration:underline;}
html body.faithful-target[data-board-background=cosmic] #modal .production-summary-grid>article{background:#192b3c!important;color:#f6ebd6!important;border-color:#718597!important;box-shadow:none!important;}
html body.faithful-target[data-board-background=cosmic] #modal .production-summary :is(h2,h3,dt,dd,strong,.production-amount){color:#f6ebd6!important;opacity:1;}
html body.faithful-target[data-board-background=cosmic] #modal .production-summary small{color:#c7bda9!important;opacity:1;}
/* Audit follow-up: nested shortage spans and legacy resource/progress surfaces. */
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet){--shortfall-ink:#ffceca;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) :is(.resource-shortfall-message,.shortfall-item,.shortfall-number,.trade-form-error){color:#ffceca!important;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) .resource>div{background:#192b3c!important;color:#f6ebd6!important;border-color:#718597!important;box-shadow:none!important;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) .resource :is(small,b){color:#f6ebd6!important;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) :is(.research-progress,.rover-relocation,.dual-drone-tools){background:#192b3c!important;color:#f6ebd6!important;border-color:#718597!important;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) :is(.research-progress,.rover-relocation,.dual-drone-tools) :is(h3,h4,p,small,strong,b){color:#f6ebd6!important;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) .research-progress-slots>span{background:#0b1520!important;color:#c7bda9!important;border-color:#718597!important;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) .research-progress-slots>span.filled{background:#162a3b!important;border-color:#caac72!important;}
html body.faithful-target[data-board-background=cosmic] .company-summary-heading:has(h2 .company-name)>img{display:none;}
/* Live comparison: preserve the unobtrusive close glyph and raised gold CTA. */
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) button.close,
html body.faithful-target[data-board-background=cosmic] #faithful-context .faithful-context-heading>button{background:transparent!important;border-color:transparent!important;box-shadow:none!important;}
html body.faithful-target[data-board-background=cosmic] :is(#modal,#faithful-context,#desktop-drawer,#phone-faithful .sheet) button.primary:not(:disabled){background:linear-gradient(#ddbf83,#b58a48)!important;color:#211b23!important;border-color:#d5b477!important;box-shadow:inset 0 1px 0 #fff5!important;}
html body.faithful-target[data-board-background=cosmic] #faithful-context .installation-overview,
html body.faithful-target[data-board-background=cosmic] #faithful-context .installation-overview :is(p,strong,small){background:#192b3c!important;color:#f6ebd6!important;}
/* Welcome always uses Cosmic, even when the game-board preference is Tabletop. */
html[data-ui-runtime=web] body.faithful-target #online-screen:not(.welcome-screen) .experimental-setup,
html[data-ui-runtime=web] body.faithful-target #modal.local-entry-dialog :is(.experimental-setup,.installation-rules){background:#192b3c!important;color:#f6ebd6!important;border-color:#b9955a!important;}
html[data-ui-runtime=web] body.faithful-target #online-screen:not(.welcome-screen) .experimental-setup :is(small,strong,p),
html[data-ui-runtime=web] body.faithful-target #modal.local-entry-dialog :is(.experimental-setup,.installation-rules) :is(small,strong,p){color:#f6ebd6!important;}
html[data-ui-runtime=web] body.faithful-target #modal.local-entry-dialog .close{background:transparent!important;border-color:transparent!important;}
/* Score categories stay whole; narrower windows scroll the table. */
html body.faithful-target[data-board-background=cosmic] #modal:has(.final-table){width:min(1180px,calc(100vw - 32px));max-width:calc(100vw - 32px);}
html body.faithful-target[data-board-background=cosmic] #modal:has(.final-table) #modalbody{overflow-x:auto;}
html body.faithful-target[data-board-background=cosmic] #modal .final-table{min-width:900px;table-layout:auto;}
html body.faithful-target[data-board-background=cosmic] #modal .final-table th{white-space:nowrap;word-break:normal;overflow-wrap:normal;}
html body.faithful-target[data-board-background=cosmic] #modal .final-heading{padding-right:45px;flex-wrap:wrap;gap:12px;}

/* Shared setup controls retain their own readable surface inside the entry theme. */
html[data-ui-runtime=web] body.faithful-target #online-screen :is(.experimental-setup,.market-setup){display:grid!important;grid-template-columns:20px minmax(0,1fr);align-items:start;gap:6px 12px;text-align:left;box-sizing:border-box}
html[data-ui-runtime=web] body.faithful-target #online-screen :is(.experimental-setup,.market-setup) input[type=checkbox]{width:20px!important;height:20px!important;min-height:20px!important;margin:0!important}
html[data-ui-runtime=web] body.faithful-target #online-screen :is(.experimental-setup,.market-setup) small{grid-column:2;margin:0!important}
