/* SPHERE DARK THEME v1 — opt-in only; light UI remains unchanged */
html.sphere-dark{color-scheme:dark!important;background:#0f0b16!important;
 --blue:#c69aff;--blue-dark:#a563eb;--pink:#f57ac3;--pink-soft:#eaa0d0;
 --bg:#100c16;--text:#f4eefa;--muted:#c4b7ce;
 --card:#241a2b;--border:#58405f;--glass-line:#584363;
 --glass-shadow:0 6px 16px rgba(10,4,16,.22),inset 0 1px 0 rgba(255,255,255,.06);
 --glass-surface:linear-gradient(145deg,#2b2134,#201a29 70%,#2b1b31);}
html.sphere-dark body,html.sphere-dark body:not([data-sphere-screen="home"]),
html.sphere-dark body.sphere-editor-refresh,
html.sphere-dark body[data-sphere-screen="home"]:not(.sphere-editor-refresh),
html.sphere-dark body.pc-admin{
 --se-blue:#b18aff;--se-navy:#eee9fa;--se-ink:#eeeaf7;--se-line:#413748;--se-muted:#b8afc6;
 --sh-ink:#eeeaf7;--sh-violet:#b795ff;--text:#f0ebf8;--muted:#b6adc5;
 --card:#241a2b;--border:#58405f;
 background:radial-gradient(ellipse 85% 45% at 12% 9%,rgba(238,87,164,.18),transparent 72%),
 radial-gradient(ellipse 78% 43% at 92% 74%,rgba(188,76,161,.12),transparent 75%),
 linear-gradient(155deg,#1b1221,#100c16 53%,#1a1023 100%) #100c16!important;
 color:#f0ebf8!important;}
html.sphere-dark body .screen,html.sphere-dark body .sphere-client-home,html.sphere-dark body .cl-dash,
html.sphere-dark body .se-home,html.sphere-dark body .pca{color:#eeeaf7!important;}
html.sphere-dark body h1,html.sphere-dark body h2,html.sphere-dark body h3,html.sphere-dark body h4,
html.sphere-dark body .header h1,html.sphere-dark body .header h2,
html.sphere-dark body .screen .header h1,html.sphere-dark body .section-title h3,
html.sphere-dark body .mi-text b,html.sphere-dark body .se-section-title,
html.sphere-dark body .se-section-head h2,html.sphere-dark body .se-greeting h1,
html.sphere-dark body .se-shortcuts b,html.sphere-dark body .se-job-card h3,
html.sphere-dark body .se-page-head h1,html.sphere-dark body .se-brand,
html.sphere-dark body .se-page-brand,html.sphere-dark body .se-portfolio-info b,
html.sphere-dark body .se-earning-row b,html.sphere-dark body .se-earn-grid strong,
html.sphere-dark body .se-empty>b,html.sphere-dark body .se-job-bottom>strong,
html.sphere-dark body .pca-top h1{color:#f3effa!important;}
html.sphere-dark body .muted,html.sphere-dark body .mi-text small,html.sphere-dark body .header p,
html.sphere-dark body .cl-hello span,html.sphere-dark body .cl-stat span,
html.sphere-dark body .se-greeting p,html.sphere-dark body .se-job-card>p,
html.sphere-dark body .se-job-bottom,html.sphere-dark body .se-dash-stats small,
html.sphere-dark body .se-earning-row small,html.sphere-dark body .se-portfolio-info small,
html.sphere-dark body .se-earn-note,html.sphere-dark body .se-page-head p,
html.sphere-dark body .se-section-head small,html.sphere-dark body .pcv-item small,
html.sphere-dark body .pcv-tags i{color:#b8afc7!important;}
html.sphere-dark body .card,html.sphere-dark body.sphere-editor-refresh .card,
html.sphere-dark body .menu-item,html.sphere-dark body .cl-proj,html.sphere-dark body .cl-stat,
html.sphere-dark body .cl-hello,html.sphere-dark body .help-mini,html.sphere-dark body .se-job-card,
html.sphere-dark body .se-empty,html.sphere-dark body .se-greeting,
html.sphere-dark body .se-dash-stats button,html.sphere-dark body .se-shortcuts button,
html.sphere-dark body .se-earn-grid>div,html.sphere-dark body .se-earning-row,
html.sphere-dark body .se-portfolio-row,html.sphere-dark body .se-add-panel,
html.sphere-dark body .nt-item,html.sphere-dark body .jf,
html.sphere-dark body .pcv-list,html.sphere-dark body .pcv-box,html.sphere-dark body .pcv-detail,
html.sphere-dark body .pca .card,
html.sphere-dark body .sh-glass-panel,html.sphere-dark body .sphere-client-home .sh-glass-panel{
 background:var(--glass-surface)!important;border-color:var(--glass-line)!important;
 color:var(--text)!important;box-shadow:var(--glass-shadow)!important;}
html.sphere-dark body .menu-item.highlight{background:linear-gradient(135deg,#42233e,#241b30)!important;border-color:#975688!important;}
html.sphere-dark body .cl-dash>.section-title,
html.sphere-dark body .sphere-client-home .cl-dash>.section-title,
html.sphere-dark body .se-add-panel.se-details-panel>summary{
 background:linear-gradient(130deg,#2b2238,#1d1a28)!important;
 border-color:#51405d!important;box-shadow:0 5px 15px rgba(0,0,0,.2)!important;color:#f0eafa!important;}
html.sphere-dark body .sphere-client-home .topbar-logo span,
html.sphere-dark body .sphere-client-home .cl-hello b,
html.sphere-dark body .sphere-client-home .section-title h3,
html.sphere-dark body .sphere-client-home .cl-dash>.section-title h3,
html.sphere-dark body .sphere-client-home .explore-item span,
html.sphere-dark body .sphere-client-home .tool-card span,
html.sphere-dark body .se-home-top .se-brand,
html.sphere-dark body .se-home-top .se-brand b{color:#f4eefa!important;text-shadow:none!important;}
html.sphere-dark body .sphere-client-home .explore-circle,
html.sphere-dark body .sphere-client-home .tool-card-img,
html.sphere-dark body .sphere-client-home .service-card,
html.sphere-dark body .cat-icon-box{
 background:#292333!important;border-color:#4b3c54!important;box-shadow:0 4px 13px rgba(0,0,0,.24)!important;}
/* Preserve every original photo, icon illustration and video. */
html.sphere-dark img,html.sphere-dark video,html.sphere-dark canvas,html.sphere-dark .editor-art{filter:none;}
html.sphere-dark body .mi-icon,html.sphere-dark body .nt-ic,
html.sphere-dark body .se-round,html.sphere-dark body .se-top-actions .se-round,
html.sphere-dark body .se-portfolio-glyph,html.sphere-dark body .se-earn-item-icon,
html.sphere-dark body .se-brand span,html.sphere-dark body .sphere-editor-app-back,
html.sphere-dark body .sphere-client-home .sec-min{
 color:#c8a8ff!important;background:linear-gradient(145deg,#382946,#231c30)!important;
 border-color:#594569!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 4px 10px rgba(0,0,0,.25)!important;}
html.sphere-dark body.sphere-editor-refresh .se-shortcut-icon,
html.sphere-dark body.sphere-editor-refresh .se-stat-icon,
html.sphere-dark body.sphere-editor-refresh .mi-icon:has(.editor-art){
 background:transparent!important;border:0!important;box-shadow:none!important;}
html.sphere-dark body .field input,html.sphere-dark body .field select,html.sphere-dark body .field textarea,
html.sphere-dark body .jf input,html.sphere-dark body .jf select,
html.sphere-dark body textarea.ed-text,html.sphere-dark body .otp-phone input,
html.sphere-dark body .otp-code,html.sphere-dark body .pcv-search,
html.sphere-dark body .pca input:not([type=checkbox]),html.sphere-dark body .pca select,
html.sphere-dark body .pca textarea,html.sphere-dark body .search-box,
html.sphere-dark body .home-search-bottom,html.sphere-dark body .se-search,
html.sphere-dark body .chat-input-bar input,
html.sphere-dark body input:not([type=checkbox]):not([type=radio]):not([type=range]),
html.sphere-dark body textarea,html.sphere-dark body select{
 background:#24202c!important;color:#f3effa!important;-webkit-text-fill-color:#f3effa!important;
 border-color:#4e405b!important;caret-color:#b48bff;box-shadow:none!important;}
html.sphere-dark body .se-search input,html.sphere-dark body .search-box input,
html.sphere-dark body .home-search-bottom input{background:transparent!important;border:0!important;}
html.sphere-dark body input::placeholder,html.sphere-dark body textarea::placeholder{color:#afa5be!important;opacity:1;}
html.sphere-dark body select option{background:#201b28;color:#f3effa;}
html.sphere-dark body .btn-outline,html.sphere-dark body .btn-sm,
html.sphere-dark body .cl-tabs button,html.sphere-dark body .nt-seg,html.sphere-dark body .nt-seg button,
html.sphere-dark body .pick-chip,html.sphere-dark body .pill,
html.sphere-dark body .av-pick button,html.sphere-dark body .av-chip,
html.sphere-dark body .hrs-pick button,html.sphere-dark body .bid-sort button,
html.sphere-dark body .pj-ex span,html.sphere-dark body .pcv-chips button{
 background:#292331!important;border-color:#574663!important;
 color:#eee2fa!important;box-shadow:none!important;}
html.sphere-dark body .cl-tabs button.on,html.sphere-dark body .nt-seg button.on,
html.sphere-dark body .pick-chip.on,html.sphere-dark body .pill.active,
html.sphere-dark body .av-pick button.on,html.sphere-dark body .hrs-pick button.on,
html.sphere-dark body .bid-sort button.on,html.sphere-dark body .pcv-chips button.on{
 background:linear-gradient(110deg,#713ace,#9951c5)!important;color:#fff!important;
 border-color:#a782e3!important;}
html.sphere-dark body .btn-primary,html.sphere-dark body .prem-pill,html.sphere-dark body .se-small-cta{
 color:#fff!important;background:linear-gradient(110deg,#7439bc,#aa4fbb,#cc579a)!important;
 border-color:#c574bb!important;}
html.sphere-dark body .btn-dark{background:#43344f!important;color:#fff!important;}
html.sphere-dark body .phone-prefix,html.sphere-dark body .tl-item i,
html.sphere-dark body .bid-chip,html.sphere-dark body .pj-ai,html.sphere-dark body .pj-tag,
html.sphere-dark body .se-tag:not(.premium):not(.match),html.sphere-dark body .tag,
html.sphere-dark body .mode-chip,html.sphere-dark body .pcv-tags i{
 background:#31273b!important;color:#d7c0ff!important;border-color:#514160!important;}
html.sphere-dark body .se-tag.match,html.sphere-dark body .se-verified{background:#19372b!important;color:#8be6ba!important;}
html.sphere-dark body .se-tag.premium{background:#413217!important;color:#f4cf86!important;}
html.sphere-dark body .chat-head,html.sphere-dark body.sphere-editor-refresh[data-sphere-screen="chatThread"] .chat-head,
html.sphere-dark body .chat-input-bar,html.sphere-dark body .reply-bar,
html.sphere-dark body .emoji-panel,html.sphere-dark body .attach-sheet{
 background:#1c1823!important;color:#f3ecf9!important;border-color:#45374e!important;box-shadow:none!important;}
html.sphere-dark body .chat-head .ch-back,html.sphere-dark body .chat-head .ch-more{
 background:#32283c!important;color:#cbaaff!important;}
html.sphere-dark body .chat-bubble.them{
 background:#2d2634!important;color:#f1eaf8!important;border-color:#4c3e54!important;}
html.sphere-dark body .chat-bubble.me{background:linear-gradient(130deg,#6c37c6,#874dca)!important;color:white!important;}
html.sphere-dark body .chat-day span,html.sphere-dark body .msg-quote,html.sphere-dark body .msg-menu{
 background:#342b3d!important;color:#eae0f6!important;border-color:#55425f!important;}
html.sphere-dark body #bottomNav.bottom-nav{
 background:linear-gradient(145deg,rgba(33,27,44,.98),rgba(22,19,31,.98))!important;
 border-color:#5b4767!important;box-shadow:0 12px 26px rgba(0,0,0,.52),inset 0 1px 0 rgba(255,255,255,.09)!important;}
html.sphere-dark body #bottomNav.bottom-nav::before{background:linear-gradient(145deg,rgba(255,255,255,.06),transparent 55%)!important;}
html.sphere-dark body #bottomNav.bottom-nav::after{opacity:.34;}
html.sphere-dark body #bottomNav.bottom-nav button{color:#bdb1cc!important;}
html.sphere-dark body #bottomNav.bottom-nav button.active{color:#dfc5ff!important;}
html.sphere-dark body #bottomNav.bottom-nav .sphere-liquid-lens{
 background:linear-gradient(120deg,rgba(218,81,166,.64),rgba(120,67,146,.76),rgba(230,92,157,.62))!important;
 border-color:#c477bc!important;
 box-shadow:inset 0 1px 1px rgba(255,255,255,.20),0 4px 13px rgba(164,51,137,.23)!important;}
html.sphere-dark body .sp-dlg,html.sphere-dark body .msg-menu,
html.sphere-dark body .media-preview,
html.sphere-dark body .img-viewer{
 background:#1c1824!important;color:#eee8f6!important;border-color:#504057!important;}
html.sphere-dark body .sp-dlg-p,html.sphere-dark body .sp-dlg-raw{color:#b9adc7!important;}
html.sphere-dark body .sp-dlg-raw code{background:#31273e!important;color:#f1e8fa!important;}
html.sphere-dark body .nt-seg{background:#26212f!important;}
html.sphere-dark body .pca-side{background:#14111b!important;}
html.sphere-dark body .pca-top,html.sphere-dark body .pcv-search{
 background:#1d1925!important;color:#eee8f6!important;}
html.sphere-dark body .pcv-item:hover,html.sphere-dark body .pcv-item.on{background:#30253d!important;}
/* Previous templates contain inline white surfaces and ink. Darken only those explicitly white. */
html.sphere-dark body .screen [style*="background:#fff"]:not(img):not(svg):not(video):not(.btn-primary):not(.prem-pill),
html.sphere-dark body .screen [style*="background: #fff"]:not(img):not(svg):not(video):not(.btn-primary),
html.sphere-dark body .screen [style*="background:rgb(255,255,255)"]:not(img):not(svg):not(video){
 background:#28222f!important;border-color:#51415e!important;}
html.sphere-dark body .screen [style*="color:#111"]:not(.btn-primary):not(.prem-pill),
html.sphere-dark body .screen [style*="color:#000"]:not(.btn-primary):not(.prem-pill){
 color:#f0e9f8!important;}
/* Settings appearance card: unique to this feature. */
body .sphere-theme-card{display:flex;align-items:center;gap:11px;padding:14px 15px;}
body .sphere-theme-icon{width:42px;height:42px;min-width:42px;display:grid;place-items:center;
 border-radius:14px;background:#eee3ff;color:#7139e4;font-size:23px;}
html.sphere-dark body .sphere-theme-icon{background:#3d3051;color:#dbc3ff;}
body .sphere-theme-copy{flex:1;min-width:0;}
body .sphere-theme-copy b{display:block;font-size:15px;font-weight:800;}
body .sphere-theme-copy small{display:block;margin-top:4px;color:var(--muted);line-height:1.3;font-size:12px;}
body .sphere-theme-apply{min-height:43px;border:0;border-radius:12px;padding:11px 13px;cursor:pointer;
 background:linear-gradient(110deg,#783ae1,#a354d4);color:#fff;font-size:12px;font-weight:750;white-space:nowrap;}
html.sphere-dark body .sphere-theme-apply{background:#3b2b50;color:#e8d9fa;border:1px solid #73568d;}
body .sphere-theme-apply:focus-visible{outline:2px solid #bb94fa;outline-offset:3px;}
@media(max-width:360px){body .sphere-theme-card{gap:7px;padding:12px;}body .sphere-theme-apply{padding:10px 8px;font-size:11px;}}


/* ========== SPHERE DARK THEME HOTFIX v2 — screenshot + contrast audit ==========
   Loading overlay must NOT draw a solid rectangle behind the logo.
   Fix dark styles only; preserve existing light mode and all functions. */
html.sphere-dark body .sp-load-ov{
  background:rgba(8,7,13,.84)!important;
  -webkit-backdrop-filter:blur(9px) brightness(.42) saturate(.65)!important;
  backdrop-filter:blur(9px) brightness(.42) saturate(.65)!important;
}
html.sphere-dark body .sp-load-card{
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  outline:0!important;
  padding:0!important;
  max-width:calc(100vw - 40px);
  color:#f4ecff!important;
}
html.sphere-dark body .sp-load-card .sp-loader{
  background:transparent!important;
  box-shadow:none!important;
  isolation:isolate;
}
html.sphere-dark body .sp-load-card .sp-name,
html.sphere-dark body .splash-wrap h1{
  background:linear-gradient(105deg,#80a6ff,#a78bff 45%,#d09dff 85%)!important;
  -webkit-background-clip:text!important;
  background-clip:text!important;
  -webkit-text-fill-color:transparent!important;
  color:#cbb8ff;
}
html.sphere-dark body .sp-load-card p{
  color:#d1c4dd!important;
  -webkit-text-fill-color:#d1c4dd!important;
}
html.sphere-dark body .splash-wrap{
  background:transparent!important;color:#f3eefb!important;
}
html.sphere-dark body .sp-loading{color:#eee7f7!important;}
/* Notifications previously had black headings/text on dark panels. */
html.sphere-dark body .nt-seg button{color:#d4cae1!important;}
html.sphere-dark body .nt-seg button.on{
  background:#4b365c!important;color:#fff!important;
}
html.sphere-dark body .nt-sec h3,
html.sphere-dark body .nt-top b,
html.sphere-dark body .nt-main p,
html.sphere-dark body .nt-item:not(.nt-new) .nt-main p{
  color:#f0e9fa!important;
}
html.sphere-dark body .nt-time,
html.sphere-dark body .nt-hint{color:#b1a6bf!important;}
html.sphere-dark body .nt-tag{
  background:#342b3e!important;color:#d7c6e9!important;
}
html.sphere-dark body .nt-tag.imp{background:#432530!important;color:#ffc0cb!important;}
html.sphere-dark body .nt-new{box-shadow:0 0 0 1px rgba(156,115,209,.24)!important;}
/* Chat menu/options, AI and search controls. */
html.sphere-dark body .chat-menu,
html.sphere-dark body .search-row,
html.sphere-dark body .ai-chip,
html.sphere-dark body .sp-card,
html.sphere-dark body .chat-menu div,
html.sphere-dark body .msg-menu button,
html.sphere-dark body .tone-play,
html.sphere-dark body .pf-main,
html.sphere-dark body .se-portfolio-list .se-portfolio-row{
  background:#231e2b!important;color:#ece5f6!important;
  border-color:#4d3f59!important;
}
html.sphere-dark body .chat-menu div:hover,
html.sphere-dark body .msg-menu button:active{
  background:#362a43!important;color:#fff!important;
}
html.sphere-dark body .chat-menu .danger,
html.sphere-dark body .msg-menu .danger{color:#ff9bad!important;}
html.sphere-dark body .search-row input{background:transparent!important;border:0!important;}
html.sphere-dark body .ai-bubble:not(.me),
html.sphere-dark body .ai-msg:not(.me){
  color:#eee8f6!important;
}
html.sphere-dark body .tone-row{border-color:#45384f!important;color:#efe8f8!important;}
html.sphere-dark body .tone-row.on{background:#30273d!important;}
html.sphere-dark body .sp-card{border-color:#544664!important;}
html.sphere-dark body .pj-sec,
html.sphere-dark body .se-page-head,
html.sphere-dark body .cl-row{color:#f0eaf7!important;}
/* Preserve standout colored states; improve contrast on secondary badges. */
html.sphere-dark body .bid-chip:not(.ok):not(.warn):not(.bad),
html.sphere-dark body .mode-chip{
  color:#d8c1ff!important;
}
html.sphere-dark body .se-home-subrow,
html.sphere-dark body .se-card-action{color:#cfb7ff!important;}
html.sphere-dark body .se-shortcuts button{
  background:var(--glass-surface)!important;
}
html.sphere-dark body .se-shortcut-icon .editor-art,
html.sphere-dark body .se-stat-icon .editor-art{
  filter:none!important;
}
/* Dark UI also needs browser-native select menus and input autofill contrast. */
html.sphere-dark body input:-webkit-autofill,
html.sphere-dark body input:-webkit-autofill:focus{
  -webkit-text-fill-color:#f1e9fa!important;
  box-shadow:0 0 0 1000px #24202c inset!important;
  caret-color:#d0b4ff!important;
}
@media(prefers-reduced-motion:reduce){
  html.sphere-dark body .sp-load-card .sp-loader img{animation:none!important;}
}


/* ========== Sphere dark mode v3 — soft moving pink, mobile layout stability ==========
   Motion is confined to tiny existing accents: NEVER intercept touch/scroll or
   animate the entire page background, which can make budget phones stutter. */
html.sphere-dark body #bottomNav.bottom-nav button.active{color:#ffc3e6!important;}
html.sphere-dark body .se-home-top .se-brand span,
html.sphere-dark body .sphere-theme-icon{
 background:linear-gradient(125deg,#4b2853,#6d315f,#472c65)!important;
 color:#ffbde3!important;border-color:rgba(235,127,195,.43)!important;
}
html.sphere-dark body #bottomNav.bottom-nav .sphere-liquid-lens{
 animation:sphereDarkPinkGlow 9s ease-in-out infinite;
}
@keyframes sphereDarkPinkGlow{
  0%,100%{opacity:.78}
  50%{opacity:1}
}
html.sphere-dark body .se-home-top .se-brand span{
 background-size:180% 180%!important;
 animation:sphereDarkAccentFlow 16s ease-in-out infinite;
}
@keyframes sphereDarkAccentFlow{
  0%,100%{background-position:0% 50%}
  50%{background-position:100% 50%}
}
/* Fix the narrow-phone dark UI without touching light mode's geometry. */
@media(max-width:540px){
  html.sphere-dark body .screen,
  html.sphere-dark body .header,
  html.sphere-dark body .se-home,
  html.sphere-dark body .sphere-client-home,
  html.sphere-dark body .cl-dash,
  html.sphere-dark body .se-page-head,
  html.sphere-dark body .pca,
  html.sphere-dark body .card,
  html.sphere-dark body .sh-glass-panel,
  html.sphere-dark body .se-job-card,
  html.sphere-dark body .cl-proj,
  html.sphere-dark body .se-portfolio-row,
  html.sphere-dark body .se-earning-row{
    box-sizing:border-box;
    min-width:0;
    max-width:100%;
  }
  html.sphere-dark body .card,
  html.sphere-dark body .menu-item,
  html.sphere-dark body .se-job-card,
  html.sphere-dark body .se-portfolio-row,
  html.sphere-dark body .cl-proj{
    overflow-wrap:anywhere;
  }
  html.sphere-dark body .field input,
  html.sphere-dark body .field select,
  html.sphere-dark body .field textarea,
  html.sphere-dark body .search-box,
  html.sphere-dark body .se-search,
  html.sphere-dark body textarea,
  html.sphere-dark body select{
    box-sizing:border-box;
    max-width:100%;
    min-width:0;
  }
  html.sphere-dark body #bottomNav.bottom-nav{
    box-sizing:border-box;
    max-width:calc(100vw - 24px);
  }
  html.sphere-dark body #bottomNav.bottom-nav button{
    min-width:0;
  }
  /* Large-area backdrop blurs can show blank/torn panels on some Android GPUs. */
  html.sphere-dark body .sphere-client-home .sh-glass-panel,
  html.sphere-dark body .sh-glass-panel,
  html.sphere-dark body .sp-load-ov{
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
  }
  html.sphere-dark body .sp-load-ov{background:rgba(16,10,24,.92)!important;}
}
@media(max-width:370px){
  html.sphere-dark body .sphere-theme-card{
    flex-wrap:wrap;
    gap:8px;
  }
  html.sphere-dark body .sphere-theme-copy{flex:1 1 calc(100% - 55px);}
  html.sphere-dark body .sphere-theme-apply{
    flex:1 1 100%;
    white-space:normal;
    text-align:center;
  }
}
/* Conserve battery and respect phone accessibility settings. */
@media(prefers-reduced-motion:reduce){
  html.sphere-dark body #bottomNav.bottom-nav .sphere-liquid-lens,
  html.sphere-dark body .se-home-top .se-brand span{
    animation:none!important;
  }
}

/* v3.1: readable back controls in Sphere dark theme, all phone layouts. */
html.sphere-dark body .back-btn,
html.sphere-dark body .header .back-btn,
html.sphere-dark.os-android body .header .back-btn,
html.sphere-dark body .screen .header .back-btn,
html.sphere-dark body.sphere-editor-refresh .header .back-btn,
html.sphere-dark body .sphere-editor-app-back,
html.sphere-dark body .chat-head .ch-back,
html.sphere-dark body.sphere-editor-refresh[data-sphere-screen="chatThread"] .chat-head .ch-back {
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
html.sphere-dark body .header .back-btn::before,
html.sphere-dark body .back-btn::before {
  border-left-color:#fff!important;
  border-bottom-color:#fff!important;
}
html.sphere-dark body .header .back-btn::after { color:#fff!important; }
html.sphere-dark body .sphere-editor-app-back,
html.sphere-dark body .chat-head .ch-back {
  background:linear-gradient(135deg,#523159,#31243f)!important;
  border:1px solid rgba(255,202,235,.48)!important;
  box-shadow:0 2px 10px rgba(0,0,0,.15)!important;
}
html.sphere-dark body .header .back-btn:focus-visible,
html.sphere-dark body .sphere-editor-app-back:focus-visible,
html.sphere-dark body .chat-head .ch-back:focus-visible {
  outline:2px solid #ffd0ee!important;
  outline-offset:3px;
}

/* iOS Safari / installed iOS PWA: native controls must use the same dark
   appearance as the pink-black Sphere cards. Does not change light mode. */
html.sphere-dark body{color-scheme:dark!important;}
html.sphere-dark body .se-earn-back,
html.sphere-dark body .header .back-btn,
html.sphere-dark body .sphere-editor-app-back,
html.sphere-dark body .chat-head .ch-back{
  color:#fff!important;-webkit-text-fill-color:#fff!important;
}
html.sphere-dark body .se-earn-back span{color:#fff!important;}
/* Avoid an oversized transparent drawing surface on narrow iOS screens. */
@media(max-width:480px){
  html.sphere-dark body .sphere-client-home .cl-dash>.section-title{
    box-sizing:border-box;min-width:0;max-width:100%;
  }
  html.sphere-dark body .sphere-client-home .sec-min svg{
    display:block;max-width:100%;max-height:100%;
  }
}
