/* Shared member palette: 晴昼 / 静夜. Photography and media retain source colors. */
:root[data-member-ui]{
  --theme-page:#f6f7fa;--theme-surface:#fff;--theme-raised:#f0f3f8;--theme-input:#fafcff;
  --theme-ink:#17191f;--theme-muted:#697386;--theme-subtle:#7c8798;--theme-line:#e5e9f1;
  --theme-accent:#245bee;--theme-accent-soft:#ecf2ff;--theme-on-accent:#fff;
  --theme-button:#245bee;--theme-button-hover:#1948cc;--theme-warning:#a25418;
  --theme-shadow:0 16px 50px #25395318;--theme-danger:#b33d4a;--theme-danger-bg:#fff4f5;
  --theme-overlay:#25395345;--theme-media-bg:#f0f2f5;
  background:var(--theme-page);color:var(--theme-ink);
}
:root[data-member-ui][data-theme=dark]{
  --theme-page:#10141c;--theme-surface:#191f2b;--theme-raised:#222b3a;--theme-input:#141b27;
  --theme-ink:#eef2fa;--theme-muted:#a4afc3;--theme-subtle:#8997ae;--theme-line:#303b4f;
  --theme-accent:#86a8ff;--theme-accent-soft:#243659;--theme-on-accent:#fff;
  --theme-button:#426fe9;--theme-button-hover:#557ff0;--theme-warning:#efad73;
  --theme-shadow:0 16px 50px #0005;--theme-danger:#ff9ca8;--theme-danger-bg:#3a222e;
  --theme-overlay:#03091499;--theme-media-bg:#141b27;
}
[data-member-ui][data-theme] ::selection{background:var(--theme-accent-soft);color:var(--theme-ink)}
[data-member-ui][data-theme] body{--paper:var(--theme-page);--page-bg:var(--theme-page);--surface:var(--theme-surface);--ink:var(--theme-ink);--muted:var(--theme-muted);--line:var(--theme-line);--accent:var(--theme-accent);--accent-soft:var(--theme-accent-soft)}
[data-member-ui][data-theme] .member-theme-toggle{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:0 0 auto;
  min-height:38px;padding:8px 12px;margin:0;border:1px solid var(--theme-line);border-radius:999px;
  background:var(--theme-surface);color:var(--theme-ink);font:500 11px Inter,"Segoe UI","Microsoft YaHei",sans-serif;
  line-height:1.2;white-space:nowrap;cursor:pointer;touch-action:manipulation;
  transition:background-color .22s,border-color .22s,color .22s,transform .2s;
}
[data-member-ui][data-theme] .member-theme-toggle:hover{background:var(--theme-accent-soft);border-color:var(--theme-accent);color:var(--theme-accent)}
[data-member-ui][data-theme] .member-theme-toggle:active{transform:scale(.95)}
[data-member-ui][data-theme] .member-theme-toggle:focus-visible{outline:3px solid var(--theme-accent);outline-offset:3px}
[data-member-ui] .member-theme-icon{display:block;width:17px;height:17px;flex:0 0 17px;transition:transform .25s}
[data-member-ui] .member-theme-toggle:active .member-theme-icon{transform:rotate(-15deg)}
[data-member-ui] .login-topbar .member-theme-toggle{margin-left:auto}
[data-member-ui] .workspace-topbar .member-theme-toggle{min-width:38px}
[data-member-ui] .member-theme-sidebar{align-self:flex-start;margin:0 9px 20px!important}

