/* Shared CONNECT identity. Explicit member palettes override these defaults. */
html:not([data-cpa-public]) body.mm-app[data-mm-theme=light],
html[data-cpa-public] body.mm-app[data-mm-theme=light] {
 --mm-bg:#f0f3fc;--mm-surface:#fff;--mm-chrome:#f9faff;--mm-wall:#f1f4fc;
 --mm-text:#18213c;--mm-muted:#56617b;--mm-line:#dce3f2;--mm-border:#dce3f2;
 --mm-soft:#e9eefe;--mm-green:#3f50c7;--mm-bubble:#fff;--mm-mine:#e4eaff;
 --wcpa-action:#5844db;--wcpa-action-ink:#fff;--wcpa-quote:#dfdaf7;
 --studio-glow:#eceaff;--studio-gold:#6b55cd;--mm-shadow:0 4px 18px #29235d0a;
 background:var(--mm-bg);color:var(--mm-text);color-scheme:light;
}
html:not([data-cpa-public]) body.mm-app[data-mm-theme=dark],
html[data-cpa-public] body.mm-app[data-mm-theme=dark] {
 --mm-bg:#090f20;--mm-surface:#111a2e;--mm-chrome:#151f35;--mm-wall:#0d1528;
 --mm-text:#f3f6ff;--mm-muted:#b2bfd9;--mm-line:#2b3a55;--mm-border:#2b3a55;
 --mm-soft:#202e4b;--mm-green:#b6bdff;--mm-bubble:#1b2943;--mm-mine:#2c3860;
 --wcpa-action:#6554dc;--wcpa-action-ink:#fff;--wcpa-quote:#30294f;
 --studio-glow:#252044;--studio-gold:#bcafff;--mm-shadow:0 4px 18px #0002;
 background:var(--mm-bg);color:var(--mm-text);color-scheme:dark;
}
/* Esmeralda remains available only when the member selects it. */
html body.mm-app[data-mm-theme=light][data-mm-palette=emerald],
html[data-cpa-public] body.mm-app[data-mm-theme=light][data-mm-palette=emerald] {
  --mm-bg:#f5f8f6;--mm-surface:#fff;--mm-chrome:#fff;
  --mm-text:#18352c;--mm-muted:#50645a;--mm-line:#d4e2da;--mm-border:#d4e2da;
  --mm-green:#007b5c;--mm-soft:#e8f5ee;--mm-bubble:#fff;--mm-mine:#d9f5e8;--mm-wall:#f5f8f6;
  --wcpa-action:#008568;--wcpa-action-ink:#fff;--wcpa-quote:#c8eada;
  --mm-shadow:0 4px 18px #18352c0a;--studio-glow:#f5faf7;--studio-gold:#806020;
  color-scheme:light;
}
html body.mm-app[data-mm-theme=dark][data-mm-palette=emerald],
html[data-cpa-public] body.mm-app[data-mm-theme=dark][data-mm-palette=emerald] {
  --mm-bg:#12241e;--mm-surface:#1a3027;--mm-chrome:#20392e;
  --mm-text:#f0faf4;--mm-muted:#c0d5c9;--mm-line:#3d5d4e;--mm-border:#3d5d4e;
  --mm-green:#77e4b8;--mm-soft:#294a3a;--mm-bubble:#243f32;--mm-mine:#305e47;--mm-wall:#14291f;
  --wcpa-action:#77e4b8;--wcpa-action-ink:#102d20;--wcpa-quote:#254735;
  --mm-shadow:0 4px 18px #0002;--studio-glow:#284c38;--studio-gold:#e3cb92;
  color-scheme:dark;
}
html body.mm-app[data-mm-theme] {
  --mm-action-fill:var(--wcpa-action);
  --mm-mine-fill:var(--mm-mine);
  --mm-ambient:radial-gradient(ellipse at 5% 0%,var(--mm-soft),transparent 65%);
  --mm-card-shadow:0 4px 16px #20346408;
  --mm-card-shine:inset 0 1px 0 #ffffffb3;
  --c-surface:var(--mm-bg);--c-panel:var(--mm-surface);--c-ink:var(--mm-text);
  --c-muted:var(--mm-muted);--c-line:var(--mm-line);--c-soft:var(--mm-soft);
  --c-accent:var(--mm-green);--c-accent-ink:var(--wcpa-action-ink);
  --ios-bg:var(--mm-wall);--ios-chrome:var(--mm-chrome);--ios-bubble:var(--mm-bubble);
  --ios-mine:var(--mm-mine);--ios-line:var(--mm-line);--ios-ink:var(--mm-text);
  --ios-muted:var(--mm-muted);--ios-accent:var(--mm-green);--ios-gold:var(--studio-gold);
  background:var(--mm-bg);color:var(--mm-text);
}
/* The standard identity blends both brand colors. Explicit member palettes keep
   their own action color, including their contrast-tested foreground. */
