/* Optional personal palettes. Standard retains the existing product styling. */
html[data-theme="emerald"]{--bg:#08130f;--bg-2:#0c1914;--panel:#11251d;--panel-2:#183126;--raise:#203e31;--line:#2b493b;--line-2:#365d4b;--line-3:#4b7861;--ink:#effaf4;--ink-2:#c6e3d4;--muted:#a0c0af;--faint:#809f8e;--brand:#19815b;--brand-2:#6ee7b7;--brand-dk:#126346;--brand-bg:#19815b26;--brand-line:#4ea88180;--theme-glow:#19815b20;--theme-link:#8cf0c6;--theme-selection:#19815b66;--glow:0 0 0 1px #4ea88180;}
html[data-theme="amethyst"]{--bg:#120e1b;--bg-2:#191324;--panel:#211a31;--panel-2:#2b223d;--raise:#372b4e;--line:#443454;--line-2:#5b466e;--line-3:#755c8c;--ink:#f6f0ff;--ink-2:#ddd0ee;--muted:#bca9d1;--faint:#a08db5;--brand:#8452c4;--brand-2:#c7a1ff;--brand-dk:#693b9e;--brand-bg:#8452c426;--brand-line:#ac80df80;--theme-glow:#8452c420;--theme-link:#d5baff;--theme-selection:#8452c466;--glow:0 0 0 1px #ac80df80;}
html[data-theme="ivory"]{color-scheme:light;--bg:#f5f2eb;--bg-2:#ede8de;--panel:#fffdf8;--panel-2:#f1ece2;--raise:#e8e1d4;--line:#d3ccbf;--line-2:#b9b1a2;--line-3:#9a9181;--ink:#252d2a;--ink-2:#414e48;--muted:#5d685f;--faint:#667267;--brand:#216a58;--brand-2:#195747;--brand-dk:#174c3e;--brand-bg:#216a5812;--brand-line:#216a5855;--ok:#146143;--warn:#815000;--bad:#a02924;--theme-glow:#b69b6020;--theme-link:#164f41;--theme-selection:#216a5833;--shadow:0 8px 28px #3c342414;--glow:0 0 0 1px #216a5855;}
html[data-theme="emerald"],html[data-theme="amethyst"]{color-scheme:dark;}
html[data-theme]:not([data-theme="standard"]){--accent:var(--brand);--accent-soft:var(--brand-bg);--ink-soft:var(--muted);--ink-faint:var(--faint);--line-strong:var(--line-2);--blue:var(--brand-2);--blue-soft:var(--brand-bg);}
html[data-theme]:not([data-theme="standard"]) body{background:var(--bg);color:var(--ink);}
html[data-theme]:not([data-theme="standard"]) body::before{background:radial-gradient(46% 38% at 18% 14%,rgba(var(--brand-rgb),.18),transparent 62%),radial-gradient(36% 30% at 72% 18%,rgba(var(--brand-rgb),.10),transparent 62%);}
html[data-theme]:not([data-theme="standard"]) body::after{background:linear-gradient(105deg,transparent 42%,rgba(var(--brand-rgb),.075) 49%,rgba(var(--brand-rgb),.14) 51%,transparent 58%);}
html[data-theme]:not([data-theme="standard"]) a:hover{color:var(--theme-link);}
html[data-theme]:not([data-theme="standard"]) ::selection{background:var(--theme-selection);}
.sb-appearance{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px;font:inherit;color:var(--ink,#eef2f8);}
.sb-side .sb-appearance{flex-direction:column;align-items:stretch;margin-top:auto;}
.sb-appearance label{font-size:12px;font-weight:600;}
.sb-appearance select{width:auto;max-width:100%;min-height:38px;border:1px solid var(--line-2,#374357);border-radius:8px;padding:7px 10px;background:var(--panel,#111725);color:var(--ink,#eef2f8);font:inherit;}
.sb-appearance select:focus-visible{outline:2px solid var(--brand-2,#6ea3ff);outline-offset:3px;}
@media print{.sb-appearance{display:none!important}}

/* Shared accent channels also drive the original moving backlight. */
:root{--brand-rgb:79,140,255;--brand-text:#cfe0ff;--on-brand:#fff;--brand-hover:#9dc0ff;}
html[data-theme="emerald"]{--brand-rgb:25,129,91;--brand-text:#b9f3d7;--brand-hover:#8cf0c6;}
html[data-theme="amethyst"]{--brand-rgb:132,82,196;--brand-text:#e2ceff;--brand-hover:#d5baff;}
html[data-theme="ivory"]{--brand-rgb:33,106,88;--brand-text:#164f41;--brand-hover:#164f41;--amber:var(--warn);--amber-soft:#81500012;--amber-line:#81500055;--red:var(--bad);--red-soft:#a0292412;--red-line:#a0292455;}
html[data-theme]:not([data-theme="standard"]) .sb-nav a.on{color:var(--brand-text);}
html[data-theme]:not([data-theme="standard"]) :is(.sb-brand-name,.hm-title,.brand-n){background:linear-gradient(92deg,var(--ink),var(--brand-text) 62%,var(--brand-2));background-clip:text;-webkit-background-clip:text;}
html[data-theme]:not([data-theme="standard"]) :is(input,select,textarea){background-color:var(--bg-2);color:var(--ink);border-color:var(--line-2);}
html[data-theme]:not([data-theme="standard"]) :is(.dc-modal,.popover,.basket-panel,.acc-card,.app-header,.sb-more-menu){background-color:var(--panel);color:var(--ink);}
html[data-theme]:not([data-theme="standard"]) :is(.quick-dispute,.dc-strategy-box,.it-radio,.it-confirm,.it-reroute){background-color:var(--panel-2);}
html[data-theme]:not([data-theme="standard"]) :is(.popover-actions button,.dc-actions button){background-color:var(--panel-2);color:var(--ink);}
html[data-theme]:not([data-theme="standard"]) :is(button.primary,.btn-primary,.dc-actions button.primary,.popover-actions button.primary){background:linear-gradient(135deg,var(--brand),var(--brand-dk));color:var(--on-brand);}
html[data-theme]:not([data-theme="standard"]) :is(.sb-title,.hm-greeting){color:var(--ink);}
html[data-theme]:not([data-theme="standard"]) :focus-visible{outline-color:var(--brand-2);}
html[data-theme="ivory"] :is(.it-ok,.status-done,.review-pill.done){color:var(--ok);}
html[data-theme="ivory"] :is(.it-err,.status-err){color:var(--bad);}

/* The report review also uses the ambient light, without importing layout rules. */
html[data-theme] body::before,html[data-theme] body::after{content:"";position:fixed;inset:-25% -10%;z-index:0;pointer-events:none;}
html[data-theme] body::before{animation:theme-drift 34s ease-in-out infinite alternate;}
html[data-theme] body::after{animation:theme-sweep 17s linear infinite;}
html[data-theme] #app{position:relative;z-index:1;}
@keyframes theme-drift{from{transform:translate3d(0,0,0)}to{transform:translate3d(2.5%,-2%,0)}}
@keyframes theme-sweep{0%{transform:translate3d(-62%,0,0) rotate(-4deg);opacity:0}12%,62%{opacity:1}100%{transform:translate3d(62%,0,0) rotate(-4deg);opacity:0}}
html[data-theme="emerald"] img[src$="sweepsquad-logo.svg"]{filter:hue-rotate(-65deg);}
html[data-theme="amethyst"] img[src$="sweepsquad-logo.svg"]{filter:hue-rotate(55deg);}
html[data-theme="ivory"] img[src$="sweepsquad-logo.svg"]{filter:hue-rotate(-65deg) saturate(.7);}
@media(prefers-reduced-motion:reduce){html[data-theme] body::before,html[data-theme] body::after{animation:none;}}

/* Desktop chrome uses a complementary neutral, never the standard navy. */
html[data-theme="emerald"]{--theme-side-top:#182a25;--theme-side-bottom:#101e1b;--theme-top:#13231e;--theme-broom-filter:hue-rotate(-65deg);}
html[data-theme="amethyst"]{--theme-side-top:#2c2433;--theme-side-bottom:#201b27;--theme-top:#251e2c;--theme-broom-filter:hue-rotate(55deg);}
html[data-theme="ivory"]{--theme-side-top:#e8e2d6;--theme-side-bottom:#dad3c5;--theme-top:#eee9df;--theme-broom-filter:hue-rotate(-65deg) saturate(.7);}
html[data-theme]:not([data-theme="standard"]) .sb-side{background:linear-gradient(180deg,var(--theme-side-top),var(--theme-side-bottom));backdrop-filter:none;-webkit-backdrop-filter:none;}
html[data-theme]:not([data-theme="standard"]) .sb-top{background:var(--theme-top);backdrop-filter:none;-webkit-backdrop-filter:none;}
/* Home already supplies a broom. Other workspace pages get one behind the
   content in every palette, with no pointer interception. */
html[data-theme]:not(:has(.hm-sky)) :is(.sb-app,#app)::before{
  content:"";position:fixed;top:50vh;left:50vw;width:76px;height:76px;margin:-38px 0 0 -38px;
  z-index:-1;pointer-events:none;border-radius:22%;opacity:.32;
  background:url('/sweepsquad-logo.svg') center/contain no-repeat;
  filter:var(--theme-broom-filter,none);box-shadow:0 0 42px -5px rgba(var(--brand-rgb),.42);
  animation:theme-broom-drift 46s ease-in-out infinite;will-change:transform;
}
@keyframes theme-broom-drift{
  0%,100%{transform:translate3d(-30vw,-22vh,0) rotate(-11deg)}
  17%{transform:translate3d(22vw,-30vh,0) rotate(9deg)}
  33%{transform:translate3d(33vw,8vh,0) rotate(-5deg)}
  51%{transform:translate3d(4vw,27vh,0) rotate(8deg)}
  68%{transform:translate3d(-27vw,18vh,0) rotate(-8deg)}
  84%{transform:translate3d(-33vw,-9vh,0) rotate(4deg)}
}
@media(prefers-reduced-motion:reduce){html[data-theme]:not(:has(.hm-sky)) :is(.sb-app,#app)::before{animation:none;display:none;}}

html[data-theme="ivory"] :is(.sb-side,.sb-top){--muted:#4c5952;--faint:#4c5952;}

/* Home cards must follow the selected palette rather than the default navy. */
html[data-theme]:not([data-theme="standard"]) .hm-card{
  background:linear-gradient(160deg,var(--panel-2),var(--panel));
  backdrop-filter:none;-webkit-backdrop-filter:none;
}