/* The account page is rendered separately from the try-on workspace. */
[data-member-ui][data-theme] body:has(#sidebar){--bg:var(--theme-page);--card:var(--theme-surface);background:var(--theme-page);color:var(--theme-ink)}
[data-member-ui][data-theme] #sidebar{background:var(--theme-surface);border-color:var(--theme-line)}
[data-member-ui][data-theme] #sidebar .brand{color:var(--theme-ink)}
[data-member-ui][data-theme] #sidebar .brand-mark{background:var(--theme-button);color:var(--theme-on-accent)}
[data-member-ui][data-theme] #sidebar nav button{color:var(--theme-muted)}
[data-member-ui][data-theme] #sidebar nav button.active{background:var(--theme-accent-soft);color:var(--theme-accent);border-color:var(--theme-line)}
[data-member-ui][data-theme] body:has(#sidebar) :is(.panel,#identity){background:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line)}
[data-member-ui][data-theme] body:has(#sidebar) :is(button,.button,input,select,textarea){background:var(--theme-input);border-color:var(--theme-line);color:var(--theme-ink)}
[data-member-ui][data-theme] body:has(#sidebar) :is(button,.button):hover{background:var(--theme-raised);border-color:var(--theme-accent);color:var(--theme-accent)}
[data-member-ui][data-theme] body:has(#sidebar) :is(.primary,.primary:hover){background:var(--theme-button);border-color:var(--theme-button);color:var(--theme-on-accent)}
[data-member-ui][data-theme] body:has(#sidebar) :is(.balance-hero,#notice){background:var(--theme-accent-soft);color:var(--theme-ink);border-color:var(--theme-line)}
[data-member-ui][data-theme] body:has(#sidebar) #notice.error{background:var(--theme-danger-bg);color:var(--theme-danger);border-color:var(--theme-danger)}
[data-member-ui][data-theme] body:has(#sidebar) :is(.muted,.caption,.eyebrow,footer,.sidebar-signature,.brand em,.sidebar-bottom>a){color:var(--theme-muted)}
[data-member-ui][data-theme] body:has(#sidebar) :is(th,td,header,.caption){border-color:var(--theme-line)}
[data-member-ui][data-theme] body:has(#sidebar) :is(th,tbody tr:hover){background:var(--theme-raised);color:var(--theme-muted)}
[data-member-ui][data-theme] body:has(#sidebar) :is(.stat,.quota-card,pre){background:var(--theme-raised);color:var(--theme-ink);border-color:var(--theme-line)}
[data-member-ui][data-theme] body:has(#sidebar) .stat:first-child{background:var(--theme-accent-soft);border-color:var(--theme-line);color:var(--theme-muted)}
[data-member-ui][data-theme] body:has(#sidebar) .stat strong{color:var(--theme-ink)}
[data-member-ui][data-theme] body:has(#sidebar) .badge{background:var(--theme-accent-soft);color:var(--theme-accent)}
[data-member-ui][data-theme] body:has(#sidebar) :is(td,label,.pager,footer>span){color:var(--theme-muted)}
[data-member-ui][data-theme] body:has(#sidebar) :is(.table-scroll,.tabs){border-color:var(--theme-line)}
[data-member-ui][data-theme] body:has(#sidebar) :is(input,textarea)::placeholder{color:var(--theme-subtle)}
[data-member-ui][data-theme] body:has(#sidebar) :is(input,textarea,select):focus{outline-color:var(--theme-accent);border-color:var(--theme-accent)}
[data-member-ui][data-theme] body:has(#sidebar) a{color:var(--theme-accent)}
[data-member-ui][data-theme] body:has(#sidebar) .danger{color:var(--theme-danger)}

@media(max-width:800px){
  [data-member-ui] .workspace-topbar .member-theme-toggle{width:34px;min-width:34px;min-height:36px;padding:7px;border-color:transparent;background:transparent}
  [data-member-ui] .workspace-topbar .member-theme-label{display:none}
  [data-member-ui] .member-theme-sidebar{margin:0!important}
}
@media(max-width:600px){[data-member-ui] .login-topbar .login-edition{display:none}[data-member-ui] .login-topbar .member-theme-toggle{min-height:38px;padding:8px 10px}}
@media(prefers-reduced-motion:reduce){[data-member-ui] .member-theme-toggle,[data-member-ui] .member-theme-icon{transition:none!important}}