html body.mm-app[data-mm-theme]:is(:not([data-mm-palette]),[data-mm-palette=connect],[data-mm-palette=default]) {
  --mm-action-fill:linear-gradient(125deg,#2865df 0%,#7141d5 100%);
  --mm-ambient:radial-gradient(ellipse at 0% 0%,#3a7ae51c,transparent 60%),radial-gradient(ellipse at 100% 100%,#8652de17,transparent 65%);
  --mm-mine-fill:linear-gradient(125deg,#e2edff,#e9e1ff);
}
html body.mm-app[data-mm-theme=dark] {
  --mm-card-shadow:0 5px 18px #00000020;
  --mm-card-shine:inset 0 1px 0 #ffffff12;
}
html body.mm-app[data-mm-theme=dark]:is(:not([data-mm-palette]),[data-mm-palette=connect],[data-mm-palette=default]) {
  --mm-mine-fill:linear-gradient(125deg,#253d64,#3b2e62);
  --mm-ambient:radial-gradient(ellipse at 0% 0%,#3268d12b,transparent 60%),radial-gradient(ellipse at 100% 100%,#8853d522,transparent 65%);
}
html body.mm-app[data-mm-theme] :is(.mm-shell,.mm-list-pane,.mm-thread-list,.mm-existing-list,.mm-conversation-pane) {
  background:var(--mm-surface);color:var(--mm-text);border-color:var(--mm-line);
}
html body.mm-app[data-mm-theme] :is(.mm-list-header,.mm-chat-header,.mm-rail,.mm-bottom-nav,.composer,.direct-compose,.mm-context-note,.mm-profile-footer) {
  background:var(--mm-chrome)!important;color:var(--mm-text);border-color:var(--mm-line);
}
html body.mm-app[data-mm-theme] :is(.mm-row-copy strong,.mm-list-title h1,.mm-chat-heading strong) {color:var(--mm-text)}
html body.mm-app[data-mm-theme] :is(.mm-row-copy small,.mm-row-meta,.mm-section-caption,.mm-settings-description,.mm-field-help,.mm-list-empty) {color:var(--mm-muted)}
html body.mm-app[data-mm-theme] :is(.mm-search,.mm-filters,.wcpa-inbox-utilities) {background:var(--mm-soft);color:var(--mm-muted);border-color:var(--mm-line)}
html body.mm-app[data-mm-theme] .mm-search input {color:var(--mm-text)}
html body.mm-app[data-mm-theme] :is(input,textarea)::placeholder {color:var(--mm-muted);opacity:1}
html body.mm-app[data-mm-theme] .mm-list-pane .mm-filters>button {background:transparent;color:var(--mm-muted);box-shadow:none}
html body.mm-app[data-mm-theme] .mm-list-pane .mm-filters>button[aria-pressed=true] {background:var(--wcpa-action);color:var(--wcpa-action-ink);box-shadow:none}
html body.mm-app[data-mm-theme] .mm-conversation-row {border-color:var(--mm-line)}
html body.mm-app[data-mm-theme] .mm-conversation-row:hover {background:var(--mm-soft)}
html body.mm-app[data-mm-theme] .wcpa-inbox-utilities {background:var(--mm-soft)}
html body.mm-app[data-mm-theme] :is(.messages,.direct-messages) {background-color:var(--mm-wall)!important}
html body.mm-app[data-mm-theme][data-mm-wallpaper=default] :is(.messages,.direct-messages) {background-image:none}
html body.mm-app[data-mm-theme] .direct-bubble {background:var(--mm-bubble);color:var(--mm-text);border-color:var(--mm-line);box-shadow:0 1px 4px #29235d08}
html body.mm-app[data-mm-theme] .direct-bubble.mine {background:var(--mm-mine)}
html body.mm-app[data-mm-theme] .mine>.quoted {background:var(--wcpa-quote);color:var(--mm-muted);border-color:var(--mm-green)}
html body.mm-app[data-mm-theme] :is(#free-text,.direct-compose textarea,.composer textarea) {
  background:var(--mm-bg)!important;color:var(--mm-text)!important;border-color:var(--mm-line)!important;
}
html body.mm-app[data-mm-theme] :is(#free-send,#media-record,.mm-primary,.wcpa-organizer-primary) {
  background:var(--wcpa-action)!important;color:var(--wcpa-action-ink)!important;border-color:var(--wcpa-action);box-shadow:none;
}
html body.mm-app[data-mm-theme] :is(.mm-settings-home,.mm-settings-panel,.mm-dialog:not(.mm-fullscreen),#mm-overflow-menu) {
  background:var(--mm-surface);color:var(--mm-text);border-color:var(--mm-line);
}
html body.mm-app[data-mm-theme] :is(.mm-dialog-head,.mm-settings-section) {background:var(--mm-chrome);color:var(--mm-text);border-color:var(--mm-line)}
html body.mm-app[data-mm-theme] :is(.mm-settings-list>button,.mm-settings-list>a,.mm-profile-card) {background:var(--mm-soft);color:var(--mm-text);border-color:var(--mm-line)}
html body.mm-app[data-mm-theme] .mm-profile-field :is(input,textarea,select) {background:var(--mm-bg);color:var(--mm-text);border-color:var(--mm-line);color-scheme:inherit}
html body.mm-app[data-mm-theme] .mm-settings-kicker {color:var(--mm-green)}
html body.mm-app[data-mm-theme] .media-audio-player.pb-voice {--voice-accent:var(--mm-green);--voice-muted:var(--mm-muted);--voice-ink:var(--mm-text)}
html body.mm-app[data-mm-theme] .mm-bottom-nav :is(button,a) {color:var(--mm-muted)}
html body.mm-app[data-mm-theme] .mm-bottom-nav :is([aria-current],#mm-show-list) {color:var(--mm-green)}
html body.mm-app[data-mm-theme] :is(.mm-community-dot,.mm-unread,.wcpa-unread-dot) {background:var(--wcpa-action);color:var(--wcpa-action-ink)}
html body.mm-app[data-mm-theme] :is(button,a,input,textarea,select):focus-visible {outline-color:var(--mm-green)}

/* The three mode cards change only this device's appearance preference. */
.mm-app .wcpa-theme-choices {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:16px 0 10px}
.mm-app .wcpa-theme-choices>button {min-width:0;min-height:128px;padding:10px 7px;border:2px solid var(--mm-line);border-radius:18px;background:var(--mm-surface);color:var(--mm-text);font:inherit;cursor:pointer}
.mm-app .wcpa-theme-choices>button[aria-pressed=true] {border-color:var(--mm-green);background:var(--mm-soft);box-shadow:0 0 0 1px var(--mm-green)}
.mm-app .wcpa-theme-choices strong {display:block;font-size:12px;font-weight:700;margin-top:10px}
.wcpa-theme-mini {display:flex;flex-direction:column;justify-content:center;gap:8px;min-height:70px;padding:10px;border:1px solid #899c9144;border-radius:10px;box-sizing:border-box}
.wcpa-theme-mini-light {background:#f5f6fc}.wcpa-theme-mini-dark {background:#141628}.wcpa-theme-mini-auto {background:linear-gradient(90deg,#f5f6fc 50%,#141628 50%)}
.wcpa-theme-mini i {width:80%;height:14px;display:block;background:#fff;border:1px solid #d4e2da;border-radius:7px 7px 7px 2px}
.wcpa-theme-mini i+i {align-self:flex-end;background:#e9e5ff;border-color:#bcb0f4;border-radius:7px 7px 2px 7px}
.wcpa-theme-mini-dark i {background:#21253d;border-color:#454466}.wcpa-theme-mini-dark i+i {background:#393060;border-color:#7664a8}
@media(max-width:359px){.mm-app .wcpa-theme-choices{gap:6px}.mm-app .wcpa-theme-choices>button{padding:8px 4px}.wcpa-theme-mini{padding:7px}.mm-app .wcpa-theme-choices strong{font-size:11px}}
@media(forced-colors:active){.mm-app .wcpa-theme-choices>button[aria-pressed=true]{outline:3px solid Highlight;outline-offset:2px}}
