/* Site palettes are independent of team artwork and exported image styling. */
:root{
  color-scheme:dark;--team-export-bg:#0c0e16;
  --site-header:#141622d9;--site-popup:#1a2030;--site-shadow:#0005;
  --site-wash-a:#785aff24;--site-wash-b:#28aae61f;--site-hover:#ffffff09;
  --site-raised:#202638;--site-rule:#a3b0cb45;--site-focus:#dfc67d;
  --site-primary:linear-gradient(135deg,#ffcf4d,#f59e0b);--site-on-primary:#2a1d02;
  --site-plate:#26272d;--site-plate-text:#f2ede5;--site-plate-border:#101114;
  --site-filter:#232739;--site-theme-dot:#171c2b;
}
:root[data-site-theme="light"]{
  color-scheme:light;
  --bg:#f4f2ec;--panel:#fffcf6;--panel2:#eeeae2;--line:#d7d1c6;
  --txt:#312d3a;--mute:#716b7a;--accent:#a87517;--heart:#d63270;--gold:#96660f;--purple:#8051aa;
  --site-header:#fffcf4ed;--site-popup:#fffcf7;--site-shadow:#4d3c251c;
  --site-wash-a:#dbcba04d;--site-wash-b:#bddcdb38;--site-hover:#b6a17a14;
  --site-raised:#fffdf8;--site-rule:#b1a79070;--site-focus:#a87517;
  --site-primary:linear-gradient(135deg,#d5b36c,#b08a41);--site-on-primary:#241b0d;
  --site-plate:#f4eee1;--site-plate-text:#37302b;--site-plate-border:#d2c4aa;
  --site-filter:#3d4054;--site-theme-dot:#f4eee1;
}
:root[data-site-theme="pink"]{
  color-scheme:light;
  --bg:#faedf3;--panel:#fff7fb;--panel2:#f3e0eb;--line:#e4bed2;
  --txt:#4c2c43;--mute:#8a6079;--accent:#b23e78;--heart:#db3a7a;--gold:#956215;--purple:#8a4c9e;
  --site-header:#fff4faed;--site-popup:#fff7fb;--site-shadow:#853b631c;
  --site-wash-a:#f4b7d24d;--site-wash-b:#dac6f04d;--site-hover:#dc80ae14;
  --site-raised:#fff5fb;--site-rule:#c988ad70;--site-focus:#b23e78;
  --site-primary:linear-gradient(135deg,#e6a2c2,#c46198);--site-on-primary:#412037;
  --site-plate:#f7dce9;--site-plate-text:#592c45;--site-plate-border:#d6a0ba;
  --site-filter:#544054;--site-theme-dot:#e5a3c2;
}
body{background:radial-gradient(1200px 600px at 10% -10%,var(--site-wash-a),transparent 60%),radial-gradient(900px 500px at 100% 0%,var(--site-wash-b),transparent 60%),var(--bg)}
header{background:var(--site-header)}
button.primary,nav .tab.on{background:var(--site-primary);border-color:var(--accent);color:var(--site-on-primary)}
button.primary:hover{color:var(--site-on-primary)}
header .tools{position:relative;inset:auto}
header .tools .ui-icon{color:currentColor}
header .tools #backupToolsToggle{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:42px;padding:10px 14px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--txt);font-size:13px;box-shadow:0 3px 12px var(--site-shadow)}
header .tools #backupToolsToggle:hover,header .tools #backupToolsToggle[aria-expanded="true"]{border-color:var(--site-focus);box-shadow:0 0 0 1px var(--site-focus),0 4px 16px var(--site-shadow)}
#backupToolsToggle .ui-icon{width:17px;height:17px}
.backup-theme-indicator{width:11px;height:11px;flex:none;border-radius:50%;background:var(--site-theme-dot);border:1px solid color-mix(in srgb,var(--txt) 45%,transparent);box-shadow:0 0 0 2px var(--panel)}
header .tools .backup-actions{position:absolute;left:0;top:calc(100% + 11px);z-index:45;display:flex;flex-direction:column;align-items:stretch;gap:5px;width:236px;min-width:0;max-width:calc(100vw - 24px);padding:9px;border:1px solid var(--line);border-radius:16px;background:var(--site-popup);box-shadow:0 16px 45px var(--site-shadow);color:var(--txt);transform-origin:top left;animation:backup-reveal .16s ease-out}
header .tools .backup-actions[hidden]{display:none!important}
header .tools .backup-actions>.backup-action{justify-content:flex-start;gap:11px;width:100%;min-height:44px;padding:10px 12px;border:0;border-radius:9px;background:transparent;color:var(--txt);font-size:13px}
header .tools .backup-actions>.backup-action:hover{background:var(--site-hover)}
header .tools .backup-action .ui-icon{width:19px;height:19px;color:var(--mute)}
.site-theme-section{margin-top:4px;padding:13px 9px 7px;border-top:1px solid var(--line)}
.site-theme-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:9px;font-size:11px;color:var(--mute)}
#currentSiteTheme{color:var(--txt);font-size:10px}
.site-theme-choices{display:flex;align-items:center;justify-content:space-between;gap:10px}
header .tools .site-theme-choice{display:grid;place-items:center;position:relative;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:7px;border:0;border-radius:50%;background:transparent;color:var(--txt);touch-action:manipulation}
.site-theme-choice::before{content:'';position:absolute;inset:3px;border:1.5px solid transparent;border-radius:50%;transition:border-color .15s,transform .15s}
.site-theme-choice[aria-checked="true"]::before{border-color:var(--site-focus)}
.site-theme-choice:hover::before{border-color:var(--line);transform:scale(1.08)}
.site-theme-choice[aria-checked="true"]:hover::before{border-color:var(--site-focus)}
.site-theme-swatch{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--swatch);color:var(--swatch-ink);box-shadow:inset 0 0 0 1px #00000012,0 2px 5px var(--site-shadow)}
.site-theme-choice .ui-icon{width:14px!important;height:14px!important;opacity:0;transform:scale(.7);transition:opacity .15s,transform .15s}
.site-theme-choice[aria-checked="true"] .ui-icon{opacity:1;transform:scale(1)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid var(--site-focus);outline-offset:3px}
input,select{accent-color:var(--accent)}
@keyframes backup-reveal{from{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:none}}
/* Shared surfaces, character lists and every dialog follow the selected palette. */
html:not([data-site-theme="dark"]) button:hover{color:var(--txt)}
html:not([data-site-theme="dark"]) input::placeholder{color:var(--mute);opacity:1}
html:not([data-site-theme="dark"]) .brand-logo{filter:brightness(.48) sepia(.3)}
html[data-site-theme="pink"] .brand-logo{filter:brightness(.58) sepia(.4) hue-rotate(275deg) saturate(1.5)}
html:not([data-site-theme="dark"]) .brand .app-version{color:var(--mute);-webkit-text-fill-color:var(--mute)}
html:not([data-site-theme="dark"]) :is(.toast,.team-delete-dialog,.team-image-dialog,.theme-pop,.teams-workspace .team>.theme-pop){background:var(--site-popup);color:var(--txt);border-color:var(--line);box-shadow:0 16px 45px var(--site-shadow)}
html:not([data-site-theme="dark"]) :is(.team-delete-dialog p,.export-layout-note,.export-team-row small,.export-foot small,.export-message,.collection-advanced summary,.team-summary,.search-field .search-magnifier,.teams-workspace .team-search-wrap #teamSummary){color:var(--mute)}
html:not([data-site-theme="dark"]) :is(.export-head,.export-foot,.export-settings,.export-team-row,.collection-advanced,#collectionFilterPanel){border-color:var(--line)}
html:not([data-site-theme="dark"]) :is(.export-preview-pane,.export-preview-toolbar){background:var(--bg);color:var(--txt)}
html:not([data-site-theme="dark"]) .export-team-row{background:var(--panel2)}
html:not([data-site-theme="dark"]) .export-team-row:has(input:checked){border-color:var(--accent);background:color-mix(in srgb,var(--accent) 9%,var(--panel))}
html:not([data-site-theme="dark"]) .export-team-row input{accent-color:var(--accent)}
html:not([data-site-theme="dark"]) #pageTeams .roster-list{background:var(--line);border-color:var(--line)}
html:not([data-site-theme="dark"]) #pageTeams .roster{background:var(--panel);color:var(--txt)}
html:not([data-site-theme="dark"]) #pageTeams .roster-toggle{background:var(--panel2);color:var(--txt);border-color:var(--line)}
html:not([data-site-theme="dark"]) #pageTeams .roster-char{background:var(--panel)}
html:not([data-site-theme="dark"]) #pageTeams .roster-char:hover{background:var(--panel2)}
html:not([data-site-theme="dark"]) #pageTeams .roster-char.selected{background:color-mix(in srgb,var(--accent) 12%,var(--panel));box-shadow:inset 0 0 0 1px var(--accent)}
html:not([data-site-theme="dark"]) :is(.framed-name,.character-ribbon,.compact-nameplate){background:var(--site-plate);color:var(--site-plate-text);border-color:var(--site-plate-border);text-shadow:none}
html:not([data-site-theme="dark"]) .character-frame{border-color:var(--site-plate-border)}
html:not([data-site-theme="dark"]) .compact-nameplate .constellation-badge{color:var(--site-plate-text);border-color:var(--line);background:var(--panel2)}
html:not([data-site-theme="dark"]) #pageColl .ccard.owned{border-color:color-mix(in srgb,var(--c) 65%,var(--line));background:linear-gradient(180deg,color-mix(in srgb,var(--c) 9%,var(--panel)),var(--panel));box-shadow:0 7px 20px -15px var(--c)}
html:not([data-site-theme="dark"]) .favbtn:not(.on){background:var(--panel2);color:var(--mute)}
/* Dark filter tiles retain the approved white selected emblems and their glow. */
html:not([data-site-theme="dark"]) :is(#pageTeams .roster #rosterFilters,#pageColl #cFilters,#modal #filters) .shared-filter{background:var(--site-filter);color:#f8f5fa}
html:not([data-site-theme="dark"]) :is(#pageTeams .roster #rosterFilters,#pageColl #cFilters,#modal #filters) .shared-filter.on{background:color-mix(in srgb,var(--c) 24%,var(--site-filter));color:#fff}
html:not([data-site-theme="dark"]) #pageColl #cFilters .ownership-filters{background:var(--panel2);border-color:var(--line)}
html:not([data-site-theme="dark"]) #pageColl #cFilters .ownership-filters .ownership-filter{color:var(--mute);background:transparent}
html:not([data-site-theme="dark"]) #pageColl #cFilters .ownership-filters .ownership-filter.on{color:var(--txt);background:var(--panel);box-shadow:0 1px 5px var(--site-shadow),inset 0 0 0 1px var(--line)}
html:not([data-site-theme="dark"]) .shared-character-filters :is(.filter-cluster,.filter-group-start)::before{background:var(--site-rule)}
html:not([data-site-theme="dark"]) .shared-filter[data-tooltip]::after{background:var(--site-popup);color:var(--txt);border-color:var(--line)}
html:not([data-site-theme="dark"]) :is(#toggleRosterFilters,#toggleCollectionFilters)[aria-expanded="true"]{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,var(--panel))}
html:not([data-site-theme="dark"]) :is(#toggleRosterFilters,#toggleCollectionFilters)[data-active-count]::after{background:var(--accent);color:var(--panel);box-shadow:0 0 0 2px var(--panel)}
html:not([data-site-theme="dark"]) :is(.team-action-dock.is-floating,.teams-workspace .team>.team-size-toggle,.teams-workspace .team>.team-camera-button,.teams-workspace .team>.team-drag-handle){background:var(--site-header);color:var(--txt);border-color:var(--line);box-shadow:0 4px 16px var(--site-shadow)}
html:not([data-site-theme="dark"]) .teams-workspace .team-action-dock :is(#addTeam,#teamTrash,#undoTeam,#teamImageButton){color:var(--mute)}
html:not([data-site-theme="dark"]) .teams-workspace .team-action-dock button:hover:not(:disabled){color:var(--accent);background:var(--site-hover)}
html:not([data-site-theme="dark"]) .teams-workspace .team>.team-move-step{color:var(--mute)}
html:not([data-site-theme="dark"]) .team-action-dock .team-delete-actions{border-color:var(--line)}
html:not([data-site-theme="dark"]) :is(.team-head input,.team-head button,.team-progress,.overlay-option,.auto-theme-mode){background:var(--panel);color:var(--txt);border-color:var(--line)}
html:not([data-site-theme="dark"]) .overlay-option:has(input:checked){border-color:var(--accent);background:var(--panel2)}
html:not([data-site-theme="dark"]) .teams-workspace .team-head .danger.icon-btn{background:var(--panel);color:#b43d64;border-color:var(--line)}
html:not([data-site-theme="dark"]) .auto-theme-mode.on{border-color:var(--accent);background:var(--panel2)}
html:not([data-site-theme="dark"]) .team-delete-dialog .confirm-delete{background:#a83258;color:#fff;border-color:#a83258}
@media(max-width:760px){header .tools #backupToolsToggle{min-height:42px;padding:9px 10px;font-size:12px;gap:7px}header .tools .backup-actions{top:calc(100% + 9px)}.backup-theme-indicator{width:9px;height:9px}}
@media(prefers-reduced-motion:reduce){.backup-actions{animation:none!important}.site-theme-choice::before,.site-theme-choice .ui-icon{transition:none}}
